- Fixed
charAt(index)to returnnullwhenindex == lengthinstead of throwing aRangeError. - Fixed
controller.selectAllItems()so it respectsmaxSelectedItems. - Fixed ownership and disposal of
TextEditingController,FocusNode, andScrollControllerso externally provided instances are not disposed by the widget. - Fixed the overlay
FocusNodelistener lifecycle to avoid stale listeners when focus nodes change or outlive the widget. - Fixed selectable bulk actions so
selectAllItems()andclearAllPickedItems()no longer remove, re-add, or duplicate visible items in selectable mode. - Fixed overlay creatable validation so the overlay constructor now applies
CreateOptions.validator, matching the standard creatable path. - Fixed creatable flows so
onCreatedfires andshowedItemsis refreshed even whenpickCreated == false. - Fixed
ShowedItemsVisibility.alwaysOnso the showed-items panel stays visible afterselectAllItems(). - Fixed parent-driven rebuild handling by syncing updates to
items,initialPickedItems,controller,searchField.controller,searchField.focusNode,showedItemsScrollController,pickedItemsScrollController,overlayOptions, andisOverlay. - Fixed active search-state preservation so filtering is reapplied when the parent updates items or swaps the search controller.
- Fixed runtime overlay transitions so switching between overlay and non-overlay variants no longer risks
LateInitializationErroror stale overlay callbacks.
- Replaced
charAtstring splitting with direct indexing to avoid unnecessary list allocation. - Removed unreachable
Navigator.pop(context)logic from_onAddItem. getAllItems()andgetPickedItems()now return unmodifiable lists instead of exposing mutable internal state.hintTextis now used as a fallbackInputDecorationhint when the provided search field has no decoration.showedItemContainerHeightandshowedItemContainerPaddingare now applied to showed-item rows.- Default picked-items scroll controller creation moved from the public constructors into
State, so internally created controllers are owned and disposed correctly. - Removed the implicit
ValueKey(items.hashCode)default key so state is preserved across normal parent rebuilds unless the caller explicitly provides a key.
- Added
charAtunit coverage for boundary conditions, negative indices, null input, empty strings, and the previous off-by-one crash case. - Added widget regression tests for search-state syncing, controller rebinding, selectable bulk actions, creatable validation, overlay callback rebinding, overlay transitions, and disposal of externally owned controllers/focus nodes.
- Moved
lintfromdependenciestodev_dependencies.
- Replace deprecated
scribbleEnabledwithstylusHandwritingEnabled
- Refactors withOpacity to withValues
- All examples are updated to reflect the breaking changes
- A new example added for the selectable style
- Adds library's topics
- Adds
isSelectableparameter onMultipleSearchController(defaults tofalseif not provided). This will slightly adjust the behaviour of the showed items. The items are not removed from the list when selected.
- A third parameter,
isPickedis added onitemBuilder. This way you can change the looks of the item when it is already picked (e.g checkbox) :
versions <2.7.0
itemBuilder: (country, index) {
return Padding(
padding: const EdgeInsets.all(6.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Colors.white,
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 12,
),
child: Text(country.name),
),
),
);
},versions >=2.7.0
itemBuilder: (country, index, isPicked) {
return Padding(
padding: const EdgeInsets.all(6.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Colors.white,
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 12,
),
child: Text(country.name),
),
),
);
},- Adds
allowDuplicateSelectionparameter onMultipleSearchController. Defaults totrue, whether you want duplicate items (if present on list) to be picked. - Adds
validatorparameter onCreateOptions. Defaults totrue, abool Function(T)to validate the item before creating it.
- Added the
minCharsToShowItemsparameter toMultipleSearchControllerto delay the search operation until the user has typed a minimum number of characters.
- Due to the integration of the OverlayPortal feature, introduced in Flutter 3.10.0, the version constraints have been updated from
">=1.17.0"to">=3.10.0". This adjustment ensures compatibility with newer functionalities. Projects using versions of Flutter older than 3.10.0 and updating the library from versions 2.6.0 to 2.6.2 may encounter an 'OverlayPortalController' not founderror. It is recommended to update the Flutter environment to at least version3.10.0before applying this library update.
- Removes
initialItemsfrom theallItemsto avoid double records - Refactors
MultipleSearchControlleravoidingLateInitializationErrors
- Updates README to reflect recent changes
- Improves internal documentation
- Introduces a new constructor
MultipleSearchSelection.overlayin which the showed items, act as an overlay instead of pushing bottom widgets. You can customise overlay's behaviour throughOverlayOptions.
| Overlay | Default |
|---|---|
![]() |
![]() |
The implementation of searchField has been updated for enhanced customization. You can now use the searchField parameter to pass a fully customizable TextField. This change offers greater flexibility in tailoring the search field to your specific needs. Please note that the onChanged event is managed internally. For capturing changes in the search field, use onSearchChanged instead of onChanged.
Below already exposed parameters are removed :
searchFieldInputDecorationsearchFieldTextStyleshowClearSearchFieldButtonsearchFieldInputDecorationautoCorrectenableSuggestionssearchFieldBoxDecorationsearchFieldTextEditingControllersearchFieldFocus
Parameters renamed to better reflect their purpose :
- At
CreateOptionsclass:createItemtocreatecreateItemBuildertocreateBuilderpickCreateItemtopickCreatedonItemCreatedtoonCreatedonDublicateItemtoonDuplicate
- Introduces a new parameter,
MultipleSearchController, which serves as acontrollerfor accessing both displayed and selected items. The only limitation is that it must be utilized after the widget has been constructed.
controller.getAllItems();
controller.getPickedItems();- Introduces additional options in
CreateOptionsfor thecreatablewidget:allowDuplicates: This option is set totrueby default. When set tofalse, it prohibits the selection of any newTitem that already exists. It's important to note thatTmust implement the==method for the library to accurately determine whether theTitem already exists among displayed or picked items.onDuplicateItem(T): This callback function is triggered when an attempt is made to add a duplicate item.
- Adds a new flag
placePickedItemContainerBelowwhich defaults tofalse. Picked items will be displayed at the bottom instead of top
- Renames
textFieldFocustosearchFieldFocus - Adds
autoCorrectflag, to check if the search field should auto correct the input text - Adds
enableSuggestionsflag, to check if the search field should provide suggestions
- Resolves the inconsistency where ShowedItemsVisibility.onType was showing all items after selecting one from the list.
- Fixes range exception issue when selecting all items
- Removes deprecated parameters
- Adds
maxSelectedItemsparameter to specify the maximum amount of items the user can select from the items' list. If the maximum number is picked:- The search TextField is disabled and the items' list is hidden.
- The select all button is hidden.
- The show items button is hidden, if the item visibility is Toggle.
- The dialog of the items is popped, if the item visibility is Toggle.
- Resolves an issue with
showedItemsnot dissapearing whenitemsVisibility == ShowedItemsVisibility.onType&clearSearchFieldOnSelect == true
- Adds
showedItemsExtentflag. When we have very large lists with dynamic content, unfortunately there is an open issue in Flutter that causes the list to be very slow when scrolled with the srollbar. In that case you can set this to use a fixed height for each item resolving the jankiness. The downside obviously would be that you can't have dynamic height items.
- Resolves an issue when the clear textfield button was not resetting showed items.
-
Renames
outerContainertosearchFieldto properly reflect its purpose. -
Adds a new parameter called
searchFieldBoxDecoration, which allows you to specify the decoration of the top portion of the dialog box when theShowedItemsVisibilityis set totoggle. -
Adds deprecated flags to exposed
Decorationparameters frompickedItemsBoxDecoration,searchFieldBoxDecoration&showedItemsBoxDecoration. Will be removed on next version. -
Fixes discrepancies of the decoration parameters.
- Fixes short circuiting issue
- Resolved issue of displayed items failing to wrap when there were fewer items to display in the container.
- Refactored the displayed items to use lazy loading, resulting in a significant improvement in performance for large lists. Additionally, the index is now accessible for further customization.
itemBuilder: (country, index) {
if (index==0) return Text('Hello World');
return Padding(
padding: const EdgeInsets.all(6.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Colors.white,
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 12,
),
child: Text(country.name),
),
),
);
},- Exposes some more
InputDecorationparameters :- Adds
showClearSearchFieldButtonwhich adds a suffix icon to clear searchfield - Adds
hintText - Adds
textFieldFocus - Adds
textEdittingController
- Adds
- If
pickedItemsContainerBuilderis provided it will build even if no items are picked
- Adds
pickedItemsContainerBuilder. You can now provide your own customWidgetfor the picked items.pickedItems(List<Widget>) are created from thepickedItemBuilder. So having those items you can customise the layout at your needs.
pickedItemsContainerBuilder: (pickedItems) => Center(
child: Container(
height: 150,
width: 150,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey[400]!),
),
child: ListView(
children: pickedItems,
),
),
),
pickedItemBuilder: (country) {
return Padding(
padding: const EdgeInsets.all(8),
child: Center(
child: Text(
country.name,
style: const TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline,
),
),
),
);
},- Removes redundant code & refactors methods.
- Fixes
onItemRemovedbeing called twice. Thanks to anqit
- Fixes issue were fuzzy search was not always working
- Adds missed [onItemCreated] parameter to [createOptions]
- Adds
caseSensitiveSearchso you can search with case sensitive. Thanks to anqit
New constructor added MultipleSearchSelection<T>.creatable which can now create new item when search result does not return any results. It takes a new required parameter, createOptions e.g :
// [T] here is [Country]
createOptions: CreateOptions<Country>(
// You need to create and return the item you want to add since [T] is not always [String].
createItem: (text) {
return Country(name: text, iso: text);
},
// Create item Widget that appears instead of no results.
createItemBuilder: (text) => Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Create "$text"'),
),
),
// Whether you want to pick the newly created item or just add it to your list. Defaults to false.
pickCreatedItem: true,
),- [clearSearchFieldOnSelect]. Whether to clear the searchfield and reset the showed items when you pick an item. Defaults to [false].
🔥 Breaking changes:
- Minimum Dart SDK updated to 2.17.0
🐛 Bug fixes:
- Dropdown was not correctly rebuilding after changing the initial
itemslist.
♻️ Fields made optional:
- Key parameter has been added. It defaults to
ValueKey(items.hasCode). - [maximumShowItemsHeight]. It defaults to 150.
- [onPickedChange]. Your call if you need it.
- [itemsVisibility]. It defaults to always on.
- [fuzzySearch]. It defaults to none.
- Fixes
itemsVisibility: ShowedItemsVisibility.onTypenot showing anything.
Fields removed:
- [padding] : Refactor -> You can wrap the whole widget in a [Padding] widget.
- [titlePadding] : Refactor -> You can wrap the title with a [Padding] widget.
- [showedItemMouseCursor] : Refactor -> You can build your own showed item [Widget] with [itemBuilder] and use your own style.
- [searchItemTextContentPadding] : Refactor -> You can use [searchFieldInputDecoration] to style your search textfield.
Fields renamed:
- [searchItemTextStyle] -> [searchFieldTextStyle]
- Adds [showItemsButton] widget and removes all parameters associated with it previously.
- Adds [selectAllButton] widget and removes all parameters associated with it previously.
- Adds [clearAllButton] widget and removes all parameters associated with it previously.
- Removes opinionated default widgets to plain [Text] reducing code size
- Fixes sort picked items bug
- Fixes bug with [showItemsText] button text showing [selectAllText] instead
- Removes junk files reducing library size
[items] & [initialItems] are now of type [T] for more flexibility when working with different types of [Object] in [List].
New required parameters added :
- [itemBuilder(T)] build and return the showed item widget
- [pickedItemBuilder(T)] build and return the picked item widget
- [fieldToCheck(T)] return the [String] field from the [T] of which you will search & sort against
Removed all parameters connected to showed & picked items since we now have builder methods. Please check the example for the implementation.
- Adds [itemsVisibility] enum which activates different display options on showed items.
ShowedItemsVisibility.alwaysOn // The items are always displayed
ShowedItemsVisibility.onType // Items are displayed when user types on search field
ShowedItemsVisibility.toggle // Items are displayed when tapped on show items toggle button- Replaces deprecated
isAlwaysShownwiththumbVisibilityforRawScrollBar
- Adds initialy picked items parameter,
List<String>.initialPickedItems - Edits library description
- Edits example code
- Adds [MouseCursor] for showed & picked items.
showedItemMouseCursor&pickedItemMouseCursor - Adds [BoxDecoration] for showed & picked items container.
pickedItemsBoxDecoration&showedItemsBoxDecoration
- Adds fuzzy search functionality. New
enumFuzzySearchadded to choose from available fuzzy algorithms (Jaro & Levenshtein). Defaults to [FuzzySearch.none].
- Adds [ScrollController] for showed & picked items.
- Adds [ScrollPhysics] for showed & picked items.
- Adds a choice whether to sort showed & picked items.
- Adds picked item remove icon parameter.
- Exposes picked item's [BoxDecoration].
- Exposes clear all & select all buttons' animation curves.
- Initial release.




