equals method

*<Null safety>*

bool equals (List<E> other, [Equality<E> equality = const DefaultEquality()])

Implementation

bool equals(List<E> other, [Equality<E> equality = const DefaultEquality()]) {
  if (length != other.length) return false;
  for (var i = 0; i < length; i++) {
    if (!equality.equals(this[i], other[i])) return false;
  }
  return true;
}