class LatestpostModel { String? status; int? statusCode; String? message; List? data; LatestpostModel({this.status, this.statusCode, this.message, this.data}); LatestpostModel.fromJson(Map json) { status = json['status']; statusCode = json['status_code']; message = json['message']; if (json['data'] != null) { data = []; json['data'].forEach((v) { data!.add(Data.fromJson(v)); }); } } Map toJson() { final Map data = {}; data['status'] = status; data['status_code'] = statusCode; data['message'] = message; if (this.data != null) { data['data'] = this.data!.map((v) => v.toJson()).toList(); } return data; } } class Data { int? id; int? likecount; List? tagsXid; bool? isILiked; int? totalComment; int? totalSave; int? iamPrincipalXid; int? postIn; String? caption; String? image; String? manageTagsXids; String? postAs; String? ctaTitle; String? ctaLink; String? createdAt; List? tagNames; String? likeIcon; IamPrincipal? iamPrincipal; Community? community; Data( {this.id, this.likecount, this.tagsXid, this.isILiked, this.totalComment, this.totalSave, this.iamPrincipalXid, this.postIn, this.caption, this.image, this.manageTagsXids, this.postAs, this.ctaTitle, this.ctaLink, this.createdAt, this.tagNames, this.likeIcon, this.iamPrincipal, this.community}); Data.fromJson(Map json) { id = json['id']; likecount = json['likecount']; tagsXid = json['tags_xid'].cast(); isILiked = json['is_i_liked']; totalComment = json['total_comment']; totalSave = json['total_save']; iamPrincipalXid = json['iam_principal_xid']; postIn = json['post_in']; caption = json['caption']; image = json['image']; manageTagsXids = json['manage_tags_xids']; postAs = json['post_as']; ctaTitle = json['cta_title']; ctaLink = json['cta_link']; createdAt = json['created_at']; tagNames = json['tag_names'].cast(); likeIcon = json['likeIcon']; iamPrincipal = json['iam_principal'] != null ? IamPrincipal.fromJson(json['iam_principal']) : null; community = json['community'] != null ? Community.fromJson(json['community']) : null; } Map toJson() { final Map data = {}; data['id'] = id; data['likecount'] = likecount; data['tags_xid'] = tagsXid; data['is_i_liked'] = isILiked; data['total_comment'] = totalComment; data['total_save'] = totalSave; data['iam_principal_xid'] = iamPrincipalXid; data['post_in'] = postIn; data['caption'] = caption; data['image'] = image; data['manage_tags_xids'] = manageTagsXids; data['post_as'] = postAs; data['cta_title'] = ctaTitle; data['cta_link'] = ctaLink; data['created_at'] = createdAt; data['tag_names'] = tagNames; data['likeIcon'] = likeIcon; if (iamPrincipal != null) { data['iam_principal'] = iamPrincipal!.toJson(); } if (community != null) { data['community'] = community!.toJson(); } return data; } } class IamPrincipal { int? id; int? principalTypeXid; String? userName; String? fullName; String? profilePhoto; IamPrincipal( {this.id, this.principalTypeXid, this.userName, this.fullName, this.profilePhoto}); IamPrincipal.fromJson(Map json) { id = json['id']; principalTypeXid = json['principal_type_xid']; userName = json['user_name']; fullName = json['full_name']; profilePhoto = json['profile_photo']; } Map toJson() { final Map data = {}; data['id'] = id; data['principal_type_xid'] = principalTypeXid; data['user_name'] = userName; data['full_name'] = fullName; data['profile_photo'] = profilePhoto; return data; } } class Community { int? id; String? communityProfilePhoto; String? communityName; Community({this.id, this.communityProfilePhoto, this.communityName}); Community.fromJson(Map json) { id = json['id']; communityProfilePhoto = json['community_profile_photo']; communityName = json['community_name']; } Map toJson() { final Map data = {}; data['id'] = id; data['community_profile_photo'] = communityProfilePhoto; data['community_name'] = communityName; return data; } }