File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -177,13 +177,9 @@ class _CompleteFormState extends State<CompleteForm> {
177
177
name: 'age' ,
178
178
decoration: InputDecoration (
179
179
labelText: 'Age' ,
180
- suffixIcon: IconButton (
181
- icon: const Icon (Icons .plus_one),
182
- onPressed: () {
183
- _formKey.currentState! .fields['age' ]
184
- ? .didChange ('14' );
185
- },
186
- ),
180
+ suffixIcon: _ageHasError
181
+ ? const Icon (Icons .error, color: Colors .red)
182
+ : const Icon (Icons .check, color: Colors .green),
187
183
),
188
184
onChanged: (val) {
189
185
setState (() {
@@ -207,15 +203,12 @@ class _CompleteFormState extends State<CompleteForm> {
207
203
name: 'gender' ,
208
204
decoration: InputDecoration (
209
205
labelText: 'Gender' ,
210
- suffix: IconButton (
211
- icon: const Icon (Icons .close),
212
- onPressed: () {
213
- _formKey.currentState! .fields['gender' ]? .reset ();
214
- },
206
+ suffix: _genderHasError
207
+ ? const Icon (Icons .error)
208
+ : const Icon (Icons .check),
215
209
),
216
210
hintText: 'Select Gender' ,
217
211
),
218
- initialValue: 'Male' ,
219
212
validator: FormBuilderValidators .compose (
220
213
[FormBuilderValidators .required ()]),
221
214
items: genderOptions
You can’t perform that action at this time.
0 commit comments