startWith method

bool startWith(
  1. List<T> other, {
  2. bool compare(
    1. T,
    2. T
    )?,
})

由另外一个List开头 >>>

Implementation

bool startWith(List<T> other, {bool Function(T, T)? compare}) {
  if (other.length > this.length) {
    return false;
  }

  for (int i = 0; i < other.length; ++i) {
    var n = other[i];
    var m = this[i];
    if (!compare!(n, m)) {
      return false;
    }
  }

  return true;
}