endsWith method
Returns true if this iterable ends with the same elements that are in
other
.
Implementation
bool endsWith(
Iterable<T> other, {
bool Function(T value, T otherValue)? comparer,
}) {
comparer ??= EqualityComparer.forType<T>().compare;
final count = other.count();
final tail = takeLast(count);
return tail.sequenceEquals(other, comparer: comparer);
}