animated_custom_dropdown 4.0.0
animated_custom_dropdown: ^4.0.0 copied to clipboard
Highly customizable animated dropdown for Flutter — search, network search with infinite scroll, multi-selection, overlay animations and a floating label.
4.0.0 #
A big release: a new overlay animation system, infinite-scroll pagination, a stack of new customization options, and fixes that sweep most of the open-issue backlog. All additions are backward-compatible.
✨ New features #
- Overlay animations — configure the open/close transition via the new
animationparameter (CustomDropdownAnimation):- Built-in transitions:
size,fade,sizeFade(default),scale,scaleFade,slide— direction-aware (open up/down). - Tune
duration,reverseDuration,curve,reverseCurve; smoother defaults (easeOutCubicopen /easeInCubicclose). CustomDropdownAnimation.noneto disable, or abuilderescape hatch for any custom transition.- Optional staggered list-item entrance via
staggerItems(tune withitemStagger/itemDuration). - The dropdown arrow now rotates (down ↔ up) in sync with open/close.
- Built-in transitions:
- Infinite scroll / pagination for the search-request constructors — new
paginatedRequest: (query, page) => …:- Loads page 1 on open/search and appends the next page as you scroll near the bottom, stopping once a page returns fewer than
pageSizeitems (default20). - Optional
loadMoreIndicatorfooter. Provide exactly one offutureRequest/paginatedRequest.
- Loads page 1 on open/search and appends the next page as you scroll near the bottom, stopping once a page returns fewer than
- Material-style floating label —
labelText(String) or a fully customlabel(Widget), withCustomDropdownDecoration.labelStyle/floatingLabelStyle/floatingLabelBehavior/floatingLabelGap(spacing between the floated label and the field) (#111). textAlignfor the header, hint, list items, search input, "no result found" text and the floating label (#71; thanks @hamhoney for PR #90).canClearSelection— a clear button to reset back to the empty/hint state (#106, #83).searchRequestMinChars— don't fire the request until at least N characters are typed (#107).selectOnItemTap— let a customlistItemBuilderown item selection (#80; inspired by PR #108 from @Giovanny-DS).overlayDirection(auto/below/above) to force the side the overlay opens towards (#92).initiallyOpento open the overlay automatically on first build (#87).autofocusOnSearchto focus the search field (raising the keyboard) when the overlay opens (#70).- Controller selection helpers:
SingleSelectController.select(),MultiSelectController.select()andMultiSelectController.toggle()(#100). CustomDropdownDecoration.closedHeaderHeightfor a fixed, vertically-centered closed-field height (#105).
💅 Improvements #
- The default closed error border now follows
errorStyle.color, so the border and error text match without settingclosedErrorBorderexplicitly (#105). - Search a list of custom class instances out of the box — search matches each item's
toString(); use theCustomDropdownListFiltermixin for complex filtering (#103).
🐛 Fixes #
- Overlay hidden behind the on-screen keyboard while searching (#116, #113, #51):
- Flips above the field using the live keyboard inset, recalculates on keyboard show/hide (
didChangeMetrics), keeps the dropdown alive (AutomaticKeepAliveClientMixin) and scrolls its field back into view — so the overlay no longer disappears when the field sits in a scrollable that resizes for the keyboard.
- Flips above the field using the live keyboard inset, recalculates on keyboard show/hide (
- Double border, opaque/gray background, extra side padding and bottom underline when an
inputDecorationThemeis set (Flutter 3.35+), including the gray background shown on validation error (#115, #117, #110, #68, #86, #84, #97; also raised in PR #94 by @mreslamgeek):- The field's internal
InputDecoratorno longer inherits the ambientinputDecorationTheme; it only surfaces the form validation error text.
- The field's internal
overlayControllerignored when a different controller instance is supplied on rebuild (#114) — the overlay now re-binds to the latest controller.SchedulerPhaseassertion on dismiss, and a stale-callback crash when a search request completes after the field is disposed (#96, #101; thanks @antoniomtnez for PR #109).multiSelectSearchRequestreliably shows "No result found" after an empty search result (#112).- Selecting/deselecting no longer mutates a caller's unmodifiable
items/initialItemslist (#62).
🙌 Thanks #
Thanks to @hamhoney (#90), @antoniomtnez (#109), @Giovanny-DS (#108) and @mreslamgeek (#94) for PRs and reports.
3.1.1 #
- Fix: onChanged not invoked after first invocation (Thanks @ravindrabarthwal for PR)
3.1.0 #
- Add: Controllers support (Thanks @hbatalhaStch for PR)
SingleSelectControllerMultiSelectController
- Add: Enabled/Disabled state support (Thanks @KabaDH for PR)
- Add: Dropdown disabled state decoration support
CustomDropdownDisabledDecoration
- Add: Items list scroll controller support
itemsScrollController
- Add: Dropdown overlay controller support
overlayController
- Add: Dropdown visibility status callback
visibility
- Update: Enhance decoration support
prefixIcon
- Remove: Empty items list assertion (Thanks @hbatalhaStch for the issue)
3.0.0 #
- Add: Multi selection support (Thanks @KabaDH for PR)
CustomDropdown.multiSelectCustomDropdown.multiSelectSearchCustomDropdown.multiSelectSearchRequest
- Add: Decoration support
CustomDropdownDecorationSearchFieldDecorationListItemDecorationScrollbarThemeData
- Add: Dropdown overlay height support (Thanks @aguilastorm for PR)
overlayHeight
- Add: Custom loading widget for search request
searchRequestLoadingIndicator
- Add: Padding properties:
closedHeaderPaddingexpandedHeaderPaddingitemsListPaddinglistItemPadding
- Fix: Stop the scrolling and dropdown should remains in expanded state (Thanks @s-saens for PR)
- Breaking: Properties move inside decoration:
closedFillColorexpandedFillColorerrorStyleclosedBorderclosedBorderRadiusexpandedBorderexpandedBorderRadiusclosedErrorBorderclosedErrorBorderRadiusclosedSuffixIconexpandedSuffixIcon
2.0.0 #
- Add: Migration to support List of generatic type
T(Thanks @JesusHdez960717 for PR) - Add: Mixin
CustomDropdownListFilterfor complex filter on search field - Add: Builders support
listItemBuilderheaderBuilderhintBuildernoResultFoundBuilder
- Add:
validator&validateOnChangeto enhance form validation support - Add: Other new properties:
initialItemsearchHintTextexpandedBorderexpandedBorderRadiuserrorBorderRadiushideSelectedFieldWhenExpandednoResultFoundTextexpandedFillColorexpandedSuffixIconmaxlines
- Breaking: Clean
controllersupport - Breaking: Clean
listItemStylesupport - Breaking: Clean
selectedStylesupport - Breaking: Clean
errorTextsupport - Breaking:
fillColorchange toclosedFillColor - Breaking:
fieldSuffixIconchange toclosedSuffixIcon - Breaking:
errorBorderSidechange toerrorBorder - Breaking:
borderSidechange toclosedBorder - Breaking:
borderRadiuschange toclosedBorderRadius - Refactor: Overlay rendering approach (change to declarative)
1.5.0 #
- Add: Request delay support for Search request API (Thanks @JesusHdez960717 for PR)
1.4.0 #
- Add: Search request API (Search on provided request)
- Update readme.
1.3.0 #
- Update: Flutter version 3.3.9 changes
- Add: List item builder support (Thanks @Mohamed25885 for PR)
1.2.2 #
- Update: Flutter version 3.0.1 changes
1.2.1 #
- Fix: State dispose calls
1.2.0 #
- Add: Search field (Search on list data)
- Fix: State mounted check on dropdown open or close.
- Update readme.
1.1.1 #
- Update: Suffix icon only allowed for dropdown field.
- Fix: Empty list pass (assert added).
1.1.0 #
- Add: Dropdown overlay alignments (top, bottom) according to available screen space.
- Update readme.
1.0.1 #
- Update readme, project description. Format files.
1.0.0 #
- Customizable animated dropdown widget.
