DefaultLineDto.fromJson constructor

DefaultLineDto.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory DefaultLineDto.fromJson(Map<String, dynamic> json) {
  return DefaultLineDto(
    vatAmounts: (json["vatAmounts"] as List<dynamic>?)
        ?.map((e) => LineVatAmountDto.fromJson(e as Map<String, dynamic>))
        .toList(),
    fullAmountInclVat: double.parse(json["fullAmountInclVat"].toString()),
    item: ItemDto.fromJson(json["item"] as Map<String, dynamic>),
    deliveryPeriodStart: json["deliveryPeriodStart"] as String?,
    deliveryPeriodEnd: json["deliveryPeriodEnd"] as String?,
    fullAmountInclVatBeforeDiscounts:
        double.tryParse(json["fullAmountInclVatBeforeDiscounts"].toString()),
    discounts: (json["discounts"] as List<dynamic>?)
        ?.map(
            (e) => DefaultLineDiscountDto.fromJson(e as Map<String, dynamic>))
        .toList(),
    categoryId: json["categoryId"] as String?,
    returnBarcodeReference: json["returnBarcodeReference"] as String?,
    equivalentValue: json["equivalentValue"] as String?,
    isReturn: json["isReturn"] as bool?,
    type: decodeLineType(LineTypeEnumMap, json["type"] as String),
    id: json["id"] as String,
    text: json["text"] as String?,
    additionalText: json["additionalText"] as String?,
    sequenceNumber: json["sequenceNumber"] as int,
  );
}