LiveSearch<T> constructor

const LiveSearch<T>({
  1. Key? key,
  2. required Future<List<T>> onSearch(
    1. String query
    ),
  3. required Widget itemBuilder(
    1. BuildContext context,
    2. T item
    ),
  4. String hint = 'Search…',
  5. String? label,
  6. Duration debounceDelay = const Duration(milliseconds: 400),
  7. int minChars = 1,
  8. int maxResults = 8,
  9. void onSelected(
    1. T item
    )?,
  10. String emptyText = 'No results found',
  11. IconData icon = Icons.search_rounded,
})

Implementation

const LiveSearch({
  super.key,
  required this.onSearch,
  required this.itemBuilder,
  this.hint = 'Search…',
  this.label,
  this.debounceDelay = const Duration(milliseconds: 400),
  this.minChars = 1,
  this.maxResults = 8,
  this.onSelected,
  this.emptyText = 'No results found',
  this.icon = Icons.search_rounded,
});