FeedData.fromMap constructor

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

Implementation

factory FeedData.fromMap(Map<String, dynamic> json) => FeedData(
      id: json["id"],
      businessName: json["business_name"],
      businessAddress: json["business_address"],
      city: json["city"],
      state: json["state"],
      country: json["country"],
      latitude: json["latitude"],
      longitude: json["longitude"],
      postalCode: json["postal_code"],
      businessDescription: json["business_description"],
      businessImage: json["business_image"],
      businessType: json["business_type"] == null ? [] : List<BusinessType>.from(json["business_type"]!.map((x) => BusinessType.fromJson(x))),
      status: json["status"],
      musicTypeDisplay: json["music_type_display"],
      musicTypeList: json["music_type_list"] == null ? [] : List<MusicAffinityModel>.from(json["music_type_list"]!.map((x) => MusicAffinityModel.fromMap(x))),
      tags: json["tags"] == null ? [] : List<String>.from(json["tags"]!.map((x) => x)),
      galleryAttachmentArray: json["gallery_attachment_array"] == null ? [] : List<GalleryAttachmentArray>.from(json["gallery_attachment_array"]!.map((x) => GalleryAttachmentArray.fromJson(x))),
      userId: json["user_id"],
      businessId: json["business_id"],
      review: json["review"],
      description: json["description"],
      impressedBy: json["impressed_by"],
      createdAt: json["created_at"],
      rating: json["rating"].toString().toDouble(),
      reviewAttachment: json["review_attachment"] == null ? [] : List<GalleryAttachmentArray>.from(json["review_attachment"]!.map((x) => GalleryAttachmentArray.fromJson(x))),
      captions: json["captions"],
      attachment: json["attachment"] == null ? [] : List<GalleryAttachmentArray>.from(json["attachment"]!.map((x) => GalleryAttachmentArray.fromJson(x))),
    );