SingleSelectionDropdownController<T> constructor
SingleSelectionDropdownController<T> ({
- bool? unselectable,
- List<
DropdownItem< ? items,T> >
Implementation
SingleSelectionDropdownController({
bool? unselectable,
List<DropdownItem<T>>? items,
}) : super(unselectable ?? false) {
if (items != null) {
for (final item in items) {
if (item.selected) {
assert(_selectedItemValue == null,
"Only one item can be selected at a time");
_selectedItemValue = item.value;
}
_itemValues.add(item.value);
}
}
}