handleStartBackGesture method

  1. @override
void handleStartBackGesture({
  1. double progress = 0.0,
})
override

Handles a predictive back gesture starting.

The progress parameter indicates the progress of the gesture from 0.0 to 1.0, as in PredictiveBackEvent.progress.

Implementation

@override
void handleStartBackGesture({double progress = 0.0}) {
  final MorphFlight? flight = _flight;
  // With an overlay flight stacked above (a local history entry) the
  // back gesture pops that flight, not this route: decline the scrub.
  if (!isCurrent ||
      willHandlePopInternally ||
      flight == null ||
      flight.isFinished) {
    return;
  }
  _predictiveBack = true;
  // The scrub plays in the shuttle: the content comes back for the
  // whole gesture, whichever way it ends.
  flight.routeOwnsContent.value = false;
  flight.refreshSourceRect();
  flight.controller.beginScrub();
  _predictiveBackFrom = flight.controller.value;
  handleUpdateBackGestureProgress(progress: progress);
}