isEquivalent static method

bool isEquivalent(
  1. Object? a,
  2. Object? b
)

Returns true if a and b are equivalent — that is, identical, both null, equal, or of the same runtime type.

Implementation

static bool isEquivalent(Object? a, Object? b) {
  return identical(a, b) ||
      (a == null && b == null) ||
      (a != null &&
          b != null &&
          ((a == b) || (a.runtimeType == b.runtimeType)));
}