ListingListData.fromJson constructor

ListingListData.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ListingListData.fromJson(Map<String, dynamic> json) =>
    ListingListData(
        id: json["id"],
        name: json["name"],
        hideLocation: json["hide_location"],
        businessImage: json["business_image"],
        address: json["address"],
        city: json["city"],
        state: json["state"],
        country: json["country"],
        latitude: json["latitude"],
        longitude: json["longitude"],
        postalCode: json["postal_code"],
        description: json["description"],
        priceRange: json["price_range"],
        features: json["features"] == null
            ? []
            : List<PlaceDescribeModel>.from(
            json["features"]!.map((x) => PlaceDescribeModel.fromMap(x))),
        contactNumber: json["contact_number"],
        email: json["email"],
        webpageUrl: json["webpage_url"],
        socialMediaUrl: json["social_media_url"] == null
            ? null
            : SocialMediaUrl.fromJson(json["social_media_url"]),
        userType: json["user_type"],
        status: json["status"],
        distance: json["distance"],
        isOpen: json["is_open"],
        isFavourite: json['is_favourite'],
        isFeatured: json["is_featured"],
        discount: json["discount"],
        totalRating: json["total_rating"],
        avgRating: json["avg_rating"],
        rating: json["rating"] == null
            ? []
            : List<Rating>.from(
            json["rating"]!.map((x) => Rating.fromJson(x))),
        businessTypeList: json["business_type"] == null
            ? []
            : List<BusinessType>.from(
            json["business_type"]!.map((x) => BusinessType.fromJson(x))),
        musicTypeDisplay: json["music_type_display"],
        musicTypeList: json["music_type_list"] == null
            ? []
            : List<MusicAffinityModel>.from(json["music_type_list"]!
            .map((x) => MusicAffinityModel.fromMap(x))),
        workingHour: json['working_hour'] != null
            ? WorkingHourModel.fromMap(json['working_hour'])
            : null,
        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))),
        updatedAt: json['updated_at'],
        createdAt: json['created_at'],
        totalCount: json['total_likes'],
        canClaimed: json['can_claimed']);