InMemorySearchProvider class
A simple in-memory search provider for testing and examples.
This implementation performs case-insensitive substring matching on item titles and subtitles with cached normalization for 30% better performance. It's useful for quick prototyping but should be replaced with a more robust solution in production (e.g., sqlite_search for >10K items).
- Inheritance
-
- Object
- SearchProvider
- InMemorySearchProvider
Constructors
-
InMemorySearchProvider.new(List<
SearchItem> items) - Creates an in-memory search provider.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearCache(
) → Future< void> -
Clears any cached search data.
inherited
-
getSuggestions(
String query) → Future< List< SearchItem> > -
Provides search suggestions based on partial input.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onItemSelected(
SearchItem item) → Future< void> -
Notifies the provider that a search item was selected.
inherited
-
search(
String query, {int limit = 20, int offset = 0, CancellationToken? cancellationToken}) → Future< SearchResult> -
Performs a search operation.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited