Revert "add a new PopScope.onPopWithResultInvoke widget to replace Po… (#147597)
…pScope.onPopInvoke (#147016)"
This reverts commit 8031a3e30c.
Needs to migrate flutter_eval
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
This commit is contained in:
@@ -48,7 +48,7 @@ class CupertinoNavigationDemo extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope<Object?>(
|
||||
return PopScope(
|
||||
// Prevent swipe popping of this page. Use explicit exit buttons only.
|
||||
canPop: false,
|
||||
child: DefaultTextStyle(
|
||||
|
||||
@@ -110,7 +110,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
||||
bool _hasName = false;
|
||||
late String _eventName;
|
||||
|
||||
Future<void> _handlePopInvoked(bool didPop, Object? result) async {
|
||||
Future<void> _handlePopInvoked(bool didPop) async {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
||||
),
|
||||
body: Form(
|
||||
canPop: !_saveNeeded && !_hasLocation && !_hasName,
|
||||
onPopInvokedWithResult: _handlePopInvoked,
|
||||
onPopInvoked: _handlePopInvoked,
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
|
||||
@@ -143,7 +143,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<void> _handlePopInvoked(bool didPop, Object? result) async {
|
||||
Future<void> _handlePopInvoked(bool didPop) async {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
||||
key: _formKey,
|
||||
autovalidateMode: _autovalidateMode,
|
||||
canPop: _formKey.currentState == null || !_formWasEdited || _formKey.currentState!.validate(),
|
||||
onPopInvokedWithResult: _handlePopInvoked,
|
||||
onPopInvoked: _handlePopInvoked,
|
||||
child: Scrollbar(
|
||||
child: SingleChildScrollView(
|
||||
primary: true,
|
||||
|
||||
@@ -355,7 +355,7 @@ class ExpandingBottomSheetState extends State<ExpandingBottomSheet> with TickerP
|
||||
|
||||
// Closes the cart if the cart is open, otherwise exits the app (this should
|
||||
// only be relevant for Android).
|
||||
void _handlePopInvoked(bool didPop, Object? result) {
|
||||
void _handlePopInvoked(bool didPop) {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
@@ -370,9 +370,9 @@ class ExpandingBottomSheetState extends State<ExpandingBottomSheet> with TickerP
|
||||
duration: const Duration(milliseconds: 225),
|
||||
curve: Curves.easeInOut,
|
||||
alignment: FractionalOffset.topLeft,
|
||||
child: PopScope<Object?>(
|
||||
child: PopScope(
|
||||
canPop: !_isOpen,
|
||||
onPopInvokedWithResult: _handlePopInvoked,
|
||||
onPopInvoked: _handlePopInvoked,
|
||||
child: AnimatedBuilder(
|
||||
animation: widget.hideController,
|
||||
builder: _buildSlideAnimation,
|
||||
|
||||
@@ -326,9 +326,9 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
|
||||
backgroundColor: isDark ? _kFlutterBlue : theme.primaryColor,
|
||||
body: SafeArea(
|
||||
bottom: false,
|
||||
child: PopScope<Object?>(
|
||||
child: PopScope(
|
||||
canPop: _category == null,
|
||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||
onPopInvoked: (bool didPop) {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user