AirStateKey<T> class abstract

Base class for typed state keys.

This abstract class allows defining strong types for state keys, avoiding magic strings and enabling type-safe interaction with the Air state management system.

Subclasses should define the generic type T representing the type of data held in state.

Available extensions

Constructors

AirStateKey(String key, {T? defaultValue})
Creates an AirStateKey with a required key and optional defaultValue.
const

Properties

defaultValue → T?
The default value returned when the state has not been initialized.
final
hashCode int
The hash code for this object.
no setteroverride
key String
The unique string identifier used in the Air state map.
final
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.
override

Operators

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