StateMachine constructor

StateMachine({
  1. required String commandType,
  2. String eventPrefix = '',
  3. String eventSuffix = 'Event',
  4. required String eventType,
  5. String? fields,
  6. String? globals,
  7. required State initialState,
  8. String? methods,
  9. required String name,
  10. String statePrefix = '',
  11. String stateSuffix = 'State',
  12. required String stateType,
  13. 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');
  }
}