onBeforeUnload method

void onBeforeUnload(
  1. VoidCallback cb
)

Registers a callback to be executed before the widget is disposed.

  • cb: The callback to be executed.

Implementation

void onBeforeUnload(VoidCallback cb) {
  _fbBeforeUnloadStore.add(cb);
}