handleUpdateBackGestureProgress method

  1. @override
void handleUpdateBackGestureProgress(
  1. PredictiveBackEvent backEvent
)
override

Called when a predictive back gesture moves.

Currently, this is only used on Android devices that support the predictive back feature.

Implementation

@override
void handleUpdateBackGestureProgress(PredictiveBackEvent backEvent) {
  // Don't if the State object is defunct.
  if (!mounted) {
    return;
  }
  // No 'setState()' functions are allowed
  _setStateAllowed = false;

  for (final con in controllerList) {
    con.handleUpdateBackGestureProgress(backEvent);
  }

  // Optionally call the debugPrint() function
  super.handleUpdateBackGestureProgress(backEvent);

  _setStateAllowed = true;

  if (_setStateRequested) {
    _setStateRequested = false;
    // Only the latest State is rebuilt
    if (isLastState) {
      // Perform a 'rebuild' if requested.
      setState(() {});
    }
  }
}