copyWith method

SearchItem copyWith({
  1. String? id,
  2. String? title,
  3. String? subtitle,
  4. String? groupId,
  5. String? description,
  6. String? imageUrl,
  7. Map<String, dynamic>? metadata,
  8. String? route,
  9. void onTap()?,
})

Creates a copy of this search item with updated fields.

Implementation

SearchItem copyWith({
  String? id,
  String? title,
  String? subtitle,
  String? groupId,
  String? description,
  String? imageUrl,
  Map<String, dynamic>? metadata,
  String? route,
  void Function()? onTap,
}) {
  return SearchItem(
    id: id ?? this.id,
    title: title ?? this.title,
    subtitle: subtitle ?? this.subtitle,
    groupId: groupId ?? this.groupId,
    description: description ?? this.description,
    imageUrl: imageUrl ?? this.imageUrl,
    metadata: metadata ?? this.metadata,
    route: route ?? this.route,
    onTap: onTap ?? this.onTap,
  );
}