I have been stuck on this for days, would appreciate if anyone could help,
I have 3 tabs , one has a plutoGrid and the other two are just simple text widget, When i first open the tab the tab will generate data for plutogrid, I have then added a global variable in the code List<PlutoRow> monthlyGlobalCapRows = []; . Its purpose is to hold the generate list of rows so when i switch back and forth on tabs it will still give me the old data and avoid recalculating /building data for plutoRow
For the first time when i run the app it will run fine, when i go to another tab and back it will still show the old data , now for the second time when i switch to another tab and come back to the first one i get a null error
for (var i = 0; i < monthlyGlobalCapRows.length; i++) {
final name = monthlyGlobalCapRows[i].cells['NAME']!.value;
final total = monthlyGlobalCapRows[i].cells['TOTAL']!.value;
print('provider $name $total');
}
It does print for the first time when i go to second tab and back, showing the logic is working properly
but when i do it the second time i get the error
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
the error is point on this line
final name = monthlyGlobalCapRows[i].cells['NAME']!.value;
I have been stuck on this for days, would appreciate if anyone could help, I have 3 tabs , one has a plutoGrid and the other two are just simple text widget, When i first open the tab the tab will generate data for plutogrid, I have then added a global variable in the code
List<PlutoRow> monthlyGlobalCapRows = [];
. Its purpose is to hold the generate list of rows so when i switch back and forth on tabs it will still give me the old data and avoid recalculating /building data for plutoRowFor the first time when i run the app it will run fine, when i go to another tab and back it will still show the old data , now for the second time when i switch to another tab and come back to the first one i get a null error
This is the code
Now if you see the print statement ,
It does print for the first time when i go to second tab and back, showing the logic is working properly but when i do it the second time i get the error
the error is point on this line
No clue , stuck , appreciate any help