ListEquality<E> class
Null safety
Equality on lists.
Two lists are equal if they have the same length and their elements at each index are equal.
This is effectively the same as IterableEquality except that it accesses elements by index instead of through iteration.
The equals and hash methods accepts null
values,
even if the isValidKey returns false
for null
.
The hash of null
is null.hashCode
.
Constructors
-
ListEquality([Equality<
E> elementEquality = const DefaultEquality<Never>()]) -
const
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
equals(
List< E> ? list1, List<E> ? list2) → bool -
Compare two elements for being equal.
override
-
hash(
List< E> ? list) → int -
Creates a combined hash code for a number of objects.
override
-
isValidKey(
Object? o) → bool -
Test whether an object is a valid argument to equals and hash.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited