onClose method

  1. @override
Future<void> onClose()
override

Closes the event and state Streams. This method should be called when a Controller is no longer needed. Once onClose is called, events that are added will not be processed. In addition, if onClose is called while events are still being processed, the Controller will finish processing the pending events.

Implementation

@override
Future<void> onClose() async {
  await _eventController.close();
  await _transitionSubscription?.cancel();
  return super.onClose();
}