StateMachineController constructor Null safety

StateMachineController(
  1. StateMachine stateMachine,
  2. {OnStateChange? onStateChange}
)

Implementation

StateMachineController(
  StateMachine stateMachine, {
  core.OnStateChange? onStateChange,
}) : super(stateMachine, onStateChange: onStateChange) {
  isActive = true;
  for (final input in stateMachine.inputs) {
    switch (input.coreType) {
      case StateMachineNumberBase.typeKey:
        _inputs.add(SMINumber._(input as StateMachineNumber, this));
        break;
      case StateMachineBoolBase.typeKey:
        _inputs.add(SMIBool._(input as StateMachineBool, this));
        break;
      case StateMachineTriggerBase.typeKey:
        _inputs.add(SMITrigger._(input as StateMachineTrigger, this));
        break;
    }
  }
}