ValueKey<T> class

A key that uses a value of a particular type to identify itself.

A ValueKey<T> is equal to another ValueKey<T> if, and only if, their values are operator==.

This class can be subclassed to create value keys that will not be equal to other value keys that happen to use the same value. If the subclass is private, this results in a value key type that cannot collide with keys from other sources, which could be useful, for example, if the keys are being used as fallbacks in the same scope as keys supplied from another widget.

See also the discussion at Widget.key.

Inheritance
Implementers

Constructors

ValueKey(T value)
Creates a key that delegates its operator== to the given value.
const

Properties

hashCode int
The hash code for this object. [...]
read-only, override
value → T
The value to which this key delegates its operator==
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

toString() String
Returns a string representation of this object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
override