Fitur foto produk: image_picker + upload Supabase Storage (bucket product-images), thumbnail di daftar produk

This commit is contained in:
onie
2026-10-17 23:47:13 +07:00
parent 0121eca8bb
commit 60abcc1f5c
11 changed files with 311 additions and 9 deletions

View File

@@ -9,6 +9,7 @@ class Product {
final int stock;
final int minStock;
final double hargaPokok;
final String? imagePath; // path file di Supabase Storage (bucket product-images)
Product({
required this.id,
@@ -19,6 +20,7 @@ class Product {
required this.stock,
this.minStock = 5,
this.hargaPokok = 0,
this.imagePath,
});
factory Product.manual(String name, double price) {
@@ -48,6 +50,7 @@ class Product {
hargaPokok: json['harga_pokok'] != null
? (json['harga_pokok'] as num).toDouble()
: 0,
imagePath: json['image_path'] as String?,
);
}
@@ -60,5 +63,6 @@ class Product {
'stock': stock,
'min_stock': minStock,
'harga_pokok': hargaPokok,
'image_path': imagePath,
};
}