BackGestureConfig constructor
- GestureMeasurement swipeDetectionArea = const GestureMeasurement.percentage(1),
- GestureMeasurement swipeTransitionRange = const GestureMeasurement.pixels(150),
- double swipeVelocityThreshold = 1100,
- double animationProgressCompleteThreshold = 0.5,
- Curve commitAnimationCurve = Curves.fastEaseInToSlowEaseOut,
- Duration? commitAnimationDuration,
- Curve cancelAnimationCurve = Curves.fastOutSlowIn,
- Duration? cancelAnimationDuration,
Creates a configuration for the back gesture.
swipeDetectionArea defines the width of the area on the screen edge
where the back gesture can be initiated.
swipeTransitionRange defines the swipe distance required to trigger
a full pop of the current route.
swipeVelocityThreshold defines the minimum swipe velocity required to
trigger a full pop of the current route.
animationProgressCompleteThreshold defines the animation progress at
which the back gesture will complete and pop the current route.
commitAnimationCurve is the curve to use for the commit animation.
commitAnimationDuration is the duration of the commit animation.
cancelAnimationCurve is the curve to use for the cancel animation.
cancelAnimationDuration is the duration of the cancel animation.
Implementation
const BackGestureConfig({
this.swipeDetectionArea = const GestureMeasurement.percentage(1),
this.swipeTransitionRange = const GestureMeasurement.pixels(150),
this.swipeVelocityThreshold = 1100,
this.animationProgressCompleteThreshold = 0.5,
this.commitAnimationCurve = Curves.fastEaseInToSlowEaseOut,
this.commitAnimationDuration,
this.cancelAnimationCurve = Curves.fastOutSlowIn,
this.cancelAnimationDuration,
}) : assert(
animationProgressCompleteThreshold >= 0.0 &&
animationProgressCompleteThreshold <= 1.0,
'Animation progress complete threshold must be between 0.0 and 1.0',
);