removeScopedWillPopCallback method
Remove one of the callbacks run by willPop.
See also:
- Form, which provides an
onWillPop
callback that uses this mechanism. - addScopedWillPopCallback, which adds callback to the list checked by willPop.
Implementation
void removeScopedWillPopCallback(WillPopCallback callback) {
assert(_scopeKey.currentState != null, 'Tried to remove a willPop callback from a route that is not currently in the tree.');
_willPopCallbacks.remove(callback);
}