decode static method

PrinterRequest decode(
  1. Object message
)

Implementation

static PrinterRequest decode(Object message) {
  final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>;
  return PrinterRequest(
    transactionID: pigeonMap['transactionID'] as String?,
    id: pigeonMap['id'] as String?,
    customerId: pigeonMap['customerId'] as String?,
    customerName: pigeonMap['customerName'] as String?,
    customerEmail: pigeonMap['customerEmail'] as String?,
    customerMobile: pigeonMap['customerMobile'] as String?,
    displayCustomer: pigeonMap['displayCustomer'] as bool?,
    displaySeller: pigeonMap['displaySeller'] as bool?,
    ticketId: pigeonMap['ticketId'] as String?,
    ticketName: pigeonMap['ticketName'] as String?,
    sellerId: pigeonMap['sellerId'] as String?,
    sellerName: pigeonMap['sellerName'] as String?,
    currencyCode: pigeonMap['currencyCode'] as String?,
    countryCode: pigeonMap['countryCode'] as String?,
    deviceId: pigeonMap['deviceId'] as String?,
    taxInclusive: pigeonMap['taxInclusive'] as bool?,
    totalValue: pigeonMap['totalValue'] as double?,
    totalCost: pigeonMap['totalCost'] as double?,
    totalMarkup: pigeonMap['totalMarkup'] as double?,
    totalDiscount: pigeonMap['totalDiscount'] as double?,
    totalTax: pigeonMap['totalTax'] as double?,
    amountTendered: pigeonMap['amountTendered'] as double?,
    amountChange: pigeonMap['amountChange'] as double?,
    transactionDate: pigeonMap['transactionDate'] as String?,
    transactionTime: pigeonMap['transactionTime'] as String?,
    businessName: pigeonMap['businessName'] as String?,
    address: pigeonMap['address'] != null
        ? PrintAddress.decode(pigeonMap['address']!)
        : null,
    vAT: pigeonMap['vAT'] as String?,
    tell: pigeonMap['tell'] as String?,
    checkoutMessage: pigeonMap['checkoutMessage'] as String?,
    taxCode: pigeonMap['taxCode'] as String?,
    taxValue: pigeonMap['taxValue'] as double?,
    items: (pigeonMap['items'] as List<Object?>?)?.cast<Inventory?>(),
    header: pigeonMap['header'] as String?,
    footer: pigeonMap['footer'] as String?,
    instagram: pigeonMap['instagram'] as String?,
    website: pigeonMap['website'] as String?,
    whatsapp: pigeonMap['whatsapp'] as String?,
    image: pigeonMap['image'] as Uint8List?,
    cashbackAmount: pigeonMap['cashbackAmount'] as double?,
    tipAmount: pigeonMap['tipAmount'] as double?,
    totalDue: pigeonMap['totalDue'] as double?,
    withdrawalAmount: pigeonMap['withdrawalAmount'] as double?,
    paymentType: pigeonMap['paymentType'] as String?,
  );
}