newList method

  1. @override
List<int> newList(
  1. int length, {
  2. bool growable = true,
})
override

Constructs a new list.

If growable is false and the kind is either IntKind or FloatKind, the method returns a TypedData object such as Uint32List.

Implementation

@override
List<int> newList(int length, {bool growable = true}) {
  if (!growable) {
    final typedDataFactory = _typedDataFactory;
    if (typedDataFactory != null) {
      return typedDataFactory(length);
    }
  }
  return super.newList(length, growable: growable);
}