custom_will_pop_scope
2.1.1, released 3 years ago by helmybouchiha.me
Enables onWillPop callbacks on Cupertino page transitions and improves gesture feedback.
What it does
Provides a CustomWillPopScope widget that allows developers to handle back navigation and 'onWillPop' callbacks during Cupertino page transitions. It also improves visual feedback for rejected swipe-to-go-back gestures across platforms.
AI-written summary of version 2.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need 'onWillPop' functionality on Cupertino page transitions.
- You want to intercept back gestures or hardware back button presses to prevent accidental data loss.
- You need to restrict swipe-to-return behavior on specific screens.
Skip it when
- You are using the standard WillPopScope or PopScope without needing Cupertino-specific page transition adjustments.
Strengths
- Enables back interception on Cupertino transitions.
- Improves visual feedback for rejected swipe-to-go-back gestures.
- Supports customizable onWillPop and onPopAction callbacks.
Weaknesses
- Requires careful state management for the 'canReturn' flag.
- The 'onWillPop' property should not be changed once set.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
CustomWillPopScope(
canReturn: _canReturn,
onWillPop: _onWillPop,
onPopAction: _onPopAction,
child: Scaffold(
appBar: AppBar(title: Text('Second Screen')),
body: Center(child: Text('Content')),),
)Alternatives
Packages that do the same job and could replace custom_will_pop_scope.
- cupertino_will_pop_scope
Enables onWillPop callbacks on Cupertino page transitions and improves swipe-to-go-back feedback.
50Compare - page_transition
Flutter package that provides customizable page transitions with an easy-to-use API.
77Compare - swipeable_page_route
A specialized page route allowing users to navigate back by swiping anywhere.
77Compare - go_transitions
Create, combine and apply custom page transitions to routes with GoRouter and Navigator.
72Compare