Skip to content

Commit 6498174

Browse files
committed
Continue experimenting with searchable dropdown
1 parent 5af7f29 commit 6498174

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

lib/src/fields/form_builder_searchable_dropdown.dart

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class FormBuilderSearchableDropdown<T> extends FormBuilderField {
6161
this.disabledHint,
6262
this.icon = const Icon(Icons.arrow_drop_down),
6363
this.underline,
64-
this.doneButton,
64+
this.doneButton = 'Done',
6565
this.label,
6666
this.closeButton = 'Close',
6767
this.displayClearIcon = true,
@@ -101,12 +101,13 @@ class FormBuilderSearchableDropdown<T> extends FormBuilderField {
101101
enabled: state.readOnly,
102102
errorText: decoration?.errorText ?? field.errorText,
103103
),
104-
child: SearchableDropdown.single(
104+
child: /*SearchableDropdown.single(
105+
value: state.value,
105106
items: items,
106-
onChanged: (val){
107+
onChanged: (val) {
108+
state.requestFocus();
107109
state.didChange(val);
108110
},
109-
// value: state.value,
110111
style: style,
111112
searchHint: searchHint,
112113
hint: hint,
@@ -128,13 +129,48 @@ class FormBuilderSearchableDropdown<T> extends FormBuilderField {
128129
selectedValueWidgetFn: selectedValueWidgetFn,
129130
keyboardType: keyboardType,
130131
validator: validator,
131-
// assertUniqueValue: assertUniqueValue,
132132
displayItem: displayItem,
133133
dialogBox: dialogBox,
134134
menuConstraints: menuConstraints,
135135
readOnly: readOnly,
136136
menuBackgroundColor: menuBackgroundColor,
137-
),
137+
assertUniqueValue: assertUniqueValue,
138+
)*/
139+
SearchableDropdown.multiple(
140+
items: items,
141+
onChanged: (val) {
142+
state.requestFocus();
143+
state.didChange(val);
144+
},
145+
style: style,
146+
searchHint: searchHint,
147+
hint: hint,
148+
disabledHint: disabledHint,
149+
icon: icon,
150+
underline: underline,
151+
doneButton: doneButton,
152+
label: label,
153+
closeButton: closeButton,
154+
displayClearIcon: displayClearIcon,
155+
clearIcon: clearIcon,
156+
iconEnabledColor: iconEnabledColor,
157+
iconDisabledColor: iconDisabledColor,
158+
iconSize: iconSize,
159+
isExpanded: isExpanded,
160+
isCaseSensitiveSearch: isCaseSensitiveSearch,
161+
searchFn: searchFn,
162+
onClear: onClear,
163+
selectedValueWidgetFn: selectedValueWidgetFn,
164+
keyboardType: keyboardType,
165+
validator: validator,
166+
displayItem: displayItem,
167+
dialogBox: dialogBox,
168+
menuConstraints: menuConstraints,
169+
readOnly: readOnly,
170+
menuBackgroundColor: menuBackgroundColor,
171+
selectedItems: ,
172+
)
173+
,
138174
);
139175
},
140176
);

0 commit comments

Comments
 (0)