π Precision Select Dropdown
A production-ready, generic, searchable dropdown widget for Flutter.
precision_select_dropdown is built using overlay-based positioning to provide precise UI behavior, debounced search, outside tap dismissal, and full customization support.
Designed for scalability, clean architecture, and enterprise-grade applications.
β¨ Features
- β
Generic
<T>type support - β Search field inside dropdown
- β Overlay-based dropdown positioning
- β Outside tap dismissal (like native dropdown)
- β Android back button handling
- β Debounced search
- β Custom item builder
- β Custom search matcher
- β Empty state (βNo Data Foundβ)
- β Dart 3 & Null Safety support
- β Clean lifecycle management
πΈ Preview
Collapsed State

Expanded with Options

Search in Action

No Data Found State
π¦ Installation
Add this to your pubspec.yaml:
dependencies:
precision_select_dropdown: ^0.0.1
Then run:
flutter pub get
π Basic Usage
PrecisionSelectDropdown<String>(
items: const [
'Apple',
'Banana',
'Orange',
'Mango',
'Pineapple',
],
itemLabelBuilder: (item) => item,
hintText: 'Select a fruit',
onChanged: (value) {
debugPrint("Selected: $value");
},
)
π§ Advanced Usage (Custom Search + Custom UI)
PrecisionSelectDropdown<User>(
items: users,
hintText: "Select User",
itemLabelBuilder: (user) => user.name,
searchMatcher: (user, query) =>
user.name.toLowerCase().contains(query.toLowerCase()) ||
user.email.toLowerCase().contains(query.toLowerCase()),
itemBuilder: (context, user) => ListTile(
title: Text(user.name),
subtitle: Text(user.email),
),
onChanged: (value) {},
),
βοΈ Parameters
| Parameter | Type | Description |
|---|---|---|
items |
List<T> |
Data source |
itemLabelBuilder |
String Function(T) |
Converts item to display text |
itemBuilder |
Widget Function(BuildContext, T)? |
Custom item UI |
searchMatcher |
bool Function(T, String)? |
Custom search logic |
onChanged |
ValueChanged<T?> |
Selection callback |
initialValue |
T? |
Preselected value |
hintText |
String |
Placeholder text |
enabled |
bool |
Enable/disable dropdown |
maxHeight |
double |
Maximum dropdown height |
π Architecture
This widget is implemented using:
OverlayEntryCompositedTransformFollowerLayerLink- Debounced filtering
- Full lifecycle safety
- Outside tap barrier handling
- Android back button support
The architecture keeps business logic (search filtering) decoupled from UI rendering, making it extensible and testable.
π§ͺ Example
A full working example is available inside the /example folder.
To run it:
cd example
flutter run
π Upcoming Features
- π² Multi-select support
- π² Async API search support
- π² FormField integration with validation
- π² Clear/reset icon
- π² Animated open/close transitions
- π² Dialog mode (fullscreen search)
- π² Controller-based architecture
- π² Keyboard navigation support
- π² Accessibility improvements
- π² Advanced theming customization
π€ Contributing
Contributions are welcome.
If youβd like to improve this package:
- Fork the repository
- Create a feature branch
- Submit a pull request
For major changes, please open an issue first to discuss the proposal.
Development Setup
- Clone the repository
- Run
dart pub get - Make your changes
- Run
dart testto ensure tests pass - Run
dart analyzeto check for issues - Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
πββοΈ Support
- π§ Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- β Star this repo if you find it useful!
If you find this package useful, please consider giving it a β on GitHub.
Example
See the example/ directory for a complete usage example.
Changelog
See CHANGELOG.md for a detailed list of changes.
Made with β€οΈ for the Dart community
