'Why is it cannot refer?

Why is it cannot refer String tit, kit?? after elementAt() instance has MANUAL01..MANUAL02

I want refer last element on next code.

snapshot.data!.COOKRCP02.row.elementAt(index).MANUAL01 <-- this

code

manualList(snapshot, index) {
  {
    for (int i = 1; i < 20; i++) {
    String tik = 'MANUAL'+i.toString(); // it says unused_local_variable
    String kik = 'MANUALIMG'+i.toString(); // it says unused_local_variable
    if(i<10){
      tik = 'MANUAL0'+i.toString();
      kik = 'MANUALIMG0'+i.toString();
    }
    var a = snapshot.data!.COOKRCP02.row.elementAt(index).tik; //<--
    var b = snapshot.data!.COOKRCP02.row.elementAt(index).kik; //<--
      if (a != null && b != null) {
        return Column(
          children: [
            Text(a),
            Image.network(b),
          ],
        );
      } else if (a != null && b == null) {
        return Column(
          children: [
            Text(a),
          ],
        );
      }
    }
  }
}

error

error message

Row Class

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source