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.

Implemented by


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


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


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


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