Skip to content

Commit c8fb870

Browse files
feat: update flutter version
- fix new lints warnings - fix tests - update dependencies versions
1 parent 5ba56f6 commit c8fb870

File tree

7 files changed

+74
-50
lines changed

7 files changed

+74
-50
lines changed

example/pubspec.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ packages:
3737
dependency: transitive
3838
description:
3939
name: collection
40-
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
40+
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
4141
url: "https://pub.dev"
4242
source: hosted
43-
version: "1.17.2"
43+
version: "1.18.0"
4444
fake_async:
4545
dependency: transitive
4646
description:
@@ -65,10 +65,10 @@ packages:
6565
dependency: "direct dev"
6666
description:
6767
name: flutter_lints
68-
sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
68+
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
6969
url: "https://pub.dev"
7070
source: hosted
71-
version: "2.0.1"
71+
version: "2.0.3"
7272
flutter_localizations:
7373
dependency: "direct main"
7474
description: flutter
@@ -83,10 +83,10 @@ packages:
8383
dependency: "direct main"
8484
description:
8585
name: form_builder_validators
86-
sha256: e2c01286696a5d73342dc9e07e9de7c25f7af254ac96e9b665943ba8b6b383c5
86+
sha256: "19aa5282b7cede82d0025ab031a98d0554b84aa2ba40f12013471a3b3e22bf02"
8787
url: "https://pub.dev"
8888
source: hosted
89-
version: "9.0.0-dev.2"
89+
version: "9.1.0"
9090
intl:
9191
dependency: "direct main"
9292
description:
@@ -99,10 +99,10 @@ packages:
9999
dependency: transitive
100100
description:
101101
name: lints
102-
sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015"
102+
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
103103
url: "https://pub.dev"
104104
source: hosted
105-
version: "2.1.0"
105+
version: "2.1.1"
106106
matcher:
107107
dependency: transitive
108108
description:
@@ -123,10 +123,10 @@ packages:
123123
dependency: transitive
124124
description:
125125
name: meta
126-
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
126+
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
127127
url: "https://pub.dev"
128128
source: hosted
129-
version: "1.9.1"
129+
version: "1.10.0"
130130
path:
131131
dependency: transitive
132132
description:
@@ -152,18 +152,18 @@ packages:
152152
dependency: transitive
153153
description:
154154
name: stack_trace
155-
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
155+
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
156156
url: "https://pub.dev"
157157
source: hosted
158-
version: "1.11.0"
158+
version: "1.11.1"
159159
stream_channel:
160160
dependency: transitive
161161
description:
162162
name: stream_channel
163-
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
163+
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
164164
url: "https://pub.dev"
165165
source: hosted
166-
version: "2.1.1"
166+
version: "2.1.2"
167167
string_scanner:
168168
dependency: transitive
169169
description:
@@ -184,10 +184,10 @@ packages:
184184
dependency: transitive
185185
description:
186186
name: test_api
187-
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
187+
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
188188
url: "https://pub.dev"
189189
source: hosted
190-
version: "0.6.0"
190+
version: "0.6.1"
191191
vector_math:
192192
dependency: transitive
193193
description:
@@ -200,10 +200,10 @@ packages:
200200
dependency: transitive
201201
description:
202202
name: web
203-
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
203+
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
204204
url: "https://pub.dev"
205205
source: hosted
206-
version: "0.1.4-beta"
206+
version: "0.3.0"
207207
sdks:
208-
dart: ">=3.1.0-185.0.dev <4.0.0"
208+
dart: ">=3.2.0-194.0.dev <4.0.0"
209209
flutter: ">=3.10.0"

