BlocStateGraph<Event, State> class

A class representing a declarative graph that defines every possible Event -> State transitions.

This concept ensures that a bloc behaves like a FSM (Finite State Machine) where incorrect states are impossible as every possible path is predefined.

@TODO: Add documentation and examples

Constructors

BlocStateGraph({required Map<Type, Map<Type, StateTransitionCaller<Event, State>>> graph, Map<Type, StateTransitionCaller<Event, State>> unrestrictedGraph = const {}})
const

Properties

graph Map<Type, Map<Type, StateTransitionCaller<Event, State>>>
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unrestrictedGraph Map<Type, StateTransitionCaller<Event, State>>
final

Methods

call(Event event, State state) → State
Makes a transition from state to nextState using event based on graph.
callSideEffect(Event event, State state) → void
getTransitionFor(Event event, State state) StateTransitionCaller<Event, State>?
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