The biggest release yet. A brand-new overlay animation system, infinite-scroll pagination, a stack of new customization options, and fixes that clear most of the open-issue backlog. Every change is backward-compatible — upgrade without touching your code.
yaml
dependencies:
animated_custom_dropdown: ^4.0.0
🌟 Highlights
Configurable open/close animations
Pick a transition, tune the timing, or bring your own — all through one animation object.
CustomDropdown(
items: items,
animation: CustomDropdownAnimation(
type: DropdownAnimationType.scaleFade, // size · fade · sizeFade · scale · scaleFade · slide
duration: Duration(milliseconds: 300),
curve: Curves.easeOutCubic,
staggerItems: true, // cascading list-item entrance
),
onChanged: (v) {},
)
- 6 built-in, direction-aware transitions + smoother default curves
- Optional staggered item entrance, and an animated open/close arrow
- CustomDropdownAnimation.none to disable, or a builder for a fully custom transition
Infinite scroll (pagination)
Lazy-load remote data page by page — no more fetching everything up front.
CustomDropdown.searchRequest(
paginatedRequest: (query, page) => api.users(query, page), // 1-based page
pageSize: 20,
loadMoreIndicator: const Center(child: CircularProgressIndicator()),
onChanged: (v) {},
)
Loads the first page on open, appends the next as you scroll, and stops when a page returns fewer than pageSize items. The classic one-shot futureRequest keeps working unchanged.
✨ New
- Floating label — labelText (String) or a fully custom label (Widget), with labelStyle / floatingLabelStyle / floatingLabelBehavior / floatingLabelGap
- textAlign across header, hint, items, search input, no-result text and label
- canClearSelection — clear button to reset to empty/hint
- searchRequestMinChars — gate the request until N characters
- selectOnItemTap — let your listItemBuilder own selection (e.g. disabled items)
- overlayDirection — auto / below / above
- initiallyOpen — open on first build
- autofocusOnSearch — focus the search field (and raise the keyboard) on open
- Controller helpers — SingleSelectController.select(), MultiSelectController.select() / toggle()
- CustomDropdownDecoration.closedHeaderHeight — fixed, centered closed-field height
🐛 Fixes
- Overlay hidden behind the keyboard while searching — now repositions and scrolls into view (#116, #113, #51, #21)
- Theme bleed-through on Flutter 3.35+ — double border, opaque/gray background, gray-on-error and bottom underline are gone (#115, #117, #110, #97, #84, #86, #68)
- overlayController ignored when a new instance is supplied on rebuild (#114)
- SchedulerPhase assertion / setState-after-dispose on overlay teardown and async search (#96, #101)
- "No result found" reliability, unmodifiable-list safety, and custom-item tap handling — verified and test-locked (#112, #62, #89, #72)
⬆️ Upgrading
- No code changes required. Nothing was removed or renamed; new options are opt-in and defaults preserve existing behavior. (The only signature tweak: the search-request constructors now accept exactly one of futureRequest / paginatedRequest.)
- You'll notice the theme fixes, smoother animation curves and the rotating arrow — all improvements, no action needed.
- Minimum Flutter is now 3.19 (the package uses WidgetStateProperty, OverlayPortal, View.of and Dart 3 features).
🙌 Thanks
@hamhoney (#90), @antoniomtnez (#109), @Giovanny-DS (#108) and @mreslamgeek (#94) for PRs and reports — and everyone who filed issues that shaped this release.
Full changelog: see CHANGELOG.md (https://github.com/AbdullahChauhan/custom-dropdown/blob/master/CHANGELOG.md).