lib/src/fields/form_builder_dropdown.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ class FormBuilderDropdown<T> extends FormBuilderFieldDecoration<T> {
3838
/// from the list corresponds to the [DropdownMenuItem] of the same index
3939
/// in [items].
4040
///
41-
/// {@tool dartpad --template=stateful_widget_scaffold}
42-
///
41+
/// {@tool dartpad}
4342
/// This sample shows a `DropdownButton` with a button with [Text] that
4443
/// corresponds to but is unique from [DropdownMenuItem].
4544
///
45+
/// ** See code in examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart **
46+
/// {@end-tool}
47+
///
4648
/// If this callback is null, the [DropdownMenuItem] from [items]
4749
/// that matches [value] will be displayed.
4850
final DropdownButtonBuilder? selectedItemBuilder;

lib/src/form_builder.dart

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,38 @@ class FormBuilder extends StatefulWidget {
99
/// will rebuild.
1010
final VoidCallback? onChanged;
1111

12-
/// Enables the form to veto attempts by the user to dismiss the [ModalRoute]
13-
/// that contains the form.
12+
/// {@macro flutter.widgets.navigator.onPopInvoked}
1413
///
15-
/// If the callback returns a Future that resolves to false, the form's route
16-
/// will not be popped.
14+
/// {@tool dartpad}
15+
/// This sample demonstrates how to use this parameter to show a confirmation
16+
/// dialog when a navigation pop would cause form data to be lost.
17+
///
18+
/// ** See code in examples/api/lib/widgets/form/form.1.dart **
19+
/// {@end-tool}
1720
///
1821
/// See also:
1922
///
20-
/// * [WillPopScope], another widget that provides a way to intercept the
23+
/// * [canPop], which also comes from [PopScope] and is often used in
24+
/// conjunction with this parameter.
25+
/// * [PopScope.onPopInvoked], which is what [Form] delegates to internally.ther widget that provides a way to intercept the
2126
/// back button.
22-
final WillPopCallback? onWillPop;
27+
final void Function(bool)? onPopInvoked;
28+
29+
/// {@macro flutter.widgets.PopScope.canPop}
30+
///
31+
/// {@tool dartpad}
32+
/// This sample demonstrates how to use this parameter to show a confirmation
33+
/// dialog when a navigation pop would cause form data to be lost.
34+
///
35+
/// ** See code in examples/api/lib/widgets/form/form.1.dart **
36+
/// {@end-tool}
37+
///
38+
/// See also:
39+
///
40+
/// * [onPopInvoked], which also comes from [PopScope] and is often used in
41+
/// conjunction with this parameter.
42+
/// * [PopScope.canPop], which is what [Form] delegates to internally.
43+
final bool? canPop;
2344

2445
/// The widget below this widget in the tree.
2546
///
@@ -81,11 +102,12 @@ class FormBuilder extends StatefulWidget {
81102
required this.child,
82103
this.onChanged,
83104
this.autovalidateMode,
84-
this.onWillPop,
105+
this.onPopInvoked,
85106
this.initialValue = const <String, dynamic>{},
86107
this.skipDisabled = false,
87108
this.enabled = true,
88109
this.clearValueOnUnregister = false,
110+
this.canPop,
89111
});
90112

91113
static FormBuilderState? of(BuildContext context) =>
@@ -315,7 +337,8 @@ class FormBuilderState extends State<FormBuilder> {
315337
return Form(
316338
key: _formKey,
317339
autovalidateMode: widget.autovalidateMode,
318-
onWillPop: widget.onWillPop,
340+
onPopInvoked: widget.onPopInvoked,
341+
canPop: widget.canPop,
319342
// `onChanged` is called during setInternalFieldValue else will be called early
320343
child: _FormBuilderScope(
321344
formState: this,

pubspec.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ packages:
3737
dependency: transitive
3838
description:
3939
name: collection
40-
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
40+
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
4141
url: "https://pub.dev"
4242
source: hosted
43-
version: "1.17.2"
43+
version: "1.18.0"
4444
fake_async:
4545
dependency: transitive
4646
description:
@@ -58,10 +58,10 @@ packages:
5858
dependency: "direct dev"
5959
description:
6060
name: flutter_lints
61-
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
61+
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
6262
url: "https://pub.dev"
6363
source: hosted
64-
version: "2.0.3"
64+
version: "3.0.1"
6565
flutter_test:
6666
dependency: "direct dev"
6767
description: flutter
@@ -79,10 +79,10 @@ packages:
7979
dependency: transitive
8080
description:
8181
name: lints
82-
sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015"
82+
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
8383
url: "https://pub.dev"
8484
source: hosted
85-
version: "2.1.0"
85+
version: "3.0.0"
8686
matcher:
8787
dependency: transitive
8888
description:
@@ -103,10 +103,10 @@ packages:
103103
dependency: transitive
104104
description:
105105
name: meta
106-
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
106+
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
107107
url: "https://pub.dev"
108108
source: hosted
109-
version: "1.9.1"
109+
version: "1.10.0"
110110
path:
111111
dependency: transitive
112112
description:
@@ -132,18 +132,18 @@ packages:
132132
dependency: transitive
133133
description:
134134
name: stack_trace
135-
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
135+
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
136136
url: "https://pub.dev"
137137
source: hosted
138-
version: "1.11.0"
138+
version: "1.11.1"
139139
stream_channel:
140140
dependency: transitive
141141
description:
142142
name: stream_channel
143-
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
143+
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
144144
url: "https://pub.dev"
145145
source: hosted
146-
version: "2.1.1"
146+
version: "2.1.2"
147147
string_scanner:
148148
dependency: transitive
149149
description:
@@ -164,10 +164,10 @@ packages:
164164
dependency: transitive
165165
description:
166166
name: test_api
167-
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
167+
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
168168
url: "https://pub.dev"
169169
source: hosted
170-
version: "0.6.0"
170+
version: "0.6.1"
171171
vector_math:
172172
dependency: transitive
173173
description:
@@ -180,10 +180,10 @@ packages:
180180
dependency: transitive
181181
description:
182182
name: web
183-
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
183+
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
184184
url: "https://pub.dev"
185185
source: hosted
186-
version: "0.1.4-beta"
186+
version: "0.3.0"
187187
sdks:
188-
dart: ">=3.1.0-185.0.dev <4.0.0"
188+
dart: ">=3.2.0-194.0.dev <4.0.0"
189189
flutter: ">=3.10.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ dependencies:
1717
intl: ^0.18.0
1818

1919
dev_dependencies:
20-
flutter_lints: ^2.0.1
20+
flutter_lints: ^3.0.1
2121
flutter_test:
2222
sdk: flutter

test/form_builder_date_range_picker_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void main() {
3333
await tester.pump();
3434

3535
// Close date range picker dialog
36-
await tester.tap(find.text('SAVE'));
36+
await tester.tap(find.text('Save'));
3737
await tester.pump();
3838

3939
expect(formSave(), isTrue);

test/src/form_builder_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,9 @@ void main() {
465465
// disposing it from the tree
466466
class _DynamicFormFields extends StatefulWidget {
467467
const _DynamicFormFields({
468-
Key? key,
469468
required this.name,
470469
this.valueTransformer,
471-
}) : super(key: key);
470+
});
472471

473472
final String name;
474473
final ValueTransformer? valueTransformer;

0 commit comments

Comments
 (0)