Streamlined Flutter widget for versatile multi-selection with extensive customization.
DartGPL-3.0
MultiSelect Dropdown
The MultiSelect Dropdown for Flutter is a powerful and customizable widget that empowers you to effortlessly manage and search through multiple items in a dropdown list. Customize the dropdown with your own style, and use the controller to programmatically control the dropdown.
Breaking Changes in v3.0.0
The MultiSelectDropDown widget has been renamed to MultiDropdown, which now supports FormValidation.
The MultiSelectController methods have been updated/renamed.
The ValueItem class has replaced the DropdownItem class.
The .network constructor has been removed and has been replaced with the future constructor, which accepts a future callback to fetch the data from the server. Use it to handle future your own way.
onOptionsSelected has been replaced with onSelectionChange. The onSelectionChange callback is called whenever the selection changes in the dropdown, whether it is selected or deselected.
A lot of parameters have been renamed and updated. Please check the documentation for the updated parameters.
You can use the controller to programmatically select/unselect items, clear the selection, and get the selected items, set disabled items, show/hide the dropdown. It is still in beta, will be stable in the next release.
finalMultiSelectController<User> _controller =MultiSelectController<User>();
_controller.clearAll(); /// Clear all selected items
_controller.selectWhere(boolFunction(DropdownItem<User>) predicate); /// Select items based on a predicate
_controller.setItems(List<DropdownItem<User>> options); /// Set items of the dropdown
_controller.addItem(DropdownItem<User> option); /// Add item to dropdown
_controller.addItems(List<DropdownItem<User>> options); /// Add items to dropdown
_controller.disableWhere(boolFunction(DropdownItem<User>) predicate); /// Disable items based on a predicate
_controller.selectAll(); /// Select all items
_controller.selectAtIndex(int index); /// Select item at index
_controller.selectWhere(boolFunction(DropdownItem<User>) predicate); /// Select items based on a predicate
_controller.deselectWhere(boolFunction(DropdownItem<User>) predicate); /// Deselect items based on a predicate
_controller.items; /// Get all items
_controller.selectedItems; /// Get selected items
_controller.disabledItems; /// Get disabled items
_controller.openDropdown(); /// Show the dropdown
_controller.closeDropdown(); /// Hide the dropdown if it is open