Destination.fromMap constructor

Destination.fromMap(
  1. Map<String, dynamic> json
)

Implementation

factory Destination.fromMap(Map<String, dynamic> json) => Destination(
      location: json["location"] == null
          ? null
          : Location.fromMap(json["location"]),
      order: json["order"],
      address: json["address"],
      entrance: json["entrance"],
      doorPhone: json["door_phone"],
      floor: json["floor"],
      apartment: json["apartment"],
      comment: json["comment"],
      arrivedAt: json["arrived_at"] == null
          ? null
          : DateTime.tryParse(json["arrived_at"])?.toLocal(),
      handedOverAt: json["handed_over_at"] == null
          ? null
          : DateTime.tryParse(json["handed_over_at"])?.toLocal(),
      eta: json["eta"] == null
          ? null
          : DateTime.tryParse(json["eta"])?.toLocal(),
      skippedAt: json["skipped_at"] == null
          ? null
          : DateTime.tryParse(json["skipped_at"])?.toLocal(),
      products: json["products"] == null
          ? null
          : Products.fromMap(json["products"]),
      client: json["client"] == null ? null : Client.fromMap(json["client"]),
    );