SearchItem class

Represents a single searchable item in the app.

A SearchItem encapsulates all the information needed to display and interact with a search result. Each item belongs to a specific group and can be customized with metadata for advanced use cases.

Inheritance
Annotations

Constructors

SearchItem.new({required String id, required String title, required String subtitle, required String groupId, String? description, String? imageUrl, Map<String, dynamic>? metadata, String? route, void onTap()?})
Creates a search item.

Properties

box BoxBase?
Get the box in which this object is stored. Returns null if object has not been added to a box yet.
no setterinherited
description String?
Optional detailed description of the item.
final
groupId String
Identifier of the group this item belongs to.
final
hashCode int
The hash code for this object.
no setteroverride
id String
Unique identifier for this search item.
final
imageUrl String?
Optional URL for an image to display with the item.
final
isInBox bool
Returns whether this object is currently stored in a box.
no setterinherited
key → dynamic
Get the key associated with this object. Returns null if object has not been added to a box yet.
no setterinherited
metadata Map<String, dynamic>?
Optional metadata for custom use cases.
final
onTap → void Function()?
Optional custom tap handler.
final
route String?
Optional route to navigate to when item is tapped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subtitle String
Secondary display text shown below the title.
final
title String
Primary display title of the search item.
final

Methods

copyWith({String? id, String? title, String? subtitle, String? groupId, String? description, String? imageUrl, Map<String, dynamic>? metadata, String? route, void onTap()?}) SearchItem
Creates a copy of this search item with updated fields.
delete() Future<void>
Deletes this object from the box it is stored in.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save() Future<void>
Persists this object.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override