copyWith method

AppItem copyWith({
  1. String? title,
  2. String? description,
  3. String? imageUrl,
  4. String? category,
  5. bool? isFavorite,
})

Implementation

AppItem copyWith({
  String? title,
  String? description,
  String? imageUrl,
  String? category,
  bool? isFavorite,
}) =>
    AppItem(
      id: id,
      title: title ?? this.title,
      description: description ?? this.description,
      imageUrl: imageUrl ?? this.imageUrl,
      category: category ?? this.category,
      isFavorite: isFavorite ?? this.isFavorite,
      createdAt: createdAt,
      updatedAt: DateTime.now(),
    );