Use object :
void main() { var scope = {}; for(var i = 0; i < 5; i++){ scope['counter' + i.toString()] = 0; // create scope.counter1, scope.counter2,...) } print(scope); }
Use object :
void main() { var scope = {}; for(var i = 0; i < 5; i++){ scope['counter' + i.toString()] = 0; // create scope.counter1, scope.counter2,...) } print(scope); }
Get tutorials, Flutter news and other exclusive content delivered to your inbox. Join 1000+ growth-oriented Flutter developers subscribed to the newsletter