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