equalsTo method

bool equalsTo(
  1. Iterable<T> others
)

Returns true if the internals of Iterable and others are compared and match.

Iterableothersの内部を比較して一致している場合trueを返します。

Implementation

bool equalsTo(Iterable<T> others) {
  for (final t in this) {
    if (!others.any((o) {
      if (t is Iterable?) {
        if (o is! Iterable?) {
          return false;
        }
        if (!t.equalsTo(o)) {
          return false;
        }
      } else if (t is Map?) {
        if (o is! Map?) {
          return false;
        }
        if (!t.equalsTo(o)) {
          return false;
        }
      } else if (t is Set?) {
        if (o is! Set?) {
          return false;
        }
        if (!t.equalsTo(o)) {
          return false;
        }
      } else if (t != o) {
        return false;
      }
      return true;
    })) {
      return false;
    }
  }
  for (final t in others) {
    if (!any((o) {
      if (t is Iterable?) {
        if (o is! Iterable?) {
          return false;
        }
        if (!t.equalsTo(o)) {
          return false;
        }
      } else if (t is Map?) {
        if (o is! Map?) {
          return false;
        }
        if (!t.equalsTo(o)) {
          return false;
        }
      } else if (t is Set?) {
        if (o is! Set?) {
          return false;
        }
        if (!t.equalsTo(o)) {
          return false;
        }
      } else if (t != o) {
        return false;
      }
      return true;
    })) {
      return false;
    }
  }
  return true;
}