Skip to content

Commit 3e399c1

Browse files
authored
Revert "add a new PopScope.onPopWithResultInvoke widget to replace Po… (flutter#147597)
…pScope.onPopInvoke (flutter#147016)" This reverts commit 8031a3e. 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
1 parent ce822ec commit 3e399c1

File tree

18 files changed

+75
-546
lines changed

18 files changed

+75
-546
lines changed

dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class CupertinoNavigationDemo extends StatelessWidget {
4848

4949
@override
5050
Widget build(BuildContext context) {
51-
return PopScope<Object?>(
51+
return PopScope(
5252
// Prevent swipe popping of this page. Use explicit exit buttons only.
5353
canPop: false,
5454
child: DefaultTextStyle(

dev/integration_tests/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
110110
bool _hasName = false;
111111
late String _eventName;
112112

113-
Future<void> _handlePopInvoked(bool didPop, Object? result) async {
113+
Future<void> _handlePopInvoked(bool didPop) async {
114114
if (didPop) {
115115
return;
116116
}
@@ -175,7 +175,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
175175
),
176176
body: Form(
177177
canPop: !_saveNeeded && !_hasLocation && !_hasName,
178-
onPopInvokedWithResult: _handlePopInvoked,
178+
onPopInvoked: _handlePopInvoked,
179179
child: Scrollbar(
180180
child: ListView(
181181
primary: true,

dev/integration_tests/flutter_gallery/lib/demo/material/text_form_field_demo.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
143143
return null;
144144
}
145145

146-
Future<void> _handlePopInvoked(bool didPop, Object? result) async {
146+
Future<void> _handlePopInvoked(bool didPop) async {
147147
if (didPop) {
148148
return;
149149
}
@@ -192,7 +192,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
192192
key: _formKey,
193193
autovalidateMode: _autovalidateMode,
194194
canPop: _formKey.currentState == null || !_formWasEdited || _formKey.currentState!.validate(),
195-
onPopInvokedWithResult: _handlePopInvoked,
195+
onPopInvoked: _handlePopInvoked,
196196
child: Scrollbar(
197197
child: SingleChildScrollView(
198198
primary: true,

dev/integration_tests/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ class ExpandingBottomSheetState extends State<ExpandingBottomSheet> with TickerP
355355

356356
// Closes the cart if the cart is open, otherwise exits the app (this should
357357
// only be relevant for Android).
358-
void _handlePopInvoked(bool didPop, Object? result) {
358+
void _handlePopInvoked(bool didPop) {
359359
if (didPop) {
360360
return;
361361
}
@@ -370,9 +370,9 @@ class ExpandingBottomSheetState extends State<ExpandingBottomSheet> with TickerP
370370
duration: const Duration(milliseconds: 225),
371371
curve: Curves.easeInOut,
372372
alignment: FractionalOffset.topLeft,
373-
child: PopScope<Object?>(
373+
child: PopScope(
374374
canPop: !_isOpen,
375-
onPopInvokedWithResult: _handlePopInvoked,
375+
onPopInvoked: _handlePopInvoked,
376376
child: AnimatedBuilder(
377377
animation: widget.hideController,
378378
builder: _buildSlideAnimation,

dev/integration_tests/flutter_gallery/lib/gallery/home.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
326326
backgroundColor: isDark ? _kFlutterBlue : theme.primaryColor,
327327
body: SafeArea(
328328
bottom: false,
329-
child: PopScope<Object?>(
329+
child: PopScope(
330330
canPop: _category == null,
331-
onPopInvokedWithResult: (bool didPop, Object? result) {
331+
onPopInvoked: (bool didPop) {
332332
if (didPop) {
333333
return;
334334
}

examples/api/lib/widgets/form/form.1.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class _SaveableFormState extends State<_SaveableForm> {
111111
const SizedBox(height: 20.0),
112112
Form(
113113
canPop: !_isDirty,
114-
onPopInvokedWithResult: (bool didPop, Object? result) async {
114+
onPopInvoked: (bool didPop) async {
115115
if (didPop) {
116116
return;
117117
}

examples/api/lib/widgets/pop_scope/pop_scope.0.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ class _PageTwoState extends State<_PageTwo> {
109109
mainAxisAlignment: MainAxisAlignment.center,
110110
children: <Widget>[
111111
const Text('Page Two'),
112-
PopScope<Object?>(
112+
PopScope(
113113
canPop: false,
114-
onPopInvokedWithResult: (bool didPop, Object? result) async {
114+
onPopInvoked: (bool didPop) async {
115115
if (didPop) {
116116
return;
117117
}

examples/api/lib/widgets/pop_scope/pop_scope.1.dart

Lines changed: 0 additions & 233 deletions
This file was deleted.

0 commit comments

Comments
 (0)