list generator flutter code example
Example 1: generate list flutter
List<int>.generate(3, (int index) => index * index); // [0, 1, 4]
Example 2: flutter list.generate
final items = List<String>.generate(10000, (i) => "Item $i");
List<int>.generate(3, (int index) => index * index); // [0, 1, 4]
final items = List<String>.generate(10000, (i) => "Item $i");