PageStorageKey<T> class Null safety

A key can be used to persist the widget state in storage after the destruction and will be restored when recreated.

Each key with its value plus the ancestor chain of other PageStorageKeys need to be unique within the widget's closest ancestor PageStorage. To make it possible for a saved value to be found when a widget is recreated, the key's value must not be objects whose identity will change each time the widget is created.

See also:

Inheritance

Constructors

PageStorageKey(T value)
Creates a ValueKey that defines where PageStorage values will be saved.
const

Properties

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

Methods

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