toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  var map = <String, dynamic>{
    columnId: id,
    columnCpf: cpf,
    columnDiscountValue: discountAmount,
    columnFreightValue: freightAmount,
    columnFeeValue: feeAmount,
    columnSubTotal: subTotalAmount,
    columnTotal: totalAmount,
    columnSubTotalSeparated: subTotalSeparatedAmount,
    columnTotalSeparated: totalSeparatedAmount,
    columnMaxInstallments: maxInstallments,
    columnInstallments: installments,
    columnFreight: json.encode(freight),
    columnDeliveryAddress: json.encode(deliveryAddress),
    columnIsDelivery: isDelivery ? 1 : 0,
    columnDeliveryTime: deliveryTime,
    columnLatitude: latitude,
    columnLongitude: longitude,
    columnCep: cep,
    columnCpfInvoice: cpfInvoice,
    columnCpfPickup: cpfPickUp,
    columnModality: json.encode(modality),
    columnItems: json.encode(allItems),
    columnSeller: json.encode(seller),
    columnPaymentMethod: json.encode(paymentMethod),
    columnSupportedPaymentMethods:
        json.encode(supportedPaymentTypes.map((pm) => pm.index).toList()),
    columnVoucher: json.encode(voucher),
    columnIsCvvValidated: isCvvValidated ? 1 : 0,
    columnHasFeeInstallment: hasFeeInstallment ? 1 : 0,
    columnGiftsQuantityAllowed: giftsQuantityAllowed,
    columnAvailableGiftItems: json.encode(availableGiftItems),
    columnChangesFromLastUpdate: json.encode(changesFromLastUpdate),
    columnMessages: json.encode(messages),
    columnIsPickupOnly: isPickupOnly ? 1 : 0,
    columnDealerCode: json.encode(dealerCode),
    columnShouldTransfer: shouldTransfer ? 1 : 0,
    columnBuyer: json.encode(buyer),
  };
  return map;
}