@@ -26,6 +26,13 @@ class FormBuilderDropdown extends StatefulWidget {
26
26
final bool allowClear;
27
27
final Widget clearIcon;
28
28
final FormFieldSetter onSaved;
29
+ final double itemHeight;
30
+ final Color focusColor;
31
+ final Color dropdownColor;
32
+ final bool autofocus;
33
+ final FocusNode focusNode;
34
+ final VoidCallback onTap;
35
+ final List <Widget > Function (BuildContext ) selectedItemBuilder;
29
36
30
37
FormBuilderDropdown ({
31
38
Key key,
@@ -51,6 +58,13 @@ class FormBuilderDropdown extends StatefulWidget {
51
58
this .allowClear = false ,
52
59
this .clearIcon = const Icon (Icons .close),
53
60
this .onSaved,
61
+ this .itemHeight,
62
+ this .focusColor,
63
+ this .dropdownColor,
64
+ this .autofocus = false ,
65
+ this .focusNode,
66
+ this .onTap,
67
+ this .selectedItemBuilder,
54
68
}) : super (key: key) /*: assert(allowClear == true || clearIcon != null)*/ ;
55
69
56
70
@override
@@ -107,8 +121,10 @@ class _FormBuilderDropdownState extends State<FormBuilderDropdown> {
107
121
decoration: widget.decoration.copyWith (
108
122
errorText: field.errorText,
109
123
),
124
+ isEmpty: field.value == null ,
110
125
child: DropdownButtonHideUnderline (
111
126
child: Row (
127
+ mainAxisAlignment: MainAxisAlignment .start,
112
128
children: < Widget > [
113
129
Expanded (
114
130
child: DropdownButton (
@@ -136,6 +152,13 @@ class _FormBuilderDropdownState extends State<FormBuilderDropdown> {
136
152
: (value) {
137
153
_changeValue (field, value);
138
154
},
155
+ itemHeight: widget.itemHeight,
156
+ focusColor: widget.focusColor,
157
+ dropdownColor: widget.dropdownColor,
158
+ autofocus: widget.autofocus,
159
+ focusNode: widget.focusNode,
160
+ onTap: widget.onTap,
161
+ selectedItemBuilder: widget.selectedItemBuilder,
139
162
),
140
163
),
141
164
if (widget.allowClear &&
@@ -148,7 +171,7 @@ class _FormBuilderDropdownState extends State<FormBuilderDropdown> {
148
171
_changeValue (field, null );
149
172
},
150
173
),
151
- ]
174
+ ],
152
175
],
153
176
),
154
177
),
0 commit comments