WIP xstate for dart & flutter
CD Player:
final machine = Machine.fromJson({
"key": "cd",
"initial": "not_loaded",
"states": {
"not_loaded": {
"on": {"INSERT_CD": "loaded"}
},
"loaded": {
"initial": "stopped",
"on": {"EJECT": "not_loaded"},
"states": {
"stopped": {
"on": {"PLAY": "playing"}
},
"playing": {
"on": {
"STOP": "stopped",
"EXPIRED_END": "stopped",
"EXPIRED_MID": "playing",
"PAUSE": "paused"
}
},
"paused": {
"initial": "not_blank",
"states": {
"blank": {
"on": {"TIMER": "not_blank"}
},
"not_blank": {
"on": {"TIMER": "blank"}
}
},
"on": {"PAUSE": "playing", "PLAY": "playing", "STOP": "stopped"}
}
}
}
}
});
machine.start(); // not_loaded
machine.transition('not_loaded', 'INSERT_CD'); // loaded.stopped
machine.transition('loaded.paused', 'EJECT'); // not_loaded
- Core FSM and functions.
machine.start()
,machine.transition(current, event)
&state.matches('state')
- Basic support for Hierarchical or Nested State Machines.
State(child: Machine ...
- Complete implementation of Statecharts (guards, context, ...)
- Parallel State Machines
- History States
- Refrence by id.
State(on: {"2": '#B'})
-
Machine.fromJson({})
ability to create machines with JSON Schema -
Machine.fromSCXML('<></>')
ability to create machines with SCXML - Binding package for flutter
- Binding package for flutter_hook
- Utility package for writing tests
- More tests
- Run a webserver in watch mode and show all the machines in xstatejs's visualizer
- Show outline for a machine and its states
- [Quick Fix] Convert
Machine.fromJson({})
&Machine.fromSCXML('<></>')
toMachine()
- [Quick Fix] Convert
Machine()
toMachine.fromJson({})
orMachine.fromSCXML('<></>')
- [Diagnostic]
machine.maches('state.state_that_doesnt_exists')
validation. (throw state_that_doesnt_exists doesn't exists on the machine) - [Diagnostic] Provide warning and errors when creating a machine for invalid transition, invalid paths and unused event and states.
- [Quick Fix] Extract nested machines.