onSearch property

Future<List<T>> Function({required int pageIndex, required int pageSize, required String searchQuery}) onSearch
final

The search function to perform when the user types into the search bar. Returns a list of items to display in the search results list.

Implementation

final Future<List<T>> Function({
  /// The current search query matching what the user has typed in the search bar.
  required String searchQuery,

  /// The page index of search results to load for the search query. Starts at 0 and increments as the user
  /// scrolls down the list of search results triggering a new page load.
  required int pageIndex,

  /// The number of items to return per page. If fewer than `pageSize` items are returned, the search bar knows
  /// that no further search results can be returned for the current search query and it will not load any more as the user
  /// scrolls down the list of results.
  required int pageSize,
}) onSearch;