InvoiceLine.fromMap constructor
Creates an InvoiceLine instance from a Map.
Implementation
factory InvoiceLine.fromMap(Map<String, dynamic> map) {
return InvoiceLine(
id: map['id'] ?? '',
quantity: double.tryParse((map['quantity'] ?? '0').toString()) ?? 0,
unitCode: map['unitCode'] ?? '',
lineExtensionAmount: map['lineExtensionAmount'] ?? '',
itemName: map['itemName'] ?? '',
taxPercent: map['taxPercent'] ?? '',
discounts:
(map['discounts'] ?? [])
.map((discount) => Discount.fromMap(discount))
.toList(),
);
}