dropdown_custom 0.5.0
dropdown_custom: ^0.5.0 copied to clipboard
A customizable, zero-dependency Flutter dropdown with single/multi-select, search, grouping, positioning, and many more customizations.
0.5.0 #
- Add a clearable single-select: set
clearable: trueto show a ✕ button on the trigger while a value is selected. Tapping it calls the newonClearedcallback, where you reset your value (typically tonull). Available on the default andCustomDropdown.asyncconstructors; backward-compatible (opt-in). - Add
Formintegration: pass avalidator(and optionalautovalidateMode) to make the dropdown aFormField. On a failed validation it shows the error message below the trigger and turns the field outline the theme's error color. Works withForm.validate()/save(). Available on all three constructors (validatorvalidatesT?for single/async andList<T>for.multi). - Keyboard navigation and accessibility: the open menu responds to ↑/↓ (moving
the highlight, skipping headers and disabled items), Enter (select), and Esc
(close) — including while the search box has focus — and auto-scrolls the
highlight into view. Added
Semanticsto the trigger (button, expanded state, current label) and to each item (selected/checked, enabled, label). - Multi-select chips: set
showChips: trueonCustomDropdown.multito show the selection as removable chips on the trigger (each with a ✕ that removes just that item) instead of comma-joined text.chipOverflowchooses wrap (default) or horizontal scroll;chipStyle(DropdownChipStyle) themes the chips, defaulting to colors derived frommenuStyle/theme.selectedItemsLabelstill applies whenshowChipsis false. DropdownController: pass acontrollerto open/close/toggle the menu programmatically and readisOpen. It is aChangeNotifier, so you can listen for open/close changes. Available on all three constructors.- Multi-select
maxSelection: cap how many items can be selected. At the limit, unselected items are disabled (selected ones can still be unchecked), and "select all" stops at the cap.
0.4.0 #
-
Granular, independent styling split into three groups, replacing the old
DropdownDecoration:fieldStyle(DropdownFieldStyle) — input field: background, border color and width, radius, value/hint text styles, arrow icon color, padding.menuStyle(DropdownMenuStyle) — menu box and rows: background, border, radius, elevation, item/selected/group-header text styles, highlight and selected colors, disabled color, sizing.searchStyle(DropdownSearchStyle) — search bar: fill, border and focused-border colors, radius, text and hint styles, icon color, padding.
-
The input field and the menu can now be themed separately (previously they shared one decoration), and the search bar is fully themable.
Migration: replace
decoration: DropdownDecoration(...)with the relevantfieldStyle/menuStyle/searchStyle. (textStyleon menu items is nowmenuStyle.itemTextStyle.)
0.3.0 #
- Add async loading via the
CustomDropdown.asyncconstructor: aloader(query)fetches items for the debounced search query, with a loading spinner, an error state plus retry, and the empty state. Results are used as-is (the loader owns filtering). Debounce and error/retry labels are configurable. - Customizable loading indicator via the
loadingparameter and the newDropdownLoadingtype:DropdownLoading.circular(with a custom color),DropdownLoading.shimmer(animated skeleton with custom base/highlight colors, zero dependencies), orDropdownLoading.custom(your own widget). - Customizable empty and error states:
emptyBuilder(all constructors) anderrorBuilder(async) let you render your own widgets.errorBuilderreceives the thrown error and a retry callback.
0.2.0 #
- Add multi-select via the
CustomDropdown.multiconstructor: checkboxes, the menu stays open while toggling,onSelectionChangedreports the full selection, andselectedItemsLabelcustomizes the trigger text. - Optional "select all" / "clear" actions for multi-select via
showSelectAll(default off), with customizableselectAllLabel/clearAllLabel. Both respect the active search filter and skip disabled items. - Multi-select reuses all existing features (search, grouping, positioning, per-item enable/disable, custom colors).
0.1.0 #
Initial release — single-select foundation.
- Generic
CustomDropdown<T>that works over any model type. - Free positioning:
top,bottom,left,right, andauto(auto-flip). - Built-in search (
enableSearch) with an optional custom matcher. - Grouping via
groupBywith group headers. - Per-item enable/disable via
isItemEnabled. - Custom colors and styling through
DropdownDecoration. - Optional custom item rows via
itemBuilder. - Zero runtime dependencies (Flutter SDK only).