@@ -20,8 +20,9 @@ class HomePage extends StatelessWidget {
20
20
decoration: const InputDecoration (labelText: 'Age' ),
21
21
keyboardType: TextInputType .number,
22
22
autovalidateMode: AutovalidateMode .always,
23
- validator:
24
- FormBuilderValidators .compose (< FormFieldValidator <String >> [
23
+ validator: FormBuilderValidators .compose (<
24
+ FormFieldValidator <String >
25
+ > [
25
26
/// Makes this field required
26
27
FormBuilderValidators .required (),
27
28
@@ -42,7 +43,7 @@ class HomePage extends StatelessWidget {
42
43
if (number < 0 ) return 'We cannot have a negative age' ;
43
44
}
44
45
return null ;
45
- }
46
+ },
46
47
]),
47
48
),
48
49
// Required Validator
@@ -160,8 +161,9 @@ class HomePage extends StatelessWidget {
160
161
labelText: 'Match Pattern' ,
161
162
prefixIcon: Icon (Icons .pattern),
162
163
),
163
- validator:
164
- FormBuilderValidators .match (RegExp (r'^[a-zA-Z0-9]+$' )),
164
+ validator: FormBuilderValidators .match (
165
+ RegExp (r'^[a-zA-Z0-9]+$' ),
166
+ ),
165
167
textInputAction: TextInputAction .next,
166
168
autovalidateMode: AutovalidateMode .always,
167
169
),
@@ -231,11 +233,11 @@ class HomePage extends StatelessWidget {
231
233
keyboardType: TextInputType .number,
232
234
validator:
233
235
FormBuilderValidators .compose (< FormFieldValidator <String >> [
234
- FormBuilderValidators .required (),
235
- FormBuilderValidators .numeric (),
236
- FormBuilderValidators .min (0 ),
237
- FormBuilderValidators .max (120 ),
238
- ]),
236
+ FormBuilderValidators .required (),
237
+ FormBuilderValidators .numeric (),
238
+ FormBuilderValidators .min (0 ),
239
+ FormBuilderValidators .max (120 ),
240
+ ]),
239
241
textInputAction: TextInputAction .done,
240
242
autovalidateMode: AutovalidateMode .always,
241
243
),
0 commit comments