onDispose method
Registers disposer to run when the job ends, whatever the outcome.
The core unwinds the stack after the children and before the outcome, last registration first, and it waits for every disposer. Returns a function that unregisters this one; calling it twice, or after the disposer has run, is safe.
A disposer runs outside the body: nothing cancels it and nothing
interrupts it, so keep it short and unconditional. It must not wait
for its own job — job.done, job.value and job.cancel() all
complete after the cleanup that would be waiting for them.
Implementation
@override
void Function() onDispose(FutureOr<void> Function() disposer) =>
addCleanup(disposer, always: true);