equals method

*<Null safety>*
  • @override

bool equals (List<E>? list1, List<E>? list2) override

Implementation

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