UniqueList<E>.filled constructor

UniqueList<E>.filled(
  1. int length, {
  2. bool growable = true,
  3. bool strict = false,
})

Creates a list of the given length filled with null values.

Implementation

factory UniqueList.filled(
  int length, {
  bool growable = true,
  bool strict = false,
}) {
  assert(length >= 0);
  final list = List<E?>.filled(length, null, growable: growable);
  return UniqueList<E>._(list.cast<E>(),
      nullable: true, strict: strict, growable: growable);
}