DropdownController<T>.single constructor

DropdownController<T>.single({
  1. bool? unselectable,
  2. List<DropdownItem<T>>? items,
})

A single selection dropdown controller.

unselectable indicates whether the selected item can be unselected, if true, either tapping the same selected item or select null item will unselect it; otherwise, it will be ignored.

Only one item can be selected at a time.

Implementation

factory DropdownController.single({
  // Default is false.
  bool? unselectable,

  /// The initial items that will be shown in the dropdown menu,
  /// but you can only set one of them as selected.
  List<DropdownItem<T>>? items,
}) = SingleSelectionDropdownController;