onClose method

  1. @override
  2. @mustCallSuper
FutureOr<void> onClose()
override

Called when the object is removed from the scope or the scope is disposed.

Use this method to release resources, close streams, or cancel timers.

Implementation

@override
@mustCallSuper
FutureOr<void> onClose() {
  return _resourceCloseFuture ??= _closeOwnedResources();
}