onClose method

void onClose(
  1. FutureOr<void> close()
)

Runs close when the world closes or restarts — the last registered first, as a stack unwinds. A failure is reported and the rest still run.

Implementation

void onClose(FutureOr<void> Function() close) => _closers.add(close);