execute method

bool execute({
  1. String? anEvent,
  2. Duration? elapsedTime,
})

Finds and executes transitions matching the given conditions, returning true if anything matched.

May execute additional transitions where Transition.condition matches.

anEvent The event name to match. elapsedTime The time to match.

Implementation

bool execute({String? anEvent, Duration? elapsedTime}) {
  final transitions = getTransitions(_currentStep, anEvent, elapsedTime);
  _currentStep = executeTransitions(transitions);
  return transitions.isNotEmpty;
}