onDispose method
Runs the initially registered callback when this widget is removed.
Implementation
void onDispose(VoidCallback callback) {
stateOf<VoidCallback>(
() => callback,
key: const ValueKey(#onDispose),
mode: .read,
onDispose: (callback) => callback(),
);
}