add auth, format

This commit is contained in:
Phuoc Nguyen
2025-11-07 11:52:06 +07:00
parent 24a8508fce
commit 3803bd26e0
173 changed files with 8505 additions and 7116 deletions

View File

@@ -12,18 +12,12 @@ class CartItemData {
final Product product;
final double quantity;
const CartItemData({
required this.product,
required this.quantity,
});
const CartItemData({required this.product, required this.quantity});
/// Calculate line total
double get lineTotal => product.basePrice * quantity;
CartItemData copyWith({
Product? product,
double? quantity,
}) {
CartItemData copyWith({Product? product, double? quantity}) {
return CartItemData(
product: product ?? this.product,
quantity: quantity ?? this.quantity,
@@ -101,7 +95,8 @@ class CartState {
discountCode: discountCode ?? this.discountCode,
discountCodeApplied: discountCodeApplied ?? this.discountCodeApplied,
memberTier: memberTier ?? this.memberTier,
memberDiscountPercent: memberDiscountPercent ?? this.memberDiscountPercent,
memberDiscountPercent:
memberDiscountPercent ?? this.memberDiscountPercent,
subtotal: subtotal ?? this.subtotal,
memberDiscount: memberDiscount ?? this.memberDiscount,
shippingFee: shippingFee ?? this.shippingFee,