generate<T> method

List<T> generate<T>(
  1. T generator(
    1. int index
    ), {
  2. bool growable = true,
})

创建指定长度的List

Implementation

List<T> generate<T>(T Function(int index) generator,
        {bool growable = true}) =>
    List<T>.generate(toInt(), (int index) => generator(index),
        growable: growable);