select_modal_flutter 1.0.0
select_modal_flutter: ^1.0.0 copied to clipboard
Flutter package to create a select field that opens its options in a modal window with search filter.
1.0.0 - 2026-10-14 #
BREAKING CHANGES #
ItemSelectis now generic (ItemSelect<T>) and requiresvalueandlabel. Callbacks are strongly typed (ValueChanged<ItemSelect<T>>andValueChanged<List<ItemSelect<T>>>).- The loose style parameters (
boxDecoration,borderTextField,colorIcon,colorInputText,colorModal,colorItemTextModal,colorButtonSelect) are replaced by a singleSelectModalStyle(aThemeExtension). bool? erroris replaced byString? errorText.
Changed #
- Refreshed UI: rounded modal with a bold header, a filled rounded search field, rounded option rows with a leading icon avatar and an animated check/circle indicator, plus a centered icon empty state.
- Multi select modal now shows the current selection as removable chips,
a "Select all / Clear" toolbar and a full-width confirm bar with the selected
count (
Confirm (3)). - Example app fully redesigned with a gradient hero, Material 3 theming and sectioned cards showcasing every feature.
Added #
- Generic, strongly typed
SelectModalFlutter<T>andMultiSelectModalFlutter<T>widgets plus ashowSelectModalhelper. - New
SelectModalStylefields:searchFieldFillColor,searchFieldBorderColor,searchFieldBorderRadius,titleTextStyleandoptionIconBackgroundColor. SelectModalStyle: pass it throughstyleor register it inThemeData.extensionsfor app-wide theming, withmerge,copyWithandlerpsupport.ItemSelect.subtitle,ItemSelect.iconandItemSelect.enabled(disabled options are greyed out and cannot be selected); search also matchessubtitle.- External
controllerandfocusNodeon the single select field. - Server-side search with
asyncLoader(loading, error and retry states),searchDebounce(default 300 ms),onSearchChangedandsearchMatcher. - Fully custom rows and empty states with
itemBuilderandemptyBuilder. SelectModalPresentation.bottomSheetto present the modal as a bottom sheet on both widgets.- Multi select:
maxSelection,minSelection,onMaxSelectionReached,showSelectAll(selectAllText/clearText) andshowSelectedCount(selectedCountText, "N selected"). - Accessibility:
ListTile.selectedstate,scrollToSelectedon open, disabled field viaenabled, a 48 dp confirm action with tooltip/semantic label (confirmText) and a chip remove action with a "Remove" semantic label and a larger hit area. - Modal UX: optional header with title and close (cancel) button
(
showModalTitle,showCloseButton,closeText), and configurable drag handle in bottom sheets (showDragHandle). - Translatable texts for i18n:
emptyText,retryText,selectAllText,clearText,selectedCountText,confirmText. - Empty state ("No results found") and a clear button in the search field.
useRootNavigator(defaulttrue) andcloseChipOnTap.listItemSelectis optional whenasyncLoaderis provided.
Fixed #
- Added the missing
flutter_lintsdependency (brokenanalysis_options.yaml). ItemSelectnow implements==/hashCode, so the selection highlight works when lists are rebuilt.onItemSelectis no longer called duringinitState; removed thesetState()call insideinitState.- Safe handling of items with a
nulllabel. TextEditingControlleris disposed correctly and deprecatedwithOpacitywas replaced withwithValues.- Replaced hardcoded
MediaQuerywidth math (broken on tablets/web) with a responsive layout andListView.builderfor long lists. - Search default text is now
Search(was hardcodedBuscar). - README and example now compile.
Testing #
- Unit/widget tests and a GitHub Actions CI workflow.
0.0.1 #
- initial release.
0.0.2 #
- add error validation.
0.0.3 #
- add comments
0.1.1 #
- add multiselect
0.1.2 #
- fixed multiselect
0.1.3 #
- fixed select
0.1.4 #
- modify data type in model
0.1.5 #
- send initial value
0.1.6 #
- fixed send initial value
0.1.7 #
- fixed send initial value multiselect
0.1.8 #
- fixed send initial value multiselect
0.1.9 #
- add colors to the dialog and select fields