StateMachine constructor
StateMachine({
- required String commandType,
- String eventPrefix = '',
- String eventSuffix = 'Event',
- required String eventType,
- String? fields,
- String? globals,
- required State initialState,
- String? methods,
- required String name,
- String statePrefix = '',
- String stateSuffix = 'State',
- required String stateType,
- required Transitions transitions,
Implementation
StateMachine({
required this.commandType,
this.eventPrefix = '',
this.eventSuffix = 'Event',
required this.eventType,
this.fields,
this.globals,
required this.initialState,
this.methods,
required this.name,
this.statePrefix = '',
this.stateSuffix = 'State',
required this.stateType,
required this.transitions,
}) {
if (commandType.isEmpty) {
throw ArgumentError('The action type name must not be empty');
}
if (eventType.isEmpty) {
throw ArgumentError('The event type name must not be empty');
}
if (stateType.isEmpty) {
throw ArgumentError('The state type name must not be empty');
}
if (name.isEmpty) {
throw ArgumentError('The name must not be empty');
}
if (name.isEmpty) {
throw ArgumentError('The name must not be empty');
}
}