class CampAd { String? postId; String? campaignId; bool? approved; CampAd({ this.approved, this.campaignId, this.postId, }); factory CampAd.fromJSON(Map json) { return CampAd( postId: json["postID"], campaignId: json["campaignId"], approved: json["approved"] != null ? json["approved"] : false, ); } Map toJson() { final Map data = Map(); data['postId'] = this.postId; data['approved'] = this.approved; data['campaignId'] = this.campaignId; return data; } @override String toString() { return '{"postId": "$postId","approved":"$approved","campaignId" :"$campaignId"}'; } }