Fitur foto produk: image_picker + upload Supabase Storage (bucket product-images), thumbnail di daftar produk
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user