SearchResult class
Represents the complete result set from a search operation.
A SearchResult contains all matching items organized by their groups, along with metadata about the search operation itself.
Constructors
-
SearchResult.new({required String query, required List<
SearchItem> items, int? totalCount, int? executionTimeMs, bool hasMore = false, String? nextPage}) -
Creates a search result.
const
- SearchResult.empty(String query)
-
Creates an empty search result.
factory
Properties
- executionTimeMs → int?
-
Time taken to execute the search in milliseconds.
final
-
groupedItems
→ Map<
String, List< SearchItem> > -
Returns items grouped by their groupId.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasMore → bool
-
Whether more results are available beyond this page.
final
- isEmpty → bool
-
Returns true if this result set is empty.
no setter
- isNotEmpty → bool
-
Returns true if this result set has items.
no setter
-
items
→ List<
SearchItem> -
All items matching the search query.
final
- nextPage → String?
-
Token or page number for fetching the next page of results.
final
- query → String
-
The search query that produced these results.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalCount → int?
-
Total number of results available (may be more than items.length).
final
Methods
-
copyWith(
{String? query, List< SearchItem> ? items, int? totalCount, int? executionTimeMs, bool? hasMore, String? nextPage}) → SearchResult - Creates a copy of this result with updated fields.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited