Checkout constructor
Checkout({
- double? quantity,
- double? quantityRemains,
- double? subtotal,
- double? total,
- List<
ShippingSummary> ? regularShippingSummary, - List<
ShippingSummary> ? deliveryStoreShippingSummaryList, - List<
Pickup> ? pickup, - List<
ShippingSummary> ? instantDeliverySummary, - List<
GreetingCardSummary> ? greetingCardSummary, - List<
OrderLists> ? orderLists, - List<
OrderDiscount> ? orderDiscounts, - CouponSummary? couponSummary,
- List<
PriceDetail> ? priceDetail, - VoucherSummary? voucherSummary,
- bool? hasPickUp,
- bool? hasRegular,
- bool? hasDeliveryStore,
- bool? hasInstantDelivery,
- String? orderGroupID,
- String? expiredPaymentDate,
- double? totalDiscount,
- double? totalShippingCost,
- double? discountShippingCost,
- double? pointInquiry,
- int? totalProduct,
- OrderAddress? orderAddress,
- bool? declinedLoginBeforeCheckout,
- bool? shippingAndTaxesProcessed,
- bool? isRegularShipping,
- bool? isPickupDelivery,
- bool? isInstantDelivery,
- LoyaltiSummary? loyaltiSummary,
- BillingInformation? billingInformation,
- int? isOrderHistory,
Implementation
Checkout({
double? quantity,
double? quantityRemains,
double? subtotal,
double? total,
List<ShippingSummary>? regularShippingSummary,
List<ShippingSummary>? deliveryStoreShippingSummaryList,
List<Pickup>? pickup,
List<ShippingSummary>? instantDeliverySummary,
List<GreetingCardSummary>? greetingCardSummary,
List<OrderLists>? orderLists,
List<OrderDiscount>? orderDiscounts,
CouponSummary? couponSummary,
List<PriceDetail>? priceDetail,
VoucherSummary? voucherSummary,
bool? hasPickUp,
bool? hasRegular,
bool? hasDeliveryStore,
bool? hasInstantDelivery,
String? orderGroupID,
String? expiredPaymentDate,
double? totalDiscount,
double? totalShippingCost,
double? discountShippingCost,
double? pointInquiry,
int? totalProduct,
OrderAddress? orderAddress,
bool? declinedLoginBeforeCheckout,
bool? shippingAndTaxesProcessed,
bool? isRegularShipping,
bool? isPickupDelivery,
bool? isInstantDelivery,
LoyaltiSummary? loyaltiSummary,
BillingInformation? billingInformation,
int? isOrderHistory,
}) : quantity = quantity ?? 0,
quantityRemains = quantityRemains ?? 0,
subtotal = subtotal ?? 0,
total = total ?? 0,
regularShippingSummary = regularShippingSummary ?? [],
deliveryStoreShippingSummaryList =
deliveryStoreShippingSummaryList ?? [],
pickup = pickup ?? [],
instantDeliverySummary = instantDeliverySummary ?? [],
greetingCardSummary = greetingCardSummary ?? [],
orderLists = orderLists ?? [],
orderDiscounts = orderDiscounts ?? [],
couponSummary = couponSummary ?? CouponSummary(),
priceDetail = priceDetail ?? [],
voucherSummary = voucherSummary ?? VoucherSummary(),
orderAddress = orderAddress ?? OrderAddress(),
hasPickUp = hasPickUp ?? false,
hasRegular = hasRegular ?? false,
hasDeliveryStore = hasDeliveryStore ?? false,
hasInstantDelivery = hasInstantDelivery ?? false,
orderGroupID = orderGroupID ?? "",
expiredPaymentDate = expiredPaymentDate ?? "",
totalDiscount = totalDiscount ?? 0,
totalShippingCost = totalShippingCost ?? 0,
totalProduct = totalProduct ?? 0,
pointInquiry = pointInquiry ?? 0,
discountShippingCost = discountShippingCost ?? 0,
declinedLoginBeforeCheckout = declinedLoginBeforeCheckout ?? false,
shippingAndTaxesProcessed = shippingAndTaxesProcessed ?? false,
isRegularShipping = isRegularShipping ?? false,
isPickupDelivery = isPickupDelivery ?? false,
isInstantDelivery = isInstantDelivery ?? false,
loyaltiSummary = loyaltiSummary ?? LoyaltiSummary(),
isOrderHistory = isOrderHistory ?? 0,
billingInformation = billingInformation ?? BillingInformation() {
final parsdDate =
(this.expiredPaymentDate.isNotEmpty)
? DateTime.tryParse(this.expiredPaymentDate)?.toLocal()
: null;
expiredPaymentDT = parsdDate ?? DateTime.now();
}