search_select 1.0.11
search_select: ^1.0.11 copied to clipboard
A Flutter dropdown for search select and multi-select functionality widget.
Search Select / Mult-select #
Description #
This package provides a multi-select widget that allows users to search and select multiple items from a list. It is highly customizable and supports various styles and configurations to fit different use cases. The widget is designed to be user-friendly and efficient, making it easy to integrate into your Flutter applications.
Screenshots #
Example #
SearchSelect<String>(
itemsStyleType: ItemsStyleType.chip,
items: ["item 01", "item 02", "item 03"],
label: 'Multiple selection',
allowMultiple: true,
showDeleteButton: true,
selectedItems: [],
onChange: (values) {
// change your variable list here
},
),
Attention #
Use your class's toString method to apply the local search function
class UserModel {
String name;
UserModel(this.name);
@override
String toString() {
return name;
}
}
All Params #
-
items(REQUIRED)
A list of items to be displayed in the selection. -
selectedItems
A list of items that are currently selected. -
label
The label to be displayed for the selection widget. -
hintSearch
The placeholder text to be displayed in the search field. -
searchAsync
A function to be called when the search field is used. Use this function to search for items asynchronously. return your new list of items -
searchLoadingWidget
A widget to be displayed while searching -
applyLocalSearch
if searchAsync is null | applyLocalSearch is true
if searchAsync is not null | applyLocalSearch is false
use this parameter to change this behavior -
searchAsyncDebounceDuration
The duration to debounce the search input -
labelStyle
The style to be applied to the label text. -
decoration
The decoration to be applied to the container of the selection widget. -
containerMinHeight
The minimum height of the container. -
itemsStyleType
The style type for the items in the selection. -
autoFocus
Whether the search field should automatically gain focus. -
useMaxWidthSpace
Whether the selection widget should use the maximum width available. -
showDeleteButton
Whether to show a delete button for each selected item. -
allowMultiple
Whether multiple items can be selected. -
everShowLabel
Whether the label should always be shown. -
maxSelections
The maximum number of selections allowed. -
onChange
A callback function to be called when the selection changes. -
itemBuilder
A builder function to create the widget for each item in the selection. -
selectedItemBuilder
A builder function to create the widget for each selected item. -
onClickWhenFullItemsSelected
A callback function to be called whenmaxSelectionsis reached. -
maxBuildItemsIList
use this to limit the number of items to be displayed in the list if the list is too long, it will be cut off. Use null to display all items -
maxHeight
The maximum height size of the selection menu. default is 40% of your screen -
menuController
param to controller the menu, use this to open and close the menu programmatically -
labelBackgroundColor
The background color of the label. -
validator
A function to validate the selected items. It should return a string if validation fails, or null if validation passes. -
selectedItem
The item that should be selected by default when the widget is first built. This is useful for single selection mode. -
onSingleChange
A callback function to be called when the selected item changes in single selection mode. This is useful for updating the state of the widget when a new item is selected. -
emptyLabel
The label to be displayed when there are no selected items. This is useful for providing feedback to the user when no items are selected. -
showEmptyLabel
A boolean value that determines whether the empty label should be shown or not. This is useful for providing feedback to the user when no items are selected.
Feito com ❤️ by Weliton Sousa