PrismSearch<T> constructor

const PrismSearch<T>({
  1. Key? key,
  2. List<T>? items,
  3. Future<List<T>> onSearch(
    1. String query
    )?,
  4. required String itemLabel(
    1. T item
    ),
  5. ValueChanged<T>? onSelected,
  6. String hintText = 'Search…',
  7. Duration? debounce,
  8. int maxSuggestions = 8,
  9. PrismSearchHighlightStyle? highlightStyle,
  10. InputDecoration? fieldDecoration,
  11. bool debugCompactOverride = false,
})

Creates an adaptive search.

Implementation

const PrismSearch({
  super.key,
  this.items,
  this.onSearch,
  required this.itemLabel,
  this.onSelected,
  this.hintText = 'Search…',
  this.debounce,
  this.maxSuggestions = 8,
  this.highlightStyle,
  this.fieldDecoration,
  this.debugCompactOverride = false,
}) : assert(
       (items != null) != (onSearch != null),
       'Provide exactly one of items or onSearch.',
     );