async_searchable_dropdown 0.0.6+1 async_searchable_dropdown: ^0.0.6+1 copied to clipboard
This Flutter package helps create a dropdown which it's items are fetched upon search.
About #
This Flutter package helps create a dropdown which it's items are fetched upon search.
Features #
- Has a good degree of customization .
- Fetch items on the start, and when changing search text.
- Search debounce is built in.
Demo #
Getting started #
To use this package, add async_searchable_dropdown as a dependency in your [pubspec.yaml] file. And add this import to your file.
import 'package:async_searchable_dropdown/async_searchable_dropdown.dart';
Usage #
SearchableDropdown<String>(
inputDecoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'List of items',
prefixIcon: Icon(Icons.search),
),
margin: const EdgeInsets.all(15),
remoteItems: (search){
/// Your async function call must return list of string [List<String>]
},
itemLabelFormatter: (value) =>
"my custom value formatter for: $value",
onChanged: (int? value) {
debugPrint('$value');
},
)