toJson method Null safety

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      "address": address == null ? null : address!.toJson(),
      "store": store == null ? null : store!.toJson(),
      "orderItems": orderItems == null
          ? null
          : List<dynamic>.from(orderItems!.map((x) => x.toJson())),
      "currency": currency,
      "paymentType": paymentType,
      "canCancel": canCancel,
      "date": date,
      "id": id,
      "orderNo": orderNo,
      "productsCount": productsCount,
      "total": total,
      "orderStatus": orderStatus,
    };