removeScopedWillPopCallback method

  1. @Deprecated('Use unregisterPopEntry or PopScope instead. ' 'This feature was deprecated after v3.12.0-1.0.pre.')
void removeScopedWillPopCallback(
  1. WillPopCallback callback
)

Remove one of the callbacks run by willPop.

See also:

Implementation

@Deprecated(
  'Use unregisterPopEntry or PopScope instead. '
  'This feature was deprecated after v3.12.0-1.0.pre.',
)
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);
  if (_willPopCallbacks.isEmpty) {
    _maybeDispatchNavigationNotification();
  }
}