Update project
This commit is contained in:
24
lib/modules/search/grocery_item.dart
Normal file
24
lib/modules/search/grocery_item.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
class GroceryItem {
|
||||
final int id;
|
||||
final String name;
|
||||
final String quantity;
|
||||
final String emoji;
|
||||
bool inCart;
|
||||
|
||||
GroceryItem({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.quantity,
|
||||
required this.emoji,
|
||||
this.inCart = false,
|
||||
});
|
||||
|
||||
factory GroceryItem.fromJson(int id, Map<String, dynamic> json) {
|
||||
return GroceryItem(
|
||||
id: id,
|
||||
name: json['name'] ?? '',
|
||||
quantity: json['quantity'] ?? '',
|
||||
emoji: json['emoji'] ?? '🛒',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user