operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

Value equality: two structures are equal if they share the same keys reference (same schema) and all corresponding field values are equal.

Implementation

@override
bool operator ==(Object other) {
  if (identical(this, other)) return true;
  if (other is! Serializable<S>) return false;
  // Keys lists for enum types are const singletons; identity means same schema.
  if (!identical(keys, other.keys)) {
    if (keys.length != other.keys.length) return false;
  }
  for (final key in keys) {
    if (this[key] != other[key]) return false;
  }
  return true;
}