fl_select 0.8.0
fl_select: ^0.8.0 copied to clipboard
A customizable Flutter select widget for building filter bars, cascading menus, and pickers with single/multiple selection, async loading, search filtering, theming, and i18n.
0.8.0 #
-
FEATURE add
toQueryMap()andtoQueryParameters()extensions onSelectEntriesto serialize a selection tree into URL query parameters. Each category contributes key/value pairs keyed by its own id with the deepest selected leaf ids as values; header/footer subtrees are keyed by their own ids; an "any" leaf resolves to its parent id; and a customSelectRangeEntryformats asmin-max.toQueryMap()returns aMap<String, List<String>>mirroringUri.queryParametersAll, so repeated keys can be read back without losing values, or handed to HTTP clients that accept multi-value maps directly.toQueryParameters({arrayFormat, delimiter, encode})renders the map into a query string, with multi-value layouts selected by the newSelectArrayFormatenum:repeat(default,cate1=a&cate1=b),brackets(cate1[]=a),comma(cate1=a,b),indices(cate1[0]=a), anddelimited(cate1=a|bwith a customdelimiter, covering OpenAPIpipeDelimited/spaceDelimited). Values are percent-encoded by default.
-
BUGFIX fix cascading selection state handling around search and cross-category clearing in
CascadingSelect: focusing a category no longer clears other categories' selections; per-category single mode only clears selections within its own subtree; header/footer selections are cleared across categories; deeper search matches are auto-expanded; canceling a search restores the original unfiltered tree entries. -
BUGFIX fix cross-category clearing in two-level category trees (
GridSelect,ListSelect,FlattenSelect): selecting a leaf in one category now clears every other category's selections when the delegate is in single mode, mirroring the cascading behavior. -
FEATURE add search filtering to the select panel. Every
SelectDelegateacceptssearchEnabled,searchPredicate,searchHintTextandsearchDebounceDuration; when enabled, aSelectSearchBarrenders above the body and filters displayed entries (debounced 300 ms by default) while preserving layout and selection state. The search bar's look is customizable via the newSelectSearchBarTheme, per delegate or globally viaSelectThemeData. -
DEPRECATION rename the
previousSelected/resetSelectedAPI surface toselectedEntries/resetEntriesto align naming across the library. Only the public API keeps the old names as deprecated aliases for backward compatibility; they will be removed in a future minor version. No behavior changes.
0.7.2 #
-
BUGFIX fix custom range input handling across
SelectListView,SelectGridViewandSelectRangeView:- values not refreshing after normalization —
_commitCustomRangenow writes the canonical (min ≤ max) order back into the min/max fields, so entering an inverted range (e.g. min222/ max100) immediately reflects100/222on screen. - min value being lost — an inverted range is only swapped when both fields are non-empty; an empty field (parsed as
0) no longer spuriously triggers a swap that clears the min field while typing min first. - premature swap while typing —
SelectListViewnow listens only to the focus nodes and commits on focus loss (matchingSelectGridView), instead of committing on every keystroke, so typing222then starting111no longer flips the fields before the user finishes. - cross-category contamination — when multiple
SelectCategoryEntrys each own aSelectRangeEntry.custom()(all sharing the samecustomid) inside aListSelecttree, restoring the slider/fields now scopes to the entry whoseparentIdmatches the current category, so committing a value in one category no longer leaks into another category's inputs or slider.
- values not refreshing after normalization —
-
BUGFIX fix
SelectController.select/unselectnot affecting root-level entries in a flat structure.findPathreturns a single-element path for such entries, so the flat-handling branch (which requiredpath.isEmpty) was never reached andselect/unselectsilently no-op'd. The flat branch now also matches when the path's first element is not aSelectCategoryEntry. This fixes committing a custom range in single mode not deselecting the previously selected option. -
BUGFIX harden against build-phase crashes that previously froze the UI with no console output:
SelectController.validateEntriesnow additionally asserts that every top-level entry is aSelectCategoryEntryin a two-level-or-deeper structure, soSelectPanelroutes malformed structures to the error UI instead of hanging the frame. The fouras SelectCategoryEntrycasts inGridSelect/ListSelect/FlattenSelect/CascadingSelectwere replaced withis-checked safe conversions as a second line of defense. -
DEPRECATION mark
FlattenSelectDelegate.crossAxisCount,FlattenSelectDelegate.mainAxisSpacing,FlattenSelectDelegate.crossAxisSpacingandFlattenSelectDelegate.childAspectRatioas deprecated.FlattenSelectnow falls back toSelectChipLayoutwhenSelectCategoryEntry.layoutis null, so these delegate grid parameters no longer affect rendering. Set aSelectGridLayoutonSelectCategoryEntry.layoutinstead. -
FEATURE when
SelectCategoryEntry.layoutis null,FlattenSelectnow falls back to a wrapableSelectChipBar(SelectChipLayout) instead of a grid built from the widget's own cross-axis parameters. -
FEATURE add the
childrenfactory constructors onSelectCategoryEntry,SelectChildEntryandSelectTextEntry. Each automatically injects its ownidas theSelectChildEntry.parentIdof every child (recursively), so you never need to writeparentIdon children by hand when building two-level-or-deeper trees —SelectCategoryEntry.childrencovers the category (root) level, whileSelectChildEntry.children(and the type-preservingSelectTextEntry.children) cover deeper (non-root) levels. All share the injection logic via a common_injectParentIdhelper.
0.7.1 #
- FEATURE
showSelectnow accepts optionalleading,trailingandcenterTitlewidgets to attach to the header row, mirroringshowModalBottomSelect. Both entries now share a commonSelectHeaderwidget that lays the title out with an outerStackso the title stays truly centered across the full header width even whenleading/trailingare asymmetrical.
0.7.0 #
-
BREAKING make
PopupSelectBar.selectDelegatesrequired — it is now a non-nullableList<SelectDelegate>and must be provided toPopupSelectBar.PopupSelectBar.onAppliedis likewise now required (PopupSelectBarResultCallback, non-nullable). Update call sites that previously omitted either parameter to pass them explicitly. -
BREAKING make
PopupSelectButton.selectDelegaterequired — it is now a non-nullableSelectDelegateand must be provided to everyPopupSelectButtonconstructor.PopupSelectButton.onAppliedis likewise now required (PopupSelectButtonResultCallback, non-nullable). Update call sites that previously omitted either parameter to pass them explicitly. -
BREAKING make
SelectDelegate.entriesLoaderrequired — it is now a non-nullableFuture<SelectEntries> Function()and must be provided by every delegate.SelectView.onChangedis likewise now required (SelectCallback, non-nullable). Update call sites that previously omitted either parameter to pass them explicitly. -
BREAKING remove all deprecated aliases, parameters, getters and methods introduced in 0.5.0 by the
Select*/PopupSelect*renaming. This includes: theSelector*Entry*/SelectorEntriesaliases,SelectorBox,showSelector,showModalBottomSelector,SelectorTheme/SelectorThemeData,SelectorPanelTheme,SelectorDelegate/CascadingSelectorDelegate/ListSelectorDelegate/GridSelectorDelegate/FlattenSelectorDelegate,SelectorController/SelectorControllerProvider,SelectorCallback,SelectorLayout/SelectorListLayout/SelectorGridLayout/SelectorChipLayout/SelectorRangeLayout,SelectorLocalizations/SelectorLocalizationsDelegate,SelectorLabelLoader/SelectorLabelState,DropdownOverlayStyle,kSelectorListTileHeight, theDropdownSelector*→PopupSelect*aliases (DropdownSelectorBar,DropdownTab,DropdownSelectController,DropdownTabData,DropdownSelectControllerProvider,DropdownSelectorBarTheme,DropdownSelectorButton,DropdownSelectorButtonTheme,DropdownSelectorButtonVariant,DropdownSelectorButtonResultCallback,DropdownSelectorButtonWillToggleCallback,kDropdownSelectorButtonHeight,DropdownSelectorDirection), and theselectorDelegates/selectorTheme/selectorDelegateparameters and getters,previousSelectorDelegate,selectorControllerandattachSelectorDelegatesmembers. Use theSelect*/PopupSelect*names instead; see the Migration guide for the full old → new tables. -
DEPRECATION rename the selector lifecycle callbacks on
PopupSelectBarandPopupSelectButton—onSelectorShowed/onSelectorHidden/onSelectorWillShow/onSelectorWillHide→onSelectShowed/onSelectHidden/onSelectWillShow/onSelectWillHide. The old names are retained as deprecated constructor parameters and getters that delegate to the new names (passing both at the same call site triggers an assertion) and will be removed in a future minor version. -
DEPRECATION rename
PopupSelectController.hideSelector→hideSelect,toggleSelector→toggleSelect, andisSelectorShowing→isSelectShowingto drop the redundantSelectorwording. The old names are retained as deprecated methods / getters that delegate to the new names and will be removed in a future minor version. -
FEATURE
FlattenSelectnow consumesSelectCategoryEntry.layoutvia an exhaustiveswitch (layout), matching the behavior already present inListSelect/GridSelect. Each category's right-side content renders as aSelectListView,SelectGridView,SelectChipBar,SelectRangeView, orSelectCounterdepending on its layout, with the grid/list/counter/range layout-specific parameters (crossAxisCount, spacing,childAspectRatio,toText, etc.) and the delegate theme overrides (grid/field/chip) honored. Whenlayoutis null, it falls back to the grid using the widget's owncrossAxisCount/mainAxisSpacing/crossAxisSpacing/childAspectRatio, so existing default behavior is unchanged.