Checkout constructor

Checkout({
  1. double? quantity,
  2. double? quantityRemains,
  3. double? subtotal,
  4. double? total,
  5. List<ShippingSummary>? regularShippingSummary,
  6. List<ShippingSummary>? deliveryStoreShippingSummaryList,
  7. List<Pickup>? pickup,
  8. List<ShippingSummary>? instantDeliverySummary,
  9. List<GreetingCardSummary>? greetingCardSummary,
  10. List<OrderLists>? orderLists,
  11. List<OrderDiscount>? orderDiscounts,
  12. CouponSummary? couponSummary,
  13. List<PriceDetail>? priceDetail,
  14. VoucherSummary? voucherSummary,
  15. bool? hasPickUp,
  16. bool? hasRegular,
  17. bool? hasDeliveryStore,
  18. bool? hasInstantDelivery,
  19. String? orderGroupID,
  20. String? expiredPaymentDate,
  21. double? totalDiscount,
  22. double? totalShippingCost,
  23. double? discountShippingCost,
  24. double? pointInquiry,
  25. int? totalProduct,
  26. OrderAddress? orderAddress,
  27. bool? declinedLoginBeforeCheckout,
  28. bool? shippingAndTaxesProcessed,
  29. bool? isRegularShipping,
  30. bool? isPickupDelivery,
  31. bool? isInstantDelivery,
  32. LoyaltiSummary? loyaltiSummary,
  33. BillingInformation? billingInformation,
  34. 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();
}