cleanup method

  1. @override
Future<void> cleanup(
  1. Container container
)
override

Optional cleanup method called when container is disposed.

Use this method to perform any necessary cleanup operations such as closing connections or freeing resources.

Implementation

@override
Future<void> cleanup(Container container) async {
  await _eventSubscription?.cancel();
  _eventSubscription = null;
}