isEqualsList<T> function

bool isEqualsList<T>(
  1. List<T>? l1,
  2. List<T>? l2
)

Returns true if both lists, l1 and l2, have equals entries in the same order.

Implementation

bool isEqualsList<T>(List<T>? l1, List<T>? l2) {
  if (identical(l1, l2)) return true;
  if (l1 == null) return false;
  if (l2 == null) return false;

  var length = l1.length;
  if (length != l2.length) return false;

  for (var i = 0; i < length; ++i) {
    var v1 = l1[i];
    var v2 = l2[i];

    if (v1 != v2) return false;
  }

  return true;
}