@@ -92,10 +92,6 @@ class CompleteFormState extends State<CompleteForm> {
92
92
decoration: const InputDecoration (labelText: 'Chips' ),
93
93
name: 'chips_test' ,
94
94
onChanged: _onChanged,
95
- initialValue: [
96
- Contact (
'Andrew' ,
'[email protected] ' ,
97
- 'https://d2gg9evh47fn9z.cloudfront.net/800px_COLOURBOX4057996.jpg' ),
98
- ],
99
95
maxChips: 5 ,
100
96
findSuggestions: (String query) {
101
97
if (query.isNotEmpty) {
@@ -189,9 +185,7 @@ class CompleteFormState extends State<CompleteForm> {
189
185
divisions: 20 ,
190
186
activeColor: Colors .red,
191
187
inactiveColor: Colors .pink[100 ],
192
- decoration: const InputDecoration (
193
- labelText: 'Price Range' ,
194
- ),
188
+ decoration: const InputDecoration (labelText: 'Price Range' ),
195
189
),
196
190
FormBuilderCheckbox (
197
191
name: 'accept_terms' ,
@@ -326,7 +320,8 @@ class CompleteFormState extends State<CompleteForm> {
326
320
),
327
321
FormBuilderSegmentedControl (
328
322
decoration: const InputDecoration (
329
- labelText: 'Movie Rating (Archer)' ),
323
+ labelText: 'Movie Rating (Archer)' ,
324
+ ),
330
325
name: 'movie_rating' ,
331
326
// initialValue: 1,
332
327
// textStyle: TextStyle(fontWeight: FontWeight.bold),
@@ -403,7 +398,9 @@ class CompleteFormState extends State<CompleteForm> {
403
398
initialValue: 'Germany' ,
404
399
name: 'country' ,
405
400
decoration: const InputDecoration (
406
- border: OutlineInputBorder (), labelText: 'Country' ),
401
+ border: OutlineInputBorder (),
402
+ labelText: 'Country' ,
403
+ ),
407
404
validator: FormBuilderValidators .compose ([
408
405
FormBuilderValidators .required (context,
409
406
errorText: 'This field required.' ),
@@ -433,6 +430,7 @@ class CompleteFormState extends State<CompleteForm> {
433
430
FormBuilderSearchableDropdown <Contact >(
434
431
decoration: InputDecoration (
435
432
labelText: 'Phone Number' ,
433
+ border: OutlineInputBorder (),
436
434
),
437
435
name: 'searchable' ,
438
436
items: contacts
@@ -459,12 +457,26 @@ class CompleteFormState extends State<CompleteForm> {
459
457
style: TextStyle (color: Colors .white),
460
458
),
461
459
onPressed: () {
462
- if (_fbKey.currentState.saveAndValidate ()) {
460
+ _fbKey.currentState.fields['color_picker' ]
461
+ .patchValue (Colors .black);
462
+ _fbKey.currentState.patchValue ({
463
+ 'age' : '50' ,
464
+ 'slider' : 6.7 ,
465
+ 'filter_chip' : ['Test 1' ],
466
+ 'choice_chip' : 'Test 2' ,
467
+ 'rate' : 4 ,
468
+ 'chips_test' : [
469
+ Contact (
'Andrew' ,
'[email protected] ' ,
470
+ 'https://d2gg9evh47fn9z.cloudfront.net/800px_COLOURBOX4057996.jpg' ),
471
+ ],
472
+ });
473
+
474
+ /*if (_fbKey.currentState.saveAndValidate()) {
463
475
print(_fbKey.currentState.value);
464
476
} else {
465
477
print(_fbKey.currentState.value);
466
478
print('validation failed');
467
- }
479
+ }*/
468
480
},
469
481
),
470
482
),
@@ -473,10 +485,7 @@ class CompleteFormState extends State<CompleteForm> {
473
485
child: OutlineButton (
474
486
focusNode: FocusNode (),
475
487
color: Theme .of (context).accentColor,
476
- child: Text (
477
- 'Reset' ,
478
- style: TextStyle (color: Colors .white),
479
- ),
488
+ child: Text ('Reset' , style: TextStyle (color: Colors .white)),
480
489
onPressed: () {
481
490
_fbKey.currentState.reset ();
482
491
},
0 commit comments