equals method

  1. @override
bool equals(
  1. List<E>? list1,
  2. List<E>? list2
)
override

Compare two elements for being equal.

This should be a proper equality relation.

Implementation

@override
bool equals(List<E>? list1, List<E>? list2) {
  if (identical(list1, list2)) {
    return true;
  }
  if (list1 == null || list2 == null) {
    return false;
  }
  final int length = list1.length;
  if (length != list2.length) {
    return false;
  }
  for (int i = 0; i < length; i++) {
    if (!_elementEquality.equals(list1[i], list2[i])) {
      return false;
    }
  }
  return true;
}