StateGraph class

Constructors

StateGraph({String? initial, String? live, List<String> states = const [], Map<String, List<String>> transitions = const {}})
Returns a new StateGraph instance.

Properties

hashCode → int
The hash code for this object.
no setteroverride
initial ↔ String?
Initial is the state a fresh document starts in — "draft". A stored document with no status at all is read as this too.
getter/setter pair
live ↔ String?
Live is the ONE state that is publicly readable — "published". The site pulls only documents in it, so reaching Live IS site-publish; every other state is invisible to a reader.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
states ↔ List<String>
States is every lifecycle state in canonical order: draft, in_review, approved, queued, published, archived. The console lays its board columns out in exactly this order, so the order is part of the answer.
getter/setter pair
transitions ↔ Map<String, List<String>>
Transitions maps each state to the states it may move to. A target absent from a state's list is REFUSED, at the endpoint and again at the storage boundary — this is the whole rule, not a hint for the UI. A state never lists itself; a move that changes nothing is always legal.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

fromJson(dynamic value) → StateGraph?
Returns a new StateGraph instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<StateGraph>
mapFromJson(dynamic json) → Map<String, StateGraph>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<StateGraph>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.