search_anchor_picker 0.2.3
search_anchor_picker: ^0.2.3 copied to clipboard
A searchable Flutter picker with multi or single selection, nested sub-pickers, and async save callbacks that roll back on failure.
0.2.3 #
- Widget
initialSelectedItemCacheshows selected IDs missing from the loader page in a Selected section, and keeps those rows visible under a load-error message whenitemsLoaderfails. Search still applies only to Results.itemBuildernow receivesPickerItemSource.DefaultPickerItemTileacceptstitle,subtitle, andrelatedListItemStatus.
0.2.2 #
- fix analyzer warnings
0.2.1 #
- Shortened the pubspec description. Added
example/example.dartfor pub.dev. Asserts onPickerConfigbind state include messages.
0.2.0 #
Breaking vs 0.1.1:
onToggle/OnToggleMode→onChange(PickerDelta). A throw restores the checkbox.onFinish→onClose(PickerDelta). A throw keeps the overlay open (closeSavingBuilder/closeSaveFailedBuilder).viewOnCloseis overlay lifecycle.PickerMode.radio/radioToggle→SelectionMode.single/singleOptional.UnselectBehavior+isItemInUse→relatedListItemStatusOf(unselectPolicy,selectable,auxiliaryMembership). Status listenable repaints without reload.itemBuildergets status beforetoggle.- Removed
canChangeSelection. Block or confirm withPickerUnselectPolicy; throw fromonChangeto restore a checkbox after a failed write. SubPickerTileno longer deselects parent IDs just becauseparentControlleris set. Opt in withSubPickerParentSelectionEffect.SubPickerTile.onChangeis(delta, notifyParent). WhenonCloseis also set, callnotifyParent()after every successfulonChangefor immediate parent sync, or never in that session.loadItems/LoadItems→itemsLoader/ItemsLoader.viewOnChanged→onQueryChanged.itemsLoaderis(context, query).PickerSearchModechooses what typing does:local(default) loads once and filters the snapshot;remotereloads and trusts the page;hybriddoes both.searchTermsOfis optional and unused inremote. Debounce remoteitemsLoader(or the API) withDebounceror an equivalent; the picker does not. The open picker watches search-field text (not cursor moves) and reloads remote/hybrid from that.onQueryChangedincludes programmatic query changes.searchController→queryController(TextEditingController). Overlay control is onPickerConfig:open()/close(), plusisAttached/isOpen.
Also:
- Persist in
onChangeoronClose, not both. Close nets select/deselect against the seed at open; change does not. - Removed unused
PickerSelectionSession.acceptToggle/result(remainingOnly:). Removed thelib/raw.dartentrypoint; raw types stay underlib/src/raw/. - Bulk header commands take the same apply path as a row toggle (one delta).
- Default copy is localized (empty, no-results, retry, in-use warning/confirm,
saving, close-save failed).
emptyText/noResultsTextoverride the first two. DefaultPickerFieldTriggeris the field-styletriggerBuilder: outlined input, optional selected chips, Add (multi) or Change (single), field tap opens, chip delete removes without opening.copyWithcan clear nullable fields (copyWith(listenable: null)). The copy is unbound. OnePickerConfiginstance binds to one picker; a second attach throws.- Parent effects apply after a successful child
onClose, or after eachonChangewhenonCloseis omitted. When both are set, callnotifyParent()after every successfulonChangeor never in that session. The parent search field shows a spinner while that write is in flight.
0.1.2 (git only) #
- Added API documentation for the public libraries and query-close behavior.
- Added localized default empty/no-results messages with
emptyTextandnoResultsTextoverrides for main and nested pickers. - Localized default retry and in-use removal warning/confirmation text through the same locale resolver.
0.1.1 #
- Made item reloads explicit: ordinary
PickerConfigreplacement now rebinds without fetching, whilereloadKey,listenable, and controllerrefresh()provide deliberate invalidation paths.
0.1.0 #
Breaking package identity:
-
Renamed the unpublished package from
generic_search_selectortosearch_anchor_picker; imports now usepackage:search_anchor_picker/search_anchor_picker.dart. -
Renamed
GenericPickerActions/PickerActionstoGenericPickerController/PickerController, and renamedSubPickerTile.parentActionstoparentController. -
Removed the deprecated
onFinishReplaceAll,minWidth, andmaxHeightAPIs. Use explicitonFinishdeltas andviewConstraints. -
Removed the replace-all-only empty-save parameters, builder, and default widget.
-
Raised the declared Flutter minimum to 3.38 and activated
very_good_analysisfor the package. -
Kept Riverpod isolated to the async example by moving its integration test into the example package.
-
Split agent documentation into a package maintenance guide and a standalone consumer integration skill.
0.0.4 #
SearchAnchor parity / UI:
- Added SearchAnchor-compatible view properties and
SearchViewThemefallback. - Added mobile full-screen and desktop anchored popup defaults.
- Added focused builders for search, results, loading, empty, error, composed view, and surface regions.
- Moved optional/default widgets under
lib/src/widgets/and addedwidgets.dart. - Added
viewConstraintsfor popup sizing.
Selection / lifecycle:
- Close persistence uses
onFinish({added, removed})explicit deltas. - Simplified header actions:
selectLoaded,clearLoaded, and their filtered variants record explicit deltas by default;syncPending(added:, removed:)is the sole pending-only synchronization escape hatch. - Selected IDs missing from the loaded page are preserved.
- Extracted selection-session bookkeeping and expanded lifecycle coverage.
- Added loading/error/retry states, stale-load suppression, idempotent close, and safe callback failure cleanup.
Docs / example:
- Documented server-side search safety, visual builders, theme precedence, and
OnToggleMode.awaitGateversusOnToggleMode.optimistic. - Added the example web deployment workflow and online demo link.
Consumers using Git dependencies should pin a semantic version tag matching
pubspec.yaml.
0.0.3 #
Breaking / API:
- Split close persistence into
onFinish({added, removed})(explicit row deltas) andonFinishReplaceAll(finalIds)(replace-all). onFinishno longer receives the fullfinalIdslist; useonFinishReplaceAllwhen the backend needs the whole selection.- Empty
onFinishReplaceAllsaves require an explicit empty-save confirmation (saveEmptyLabel/showSaveEmptyButton). - Added bulk pending helpers:
pendingClearLoaded,pendingClearFiltered,pendingSelectLoaded,pendingSelectFiltered(no deltas). - Added explicit delta helpers:
toggleIdAsDelta,clearLoadedAsDelta,selectLoadedAsDelta,clearFilteredAsDelta,selectFilteredAsDelta.
Behavior / docs:
- Selected IDs missing from the current
itemsLoaderpage are preserved (server-side search safe). - Documented
OnToggleMode.awaitGatevsOnToggleMode.optimisticfor async checkbox UX. - Added agent-facing integration guidance for common consumer pitfalls.
- Example web deploy workflow + online demo link.
0.0.2 #
- Internal packaging bump (see git tags
v13/v14for prior consumer pins).
0.0.1 #
- Initial SearchAnchor-based picker with multi/radio modes, nested
SubPickerTile, and header actions.