Initialize project and update portal port configuration
Set default portal port to 8081, fix Dart build issue in cart screen, and update setup documentation. Co-Authored-By: Oz <oz-agent@warp.dev>
This commit is contained in:
10
lib/models/cart_item.dart
Normal file
10
lib/models/cart_item.dart
Normal file
@ -0,0 +1,10 @@
|
||||
import 'product.dart';
|
||||
|
||||
class CartItem {
|
||||
final Product product;
|
||||
int quantity;
|
||||
|
||||
CartItem({required this.product, this.quantity = 1});
|
||||
|
||||
double get lineTotal => product.price * quantity;
|
||||
}
|
||||
15
lib/models/product.dart
Normal file
15
lib/models/product.dart
Normal file
@ -0,0 +1,15 @@
|
||||
class Product {
|
||||
final String id;
|
||||
final String name;
|
||||
final String description;
|
||||
final String imageUrl;
|
||||
final double price;
|
||||
|
||||
const Product({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.description,
|
||||
required this.imageUrl,
|
||||
required this.price,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user