SimpleStateKey<T> class

A simple implementation of AirStateKey for quick usage.

Use this when you don't need to create a custom subclass for your keys.

Example:

static const counterKey = SimpleStateKey<int>('counter', defaultValue: 0);
Inheritance
Available extensions

Constructors

SimpleStateKey(String key, {T? defaultValue})
const

Properties

defaultValue → T?
The default value returned when the state has not been initialized.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
key String
The unique string identifier used in the Air state map.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T

Available on AirStateKey<T>, provided by the AirStateKeyBuilder extension

Gets the current value from global state.
getter/setter pair

Methods

build(Widget builder(BuildContext context, T value)) Widget

Available on AirStateKey<T>, provided by the AirStateKeyBuilder extension

Builds a widget that listens to this state key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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