complete property

Future<void> complete

Call this method to ensure that your StateMachine has completed processing all Events. The StateMachine is considered to be in an indeterminate state until this method completes. If can submit additional events after calling complete but you must then call complete again to ensure the new events have been processed.

await statemachine.complete;

Implementation

Future<void> get complete async {
  while (!_isQuiescent) {
    await _eventQueue.last._completer.future;
  }
}