Equalizer class abstract

An abstract base class that provides value equality comparison functionality.

The Equalizer class implements custom equality comparison by comparing the properties of objects. Two objects are considered equal if they:

  • Are identical (same instance)
  • Have the same runtime type
  • Have equal properties (compared element by element)

To use this class:

  1. Extend it in your class
  2. Implement the properties getter to return a list of your class properties
  3. Optionally override stringify to control string representation

Example:

class Person extends Equalizer {
  final String name;
  final int age;

  const Person(this.name, this.age);

  @override
  List<Object?> get properties => [name, age];
}
Implementers
Annotations

Constructors

Equalizer()
const

Properties

hashCode int
The hash code for this object.
no setteroverride
properties List<Object?>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override