List.generate in dart code example Example: dart list generate new List<int>.generate(3, (int index) => index * index); // [0, 1, 4]