122 lines
2.7 KiB
Dart
122 lines
2.7 KiB
Dart
// Models
|
|
class ProductCategory {
|
|
final String id;
|
|
final String name;
|
|
final String icon;
|
|
final int productCount;
|
|
|
|
ProductCategory({
|
|
required this.id,
|
|
required this.name,
|
|
required this.icon,
|
|
required this.productCount,
|
|
});
|
|
}
|
|
|
|
class Product {
|
|
final String id;
|
|
final String name;
|
|
final String description;
|
|
final int price;
|
|
final String categoryId;
|
|
final String imageUrl;
|
|
final bool isAvailable;
|
|
final double rating;
|
|
final int soldCount;
|
|
|
|
Product({
|
|
required this.id,
|
|
required this.name,
|
|
required this.description,
|
|
required this.price,
|
|
required this.categoryId,
|
|
required this.imageUrl,
|
|
required this.isAvailable,
|
|
required this.rating,
|
|
required this.soldCount,
|
|
});
|
|
}
|
|
|
|
// Sample data
|
|
final List<ProductCategory> categories = [
|
|
ProductCategory(id: "1", name: "Makanan", icon: "🍽️", productCount: 8),
|
|
ProductCategory(id: "2", name: "Minuman", icon: "🥤", productCount: 6),
|
|
ProductCategory(id: "3", name: "Snack", icon: "🍿", productCount: 5),
|
|
ProductCategory(id: "4", name: "Es Krim", icon: "🍦", productCount: 4),
|
|
ProductCategory(id: "5", name: "Paket", icon: "📦", productCount: 3),
|
|
];
|
|
|
|
final List<Product> products = [
|
|
// Makanan
|
|
Product(
|
|
id: "1",
|
|
name: "Nasi Gudeg",
|
|
description: "Gudeg khas Yogyakarta dengan ayam dan telur",
|
|
price: 25000,
|
|
categoryId: "1",
|
|
imageUrl: "https://via.placeholder.com/150",
|
|
isAvailable: true,
|
|
rating: 4.5,
|
|
soldCount: 50,
|
|
),
|
|
Product(
|
|
id: "2",
|
|
name: "Soto Ayam",
|
|
description: "Soto ayam kuning dengan nasi dan kerupuk",
|
|
price: 18000,
|
|
categoryId: "1",
|
|
imageUrl: "https://via.placeholder.com/150",
|
|
isAvailable: true,
|
|
rating: 4.3,
|
|
soldCount: 75,
|
|
),
|
|
Product(
|
|
id: "3",
|
|
name: "Gado-gado",
|
|
description: "Gado-gado segar dengan bumbu kacang",
|
|
price: 15000,
|
|
categoryId: "1",
|
|
imageUrl: "https://via.placeholder.com/150",
|
|
isAvailable: false,
|
|
rating: 4.2,
|
|
soldCount: 30,
|
|
),
|
|
|
|
// Minuman
|
|
Product(
|
|
id: "4",
|
|
name: "Es Teh Manis",
|
|
description: "Es teh manis segar",
|
|
price: 5000,
|
|
categoryId: "2",
|
|
imageUrl: "https://via.placeholder.com/150",
|
|
isAvailable: true,
|
|
rating: 4.0,
|
|
soldCount: 120,
|
|
),
|
|
Product(
|
|
id: "5",
|
|
name: "Jus Jeruk",
|
|
description: "Jus jeruk segar tanpa gula tambahan",
|
|
price: 12000,
|
|
categoryId: "2",
|
|
imageUrl: "https://via.placeholder.com/150",
|
|
isAvailable: true,
|
|
rating: 4.4,
|
|
soldCount: 45,
|
|
),
|
|
|
|
// Snack
|
|
Product(
|
|
id: "6",
|
|
name: "Keripik Pisang",
|
|
description: "Keripik pisang renyah dan manis",
|
|
price: 8000,
|
|
categoryId: "3",
|
|
imageUrl: "https://via.placeholder.com/150",
|
|
isAvailable: true,
|
|
rating: 4.1,
|
|
soldCount: 25,
|
|
),
|
|
];
|