@@ -48,7 +48,7 @@ class CompleteFormState extends State<CompleteForm> {
48
48
children: < Widget > [
49
49
FormBuilderFilterChip (
50
50
name: 'filter_chip' ,
51
- decoration: InputDecoration (
51
+ decoration: const InputDecoration (
52
52
labelText: 'Select many options' ,
53
53
),
54
54
options: [
@@ -66,7 +66,7 @@ class CompleteFormState extends State<CompleteForm> {
66
66
),
67
67
FormBuilderChoiceChip (
68
68
name: 'choice_chip' ,
69
- decoration: InputDecoration (
69
+ decoration: const InputDecoration (
70
70
labelText: 'Select an option' ,
71
71
),
72
72
options: [
@@ -86,10 +86,10 @@ class CompleteFormState extends State<CompleteForm> {
86
86
name: 'color_picker' ,
87
87
// initialValue: Colors.yellow,
88
88
colorPickerType: ColorPickerType .MaterialPicker ,
89
- decoration: InputDecoration (labelText: 'Pick Color' ),
89
+ decoration: const InputDecoration (labelText: 'Pick Color' ),
90
90
),
91
91
FormBuilderChipsInput (
92
- decoration: InputDecoration (labelText: 'Chips' ),
92
+ decoration: const InputDecoration (labelText: 'Chips' ),
93
93
name: 'chips_test' ,
94
94
onChanged: _onChanged,
95
95
initialValue: [
@@ -144,7 +144,7 @@ class CompleteFormState extends State<CompleteForm> {
144
144
FormBuilderDateTimePicker (
145
145
name: 'date' ,
146
146
inputType: InputType .time,
147
- decoration: InputDecoration (
147
+ decoration: const InputDecoration (
148
148
labelText: 'Appointment Time' ,
149
149
),
150
150
initialTime: TimeOfDay (hour: 8 , minute: 0 ),
@@ -156,7 +156,7 @@ class CompleteFormState extends State<CompleteForm> {
156
156
lastDate: DateTime (2030 ),
157
157
format: DateFormat ('yyyy-MM-dd' ),
158
158
onChanged: _onChanged,
159
- decoration: InputDecoration (
159
+ decoration: const InputDecoration (
160
160
labelText: 'Date Range' ,
161
161
helperText: 'Helper text' ,
162
162
hintText: 'Hint text' ,
@@ -174,7 +174,7 @@ class CompleteFormState extends State<CompleteForm> {
174
174
divisions: 20 ,
175
175
activeColor: Colors .red,
176
176
inactiveColor: Colors .pink[100 ],
177
- decoration: InputDecoration (
177
+ decoration: const InputDecoration (
178
178
labelText: 'Number of things' ,
179
179
),
180
180
),
@@ -189,7 +189,7 @@ class CompleteFormState extends State<CompleteForm> {
189
189
divisions: 20 ,
190
190
activeColor: Colors .red,
191
191
inactiveColor: Colors .pink[100 ],
192
- decoration: InputDecoration (
192
+ decoration: const InputDecoration (
193
193
labelText: 'Price Range' ,
194
194
),
195
195
),
@@ -280,7 +280,7 @@ class CompleteFormState extends State<CompleteForm> {
280
280
},
281
281
),
282
282
FormBuilderTypeAhead (
283
- decoration: InputDecoration (
283
+ decoration: const InputDecoration (
284
284
labelText: 'Country' ,
285
285
),
286
286
name: 'country' ,
@@ -309,7 +309,7 @@ class CompleteFormState extends State<CompleteForm> {
309
309
},
310
310
),
311
311
FormBuilderRadioGroup (
312
- decoration: InputDecoration (
312
+ decoration: const InputDecoration (
313
313
labelText: 'My chosen language' ,
314
314
),
315
315
name: 'best_language' ,
@@ -325,8 +325,8 @@ class CompleteFormState extends State<CompleteForm> {
325
325
controlAffinity: ControlAffinity .trailing,
326
326
),
327
327
FormBuilderSegmentedControl (
328
- decoration:
329
- InputDecoration ( labelText: 'Movie Rating (Archer)' ),
328
+ decoration: const InputDecoration (
329
+ labelText: 'Movie Rating (Archer)' ),
330
330
name: 'movie_rating' ,
331
331
// initialValue: 1,
332
332
// textStyle: TextStyle(fontWeight: FontWeight.bold),
@@ -342,13 +342,13 @@ class CompleteFormState extends State<CompleteForm> {
342
342
onChanged: _onChanged,
343
343
),
344
344
FormBuilderSwitch (
345
- title: Text ('I Accept the tems and conditions' ),
345
+ title: const Text ('I Accept the tems and conditions' ),
346
346
name: 'accept_terms_switch' ,
347
347
initialValue: true ,
348
348
onChanged: _onChanged,
349
349
),
350
350
FormBuilderTouchSpin (
351
- decoration: InputDecoration (labelText: 'TouchSpin' ),
351
+ decoration: const InputDecoration (labelText: 'TouchSpin' ),
352
352
name: 'touch_spin' ,
353
353
initialValue: 10 ,
354
354
step: 1 ,
@@ -357,16 +357,17 @@ class CompleteFormState extends State<CompleteForm> {
357
357
subtractIcon: Icon (Icons .arrow_left),
358
358
),
359
359
FormBuilderRating (
360
- decoration: InputDecoration (labelText: 'Rate this form' ),
360
+ decoration:
361
+ const InputDecoration (labelText: 'Rate this form' ),
361
362
name: 'rate' ,
362
363
iconSize: 32.0 ,
363
364
initialValue: 1.0 ,
364
365
max: 5.0 ,
365
366
onChanged: _onChanged,
366
367
),
367
368
FormBuilderCheckboxGroup (
368
- decoration:
369
- InputDecoration ( labelText: 'The language of my people' ),
369
+ decoration: const InputDecoration (
370
+ labelText: 'The language of my people' ),
370
371
name: 'languages' ,
371
372
initialValue: ['Dart' ],
372
373
options: [
@@ -384,7 +385,7 @@ class CompleteFormState extends State<CompleteForm> {
384
385
),
385
386
),
386
387
FormBuilderSignaturePad (
387
- decoration: InputDecoration (
388
+ decoration: const InputDecoration (
388
389
labelText: 'Signature' ,
389
390
border: OutlineInputBorder (),
390
391
),
@@ -394,14 +395,14 @@ class CompleteFormState extends State<CompleteForm> {
394
395
),
395
396
FormBuilderImagePicker (
396
397
name: 'photos' ,
397
- decoration: InputDecoration (labelText: 'Pick Photos' ),
398
+ decoration: const InputDecoration (labelText: 'Pick Photos' ),
398
399
maxImages: 1 ,
399
400
),
400
401
SizedBox (height: 15 ),
401
402
FormBuilderCountryPicker (
402
403
initialValue: 'Germany' ,
403
404
name: 'country' ,
404
- decoration: InputDecoration (
405
+ decoration: const InputDecoration (
405
406
border: OutlineInputBorder (), labelText: 'Country' ),
406
407
validator: FormBuilderValidators .compose ([
407
408
FormBuilderValidators .required (context,
@@ -415,7 +416,7 @@ class CompleteFormState extends State<CompleteForm> {
415
416
// defaultSelectedCountryIsoCode: 'KE',
416
417
cursorColor: Colors .black,
417
418
// style: TextStyle(color: Colors.black, fontSize: 18),
418
- decoration: InputDecoration (
419
+ decoration: const InputDecoration (
419
420
border: OutlineInputBorder (),
420
421
labelText: 'Phone Number' ,
421
422
hintText: 'Hint' ),
@@ -428,15 +429,23 @@ class CompleteFormState extends State<CompleteForm> {
428
429
errorText: 'This field required' ),
429
430
]),
430
431
),
431
- /*SizedBox(height: 15),
432
- FormBuilderSignaturePad(
433
- decoration: InputDecoration(labelText: 'Signature'),
434
- name: 'signature',
435
- // height: 250,
436
- clearButtonText: 'Start Over',
437
- onChanged: _onChanged,
438
- ),*/
439
432
SizedBox (height: 15 ),
433
+ FormBuilderSearchableDropdown <Contact >(
434
+ decoration: InputDecoration (
435
+ labelText: 'Phone Number' ,
436
+ ),
437
+ name: 'searchable' ,
438
+ items: contacts
439
+ .map ((e) => DropdownMenuItem (
440
+ value: e,
441
+ child: Text ('${e .name }' ),
442
+ ))
443
+ .toList (),
444
+ hint: 'Select one' ,
445
+ searchHint: 'Select one' ,
446
+ isExpanded: true ,
447
+ onChanged: _onChanged,
448
+ ),
440
449
],
441
450
),
442
451
),
@@ -459,9 +468,7 @@ class CompleteFormState extends State<CompleteForm> {
459
468
},
460
469
),
461
470
),
462
- SizedBox (
463
- width: 20 ,
464
- ),
471
+ SizedBox (width: 20 ),
465
472
Expanded (
466
473
child: OutlineButton (
467
474
focusNode: FocusNode (),
0 commit comments