toJson method
Implementation
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.answerText != null) {
json[r'answer_text'] = this.answerText;
} else {
json[r'answer_text'] = null;
}
json[r'created_at'] = this.createdAt.toUtc().toIso8601String();
json[r'id'] = this.id;
if (this.isAnswer != null) {
json[r'is_answer'] = this.isAnswer;
} else {
json[r'is_answer'] = null;
}
json[r'option_id'] = this.optionId;
json[r'poll_id'] = this.pollId;
json[r'updated_at'] = this.updatedAt.toUtc().toIso8601String();
if (this.user != null) {
json[r'user'] = this.user;
} else {
json[r'user'] = null;
}
if (this.userId != null) {
json[r'user_id'] = this.userId;
} else {
json[r'user_id'] = null;
}
return json;
}