SparseList<E extends Object>.fixed constructor

SparseList<E extends Object>.fixed(
  1. int _length, {
  2. E? defaultValue,
  3. bool equals(
    1. E? e1,
    2. E? e2
    )?,
})

Implementation

SparseList.fixed(
  this._length, {
  this.defaultValue,
  bool Function(E? e1, E? e2)? equals,
}) {
  if (_length < 0) {
    throw ArgumentError('length should not be negative: $length');
  }

  _fixedLength = true;

  if (equals != null) {
    _equals = equals;
  } else {
    _equals = (E? e1, E? e2) => e1 == e2;
  }
}