I have a variable which was declared initially and which will be changed after a drop down selection. I couldnot access the value after it has been changed by using for loop and c
String _selectedRegNoUpdate = 'Reg No';
String _selectedRegNoUpdate1 = 'Reg No';
String _selectedRegNoUpdate2 = 'Reg No';
String _selectedRegNoUpdate3 = 'Reg No';
String _selectedRegNoUpdate4 = 'Reg No';
String _selectedRegNoUpdate5 = 'Reg No';
for(int i = item!['workedWith'].length; i < 6 ; i++){
print(i.toString());
String workedWithPosition = '_selectedRegNoUpdate$i';
print(workedWithPosition); // this prints _selectedRegNoUpdate3
print(_selectedRegNoUpdate4); // this prints the value which is stored in _selectedRegNoUpdate4 which is 12345
print(workedWithPosition); //but this print Reg No3 not the value selected by the drop down selector
print((_selectedRegNoUpdate+i.toString()).toString());
};