smart_auto_suggest_box 0.2.1
smart_auto_suggest_box: ^0.2.1 copied to clipboard
A highly customizable auto-suggest text field with smart dropdown positioning that adapts to available screen space.
ChangeLog #
0.2.1 #
Fixes #
- Keyboard-aware overlay sizing (
SmartAutoSuggestBox): popup placement/height now accounts for keyboard insets (MediaQuery.viewInsets.bottom) instead of relying on safe padding only. - Direction priority + best-space fallback: the preferred direction is tried first; if it cannot fit the popup target size, the overlay falls back to the direction with the largest available space.
- Auto-scroll for constrained layouts: when all directions are constrained, the nearest scrollable parent is auto-scrolled to improve available space, then the overlay is recomputed.
- Overlay reacts to keyboard metric changes: overlay now rebuilds when keyboard opens/closes to keep placement accurate.
- Added/updated widget tests covering keyboard-aware placement, fallback behavior, and auto-scroll behavior.
0.2.0 #
Features #
-
SmartAutoSuggestView: New inline widget that shows aTextFieldwith a suggestion list rendered directly below it in the normal widget tree — no floating overlay. Ideal for search screens, filter panels, and embedded search UIs. Shares the sameSmartAutoSuggestDataSourceAPI asSmartAutoSuggestBox. -
Scrollbar: Both
SmartAutoSuggestBoxandSmartAutoSuggestViewnow show a visible scrollbar thumb when the suggestion list overflows.listMaxHeight: maximum height of the inline suggestion list (default 380px).showListWhenEmpty: whether to display the list when the text field is empty (defaulttrue).- Supports
.formconstructor withvalidatorandautovalidateMode. - Full keyboard navigation (↑ ↓ Enter).
-
Shared-type rename — types that are shared between
SmartAutoSuggestBoxandSmartAutoSuggestViewhave been renamed to drop theBoxinfix:Old name New name SmartAutoSuggestBoxItemSmartAutoSuggestItemSmartAutoSuggestBoxDataSourceSmartAutoSuggestDataSourceSmartAutoSuggestBoxSearchModeSmartAutoSuggestSearchModeSmartAutoSuggestBoxSorterSmartAutoSuggestSorterSmartAutoSuggestBoxItemBuilderSmartAutoSuggestItemBuilder
Deprecations #
- All five old names above are kept as deprecated
typedefaliases for full backward compatibility — no code changes required to migrate.
Example #
- Updated example app with a bottom
NavigationBarswitching betweenSmartAutoSuggestBox(floating overlay),SmartAutoSuggestView(inline list), and Advanced Examples demos. - Updated all example code to use the new type names.
- BottomSheet example:
SmartAutoSuggestViewinside ashowModalBottomSheet. - Custom no-results: Rich custom widget with icon, message, and action button.
- Custom item builder: Tiles with leading emoji avatar, subtitle, and trailing badge.
- Custom loading: Shimmer-style placeholder while server search is in progress.
0.1.0 #
Features #
SmartAutoSuggestDataSource(wasSmartAutoSuggestBoxDataSource): New data source abstraction.initialList: Synchronous callback to provide initial items with access toBuildContext.onSearch: Async search callback that receives(context, currentItems, searchText).searchMode: Controls whenonSearchis invoked —onNoLocalResults(default) oralways.debounce: Configurable debounce duration (default: 400ms).
SmartAutoSuggestSearchMode(wasSmartAutoSuggestBoxSearchMode): Enum to control search behavior.
Deprecations #
itemsconstructor parameter — usedataSourcewithinitialListinstead.onNoResultsFound— usedataSourcewithonSearchinstead.
Features #
SmartAutoSuggestBoxDataSource: New data source abstraction that replaces theitemsandonNoResultsFoundparameters with a cleaner, unified API.initialList: Synchronous callback to provide initial items with access toBuildContext.onSearch: Async search callback that receives(context, currentItems, searchText).searchMode: Controls whenonSearchis invoked —onNoLocalResults(default) oralways.debounce: Configurable debounce duration (default: 400ms).
SmartAutoSuggestBoxSearchMode: New enum to control search behavior:onNoLocalResults: Only callsonSearchwhen local filtering yields no results.always: CallsonSearchon every text change after debounce.
Deprecations #
itemsconstructor parameter — usedataSourcewithinitialListinstead.onNoResultsFound— usedataSourcewithonSearchinstead.
Example #
- Updated example app with 4 demos:
initialList,onSearch,searchMode.always, and deprecateditemsbackward compatibility.
0.0.2 #
Features #
- Smart dropdown positioning: The dropdown now supports 4 directions:
top,bottom,start, andend. - Auto-fallback positioning: When there isn't enough space in the preferred direction, the dropdown automatically repositions to the opposite direction.
- RTL support:
startandenddirections respect the text directionality (ltr/rtl).
Breaking Changes #
SmartAutoSuggestBoxDirection.belowis now deprecated.- Use
SmartAutoSuggestBoxDirection.bottominstead. SmartAutoSuggestBoxDirection.aboveis now deprecated.- Use
SmartAutoSuggestBoxDirection.topinstead.
Example #
- Updated example app to demonstrate all 4 dropdown directions with interactive direction switching.
0.0.1 #
- Initial release of
smart_auto_suggest_box.