@@ -42,7 +42,7 @@ class _CompleteFormState extends State<CompleteForm> {
42
42
'best_language' : 'Dart' ,
43
43
'age' : '13' ,
44
44
'gender' : 'Male' ,
45
- 'languages_filter' : ['Dart' ]
45
+ 'languages_filter' : ['Dart' ],
46
46
},
47
47
skipDisabled: true ,
48
48
child: Column (
@@ -78,8 +78,9 @@ class _CompleteFormState extends State<CompleteForm> {
78
78
suffixIcon: IconButton (
79
79
icon: const Icon (Icons .close),
80
80
onPressed: () {
81
- _formKey.currentState! .fields['date_range' ]
82
- ? .didChange (null );
81
+ _formKey.currentState! .fields['date_range' ]? .didChange (
82
+ null ,
83
+ );
83
84
},
84
85
),
85
86
),
@@ -123,9 +124,9 @@ class _CompleteFormState extends State<CompleteForm> {
123
124
divisions: 20 ,
124
125
maxValueWidget: (max) => TextButton (
125
126
onPressed: () {
126
- _formKey.currentState? .patchValue (
127
- { 'range_slider' : const RangeValues (4 , 100 )} ,
128
- );
127
+ _formKey.currentState? .patchValue ({
128
+ 'range_slider' : const RangeValues (4 , 100 ),
129
+ } );
129
130
},
130
131
child: Text (max),
131
132
),
@@ -200,21 +201,24 @@ class _CompleteFormState extends State<CompleteForm> {
200
201
: const Icon (Icons .check),
201
202
hintText: 'Select Gender' ,
202
203
),
203
- validator: FormBuilderValidators .compose (
204
- [FormBuilderValidators .required ()]),
204
+ validator: FormBuilderValidators .compose ([
205
+ FormBuilderValidators .required (),
206
+ ]),
205
207
items: genderOptions
206
- .map ((gender) => DropdownMenuItem (
207
- alignment: AlignmentDirectional .center,
208
- value: gender,
209
- child: Text (gender),
210
- ))
208
+ .map (
209
+ (gender) => DropdownMenuItem (
210
+ alignment: AlignmentDirectional .center,
211
+ value: gender,
212
+ child: Text (gender),
213
+ ),
214
+ )
211
215
.toList (),
212
216
onChanged: (val) {
213
217
setState (() {
214
- _genderHasError = ! (_formKey
215
- .currentState? .fields['gender' ]
216
- ? .validate () ??
217
- false );
218
+ _genderHasError =
219
+ ! (_formKey .currentState? .fields['gender' ]
220
+ ? .validate () ??
221
+ false );
218
222
});
219
223
},
220
224
valueTransformer: (val) => val? .toString (),
@@ -226,13 +230,16 @@ class _CompleteFormState extends State<CompleteForm> {
226
230
initialValue: null ,
227
231
name: 'best_language' ,
228
232
onChanged: _onChanged,
229
- validator: FormBuilderValidators .compose (
230
- [FormBuilderValidators .required ()]),
233
+ validator: FormBuilderValidators .compose ([
234
+ FormBuilderValidators .required (),
235
+ ]),
231
236
options: ['Dart' , 'Kotlin' , 'Java' , 'Swift' , 'Objective-C' ]
232
- .map ((lang) => FormBuilderFieldOption (
233
- value: lang,
234
- child: Text (lang),
235
- ))
237
+ .map (
238
+ (lang) => FormBuilderFieldOption (
239
+ value: lang,
240
+ child: Text (lang),
241
+ ),
242
+ )
236
243
.toList (growable: false ),
237
244
controlAffinity: ControlAffinity .trailing,
238
245
),
@@ -245,7 +252,8 @@ class _CompleteFormState extends State<CompleteForm> {
245
252
FormBuilderCheckboxGroup <String >(
246
253
autovalidateMode: AutovalidateMode .onUserInteraction,
247
254
decoration: const InputDecoration (
248
- labelText: 'The language of my people' ),
255
+ labelText: 'The language of my people' ,
256
+ ),
249
257
name: 'languages' ,
250
258
// initialValue: const ['Dart'],
251
259
options: const [
@@ -269,7 +277,8 @@ class _CompleteFormState extends State<CompleteForm> {
269
277
FormBuilderFilterChips <String >(
270
278
autovalidateMode: AutovalidateMode .onUserInteraction,
271
279
decoration: const InputDecoration (
272
- labelText: 'The language of my people' ),
280
+ labelText: 'The language of my people' ,
281
+ ),
273
282
name: 'languages_filter' ,
274
283
selectedColor: Colors .red,
275
284
options: const [
@@ -303,8 +312,9 @@ class _CompleteFormState extends State<CompleteForm> {
303
312
FormBuilderChoiceChips <String >(
304
313
autovalidateMode: AutovalidateMode .onUserInteraction,
305
314
decoration: const InputDecoration (
306
- labelText:
307
- 'Ok, if I had to choose one language, it would be:' ),
315
+ labelText:
316
+ 'Ok, if I had to choose one language, it would be:' ,
317
+ ),
308
318
name: 'languages_choice' ,
309
319
initialValue: 'Dart' ,
310
320
options: const [
@@ -339,15 +349,16 @@ class _CompleteFormState extends State<CompleteForm> {
339
349
children: < Widget > [
340
350
Expanded (
341
351
child: ElevatedButton (
342
- onPressed: () {
343
- if (_formKey.currentState? .saveAndValidate () ?? false ) {
344
- debugPrint (_formKey.currentState? .value.toString ());
345
- } else {
346
- debugPrint (_formKey.currentState? .value.toString ());
347
- debugPrint ('validation failed' );
348
- }
349
- },
350
- child: const Text ('Submit' )),
352
+ onPressed: () {
353
+ if (_formKey.currentState? .saveAndValidate () ?? false ) {
354
+ debugPrint (_formKey.currentState? .value.toString ());
355
+ } else {
356
+ debugPrint (_formKey.currentState? .value.toString ());
357
+ debugPrint ('validation failed' );
358
+ }
359
+ },
360
+ child: const Text ('Submit' ),
361
+ ),
351
362
),
352
363
const SizedBox (width: 20 ),
353
364
Expanded (
0 commit comments