@@ -9,7 +9,10 @@ class FormBuilder extends StatefulWidget {
9
9
/// will rebuild.
10
10
final VoidCallback ? onChanged;
11
11
12
- /// {@macro flutter.widgets.navigator.onPopInvoked}
12
+ /// DEPRECATED: Use [onPopInvokedWithResult] instead.
13
+ final void Function (bool )? onPopInvoked;
14
+
15
+ /// {@macro flutter.widgets.navigator.onPopInvokedWithResult}
13
16
///
14
17
/// {@tool dartpad}
15
18
/// This sample demonstrates how to use this parameter to show a confirmation
@@ -22,9 +25,8 @@ class FormBuilder extends StatefulWidget {
22
25
///
23
26
/// * [canPop] , which also comes from [PopScope] and is often used in
24
27
/// conjunction with this parameter.
25
- /// * [PopScope.onPopInvoked] , which is what [Form] delegates to internally.ther widget that provides a way to intercept the
26
- /// back button.
27
- final void Function (bool )? onPopInvoked;
28
+ /// * [PopScope.onPopInvokedWithResult] , which is what [Form] delegates to internally.
29
+ final PopInvokedWithResultCallback <Object ?>? onPopInvokedWithResult;
28
30
29
31
/// {@macro flutter.widgets.PopScope.canPop}
30
32
///
@@ -102,7 +104,12 @@ class FormBuilder extends StatefulWidget {
102
104
required this .child,
103
105
this .onChanged,
104
106
this .autovalidateMode,
107
+ @Deprecated (
108
+ 'Use onPopInvokedWithResult instead. '
109
+ 'This feature was deprecated after v3.22.0-12.0.pre.' ,
110
+ )
105
111
this .onPopInvoked,
112
+ this .onPopInvokedWithResult,
106
113
this .initialValue = const < String , dynamic > {},
107
114
this .skipDisabled = false ,
108
115
this .enabled = true ,
@@ -345,6 +352,8 @@ class FormBuilderState extends State<FormBuilder> {
345
352
return Form (
346
353
key: _formKey,
347
354
autovalidateMode: widget.autovalidateMode,
355
+ onPopInvokedWithResult: widget.onPopInvokedWithResult,
356
+ // ignore: deprecated_member_use
348
357
onPopInvoked: widget.onPopInvoked,
349
358
canPop: widget.canPop,
350
359
// `onChanged` is called during setInternalFieldValue else will be called early
0 commit comments