isEqual method

bool isEqual(
  1. Iterable<E>? other
)

Compares two lists for element-by-element equality.

Returns true if the lists are both null, or if they are both non-null, have the same length, and contain the same members in the same order. Returns false otherwise.

Implementation

bool isEqual(Iterable<E>? other) {
  final curr = this;
  if (identical(curr, other)) return true;
  if (curr == null || other == null) return false;
  if (curr.length != other.length) return false;

  final iterA = curr.iterator;
  final iterB = other.iterator;
  while (iterA.moveNext() && iterB.moveNext()) {
    if (!gf.isEqual(iterA.current, iterB.current)) return false;
  }
  return true;
}