equals method

  1. @Possible({StackOverflowError})
  2. @useResult
bool equals(
  1. Object? other
)

Determines if this and other are deeply equal.

This function is unlike Map.== which is identity-based.

Contract

A StackOverflowError is thrown if this or other contain themselves.

final a = <int, dynamic>{};
a.add(a);

a.equals(<int, dynamic>{}) // Throws StackOverflowError

Implementation

@Possible({StackOverflowError})
@useResult bool equals(Object? other) => Equality.deep(this, other);