StoreModel.fromJson constructor

StoreModel.fromJson(
  1. dynamic json
)

Implementation

factory StoreModel.fromJson(dynamic json) {
  return StoreModel(
    id: json["id"],
    name: json["name"],
    description: json["description"],
    thumbnail: json["thumbnail"],
    apartmentId: json["apartmentId"],
    phone: json["phoneNumber"],
    activated: json["activated"],
    throttle: json["throttle"],
    updatedAt: DateTime.parse(json["updatedAt"]).toLocal(),
    createdAt: DateTime.parse(json["createdAt"]).toLocal(),
    availableTakeouts: (json["availableTakeouts"] as Iterable)
        .map(AvailableTakeoutModel.fromJson),
    items: (json["items"] as Iterable).map(ItemModel.fromJson),
  );
}