onWatcherCleanup function

void onWatcherCleanup(
  1. VoidCallback callback
)

Registers a cleanup function to be called when the watcher is disposed.

Implementation

void onWatcherCleanup(VoidCallback callback) {
  final currentWatcher = getCurrentInstance();

  currentWatcher.onCleanup(callback);
}