QuickbooksItemBasedExpenseLine.fromMap constructor

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

Converts from a map value

Implementation

factory QuickbooksItemBasedExpenseLine.fromMap(Map<String, dynamic> map) {
  return QuickbooksItemBasedExpenseLine(
    id: map['Id'],
    lineNum: int.tryParse(map['LineNum'].toString()) ?? 0,
    description: map['Description'],
    amount: double.tryParse(map['Amount'].toString()) ?? 0,
    type: QuickbooksLineDetailType.itemBasedExpenseLineDetail,
    itemBasedExpenseLineDetail: map['ItemBasedExpenseLineDetail'] != null
        ? QuickbooksItemBasedExpenseLineDetails.fromMap(
            map['ItemBasedExpenseLineDetail'] as Map<String, dynamic>)
        : null,
    linkedTxn: map['LinkedTxn'] != null
        ? List<QuickbooksLinkedTxn>.from(
            (map['LinkedTxn'] as List<int>).map<QuickbooksLinkedTxn?>(
              (x) => QuickbooksLinkedTxn.fromMap(x as Map<String, dynamic>),
            ),
          )
        : null,
  );
}