import 'dart:convert'; PollSubmitResponseModel pollSubmitResponseModelFromJson(String str) => PollSubmitResponseModel.fromJson(json.decode(str)); String pollSubmitResponseModelToJson(PollSubmitResponseModel data) => json.encode(data.toJson()); class PollSubmitResponseModel { bool? isSuccess; int? statusCode; String? message; Data? data; dynamic errors; PollSubmitResponseModel({ this.isSuccess, this.statusCode, this.message, this.data, this.errors, }); factory PollSubmitResponseModel.fromJson(Map json) => PollSubmitResponseModel( isSuccess: json["isSuccess"], statusCode: json["statusCode"], message: json["message"], data: json["data"] == null ? null : Data.fromJson(json["data"]), errors: json["errors"], ); Map toJson() => { "isSuccess": isSuccess, "statusCode": statusCode, "message": message, "data": data?.toJson(), "errors": errors, }; } class Data { int? pollPostId; String? question; DateTime? expiryDate; List? options; int? totalPollVotes; Data({ this.pollPostId, this.question, this.expiryDate, this.options, this.totalPollVotes, }); factory Data.fromJson(Map json) => Data( pollPostId: json["pollPostID"], question: json["question"], expiryDate: json["expiryDate"] == null ? null : DateTime.parse(json["expiryDate"]), options: json["options"] == null ? [] : List.from( json["options"]!.map( (x) => PollSubmitResponseOptions.fromJson(x), ), ), totalPollVotes: json["totalPollVotes"], ); Map toJson() => { "pollPostID": pollPostId, "question": question, "expiryDate": expiryDate?.toIso8601String(), "options": options == null ? [] : List.from(options!.map((x) => x.toJson())), "totalPollVotes": totalPollVotes, }; } class PollSubmitResponseOptions { int? optionId; int? pollId; String? userId; String? optionLabel; int? totalOptionPollVotes; int? percentageOptionPollVotes; bool? hasUserVoted; PollSubmitResponseOptions({ this.optionId, this.pollId, this.userId, this.optionLabel, this.totalOptionPollVotes, this.percentageOptionPollVotes, this.hasUserVoted, }); factory PollSubmitResponseOptions.fromJson(Map json) => PollSubmitResponseOptions( optionId: json["optionID"], pollId: json["pollID"], userId: json["userID"], optionLabel: json["optionLabel"], totalOptionPollVotes: json["totalOptionPollVotes"], percentageOptionPollVotes: json["percentageOptionPollVotes"], hasUserVoted: json["hasUserVoted"], ); Map toJson() => { "optionID": optionId, "pollID": pollId, "userID": userId, "optionLabel": optionLabel, "totalOptionPollVotes": totalOptionPollVotes, "percentageOptionPollVotes": percentageOptionPollVotes, "hasUserVoted": hasUserVoted, }; }