dart list create code example
Example 1: dart list generate
new List<int>.generate(3, (int index) => index * index); // [0, 1, 4]
Example 2: list dart
var fixedLengthList = List<int>.filled(5, 0);
fixedLengthList.length = 0; // Error
fixedLengthList.add(499); // Error
fixedLengthList[0] = 87;
var growableList = [1, 2];
growableList.length = 0;
growableList.add(499);
growableList[0] = 87;