GenerateState class

Annotation to mark a class as an Air state

This generates:

  • Pulses class with all @Pulse methods as AirPulse constants
  • Flows class with all @StateFlow fields as AirStateKey constants
  • Base class extending AirState with onPulses() implementation

Example:

@GenerateState('counter')
class CounterState extends _CounterState {
  @Pulse() void increment();
  @Pulse() void decrement();
  @StateFlow() int count = 0;
}

Constructors

GenerateState(String moduleId, {bool generateAccessors = true, bool includeDocs = true})
const

Properties

generateAccessors → bool
Whether to generate typed getters/setters for flows
final
hashCode → int
The hash code for this object.
no setterinherited
includeDocs → bool
Whether to include documentation in generated code
final
moduleId → String
Module ID for this state
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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