is there a way to make a widget(for example Text) value linked to a variable that is inside a for loop and make it changed every time the variable changes inside the loop, i want to make the Widget Text to change as well, for example:
int count;
for(var i = 0; i <= 100; i++){
count = i;
}
the widget code:
Text('Loop: ' + count.toString());
im looking for the output to be something like
Text('Loop: 1') and every time the loop goes on the output will be Text('Loop (1,2,3,4,5....)')
but the the problem is with this code, the Text widget waits until the loop ends and gives me the last count number.
is there a way to make the text widget changes without waiting for loop to end?
Thanks.