toMap method

  1. @override
Map<String, dynamic> toMap({
  1. required bool isProto,
})
override

pass isProto whenever pushing/pulling to/from the server

Implementation

@override
Map<String, dynamic> toMap({required bool isProto}) {
  return {
    'id': id,
    'items': items.map((x) => x.toMap(isProto: isProto)).toList(),
    'taxe': taxe.toMap(),
    'promo': promo,
    'discountAmount': discountAmount,
    'comment': comment,
    'received': received,
    'date': date.toIso8601String(),
    'creationDate': creationDate.toIso8601String(),
    'paymentType': paymentType.toString(),
    'ticketType': ticketType.toString(),
    'contactId': contactId,
    'contactFirstName': contactFirstName,
    'contactLastName': contactLastName,
    'contactPhone': contactPhone,
    'contactMail': contactMail,
    'status': status,
    'statusUpdateDate': statusUpdateDate?.toIso8601String(),
  };
}