File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class MyHomePage extends StatelessWidget {
27
27
margin: EdgeInsets .all (15.0 ),
28
28
child: FormBuilder (
29
29
context,
30
- autovalidate: false ,
30
+ // autovalidate: true ,
31
31
// showResetButton: true,
32
32
// resetButtonContent: Text("Clear Form"),
33
33
controls: [
Original file line number Diff line number Diff line change 12
12
<excludeFolder url =" file://$MODULE_DIR$/example/.dart_tool" />
13
13
<excludeFolder url =" file://$MODULE_DIR$/example/.pub" />
14
14
<excludeFolder url =" file://$MODULE_DIR$/example/build" />
15
+ <excludeFolder url =" file://$MODULE_DIR$/example/ios/Flutter/flutter_assets/packages" />
15
16
</content >
16
17
<orderEntry type =" jdk" jdkName =" Android API 25 Platform" jdkType =" Android SDK" />
17
18
<orderEntry type =" sourceFolder" forTests =" false" />
Original file line number Diff line number Diff line change @@ -91,14 +91,12 @@ class _FormBuilderState extends State<FormBuilder> {
91
91
}
92
92
93
93
formControlsList.add (TextFormField (
94
- //TODO: add min and max validation for non-numeric text to validate character count
95
94
decoration: InputDecoration (
96
95
labelText: formControl.label,
97
96
hintText: formControl.hint,
98
97
helperText: formControl.hint,
99
98
),
100
- initialValue:
101
- formControl.value != null ? "${formControl .value }" : null ,
99
+ initialValue: "${formControl .value }" ?? null ,
102
100
maxLines: formControl.type == FormBuilderInput .TYPE_MULTILINE_TEXT
103
101
? 5
104
102
: 1 ,
@@ -646,8 +644,8 @@ class _FormBuilderState extends State<FormBuilder> {
646
644
color: Theme .of (context).accentColor,
647
645
textColor: Colors .white,
648
646
onPressed: () {
647
+ _formKey.currentState.save ();
649
648
if (_formKey.currentState.validate ()) {
650
- _formKey.currentState.save ();
651
649
widget.onSubmit (formData);
652
650
} else {
653
651
debugPrint ("Validation failed" );
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ class FormBuilderInput {
56
56
this .validator,
57
57
this .min,
58
58
this .max,
59
+ //TODO: Include maxLines for multiline text
59
60
});
60
61
61
62
FormBuilderInput .password ({
You can’t perform that action at this time.
0 commit comments