QuickbooksItemBasedExpenseLineDetails.fromMap constructor

QuickbooksItemBasedExpenseLineDetails.fromMap(
  1. Map<String, dynamic> map
)

Converts from a map value

Implementation

factory QuickbooksItemBasedExpenseLineDetails.fromMap(
    Map<String, dynamic> map) {
  return QuickbooksItemBasedExpenseLineDetails(
      taxInclusiveAmt: double.tryParse(map['TaxInclusiveAmt'].toString()),
      itemRef: map['ItemRef'] != null
          ? QuickbooksReferenceType.fromMap(
              map['ItemRef'] as Map<String, dynamic>)
          : null,
      customerRef: map['CustomerRef'] != null
          ? QuickbooksReferenceType.fromMap(
              map['CustomerRef'] as Map<String, dynamic>)
          : null,
      priceLevelRef: map['PriceLevelRef'] != null
          ? QuickbooksReferenceType.fromMap(
              map['PriceLevelRef'] as Map<String, dynamic>)
          : null,
      classRef: map['ClassRef'] != null
          ? QuickbooksReferenceType.fromMap(
              map['ClassRef'] as Map<String, dynamic>)
          : null,
      taxCodeRef: map['TaxCodeRef'] != null
          ? QuickbooksReferenceType.fromMap(
              map['TaxCodeRef'] as Map<String, dynamic>)
          : null,
      markupInfo: map['MarkupInfo'] != null
          ? QuickbooksMarkupInfo.fromMap(
              map['MarkupInfo'] as Map<String, dynamic>)
          : null,
      billableStatus: map['BillableStatus'],
      qty: double.tryParse(map['Qty'].toString()),
      unitPrice: double.tryParse(map['UnitPrice'].toString()));
}