toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var hasVoted = this.hasVoted;
  var self = this.self;
  var voters = this.voters;
  var votes = this.votes;

  final json = <String, Object?>{};
  json[r'hasVoted'] = hasVoted;
  if (self != null) {
    json[r'self'] = self;
  }
  json[r'voters'] = voters.map((i) => i.toJson()).toList();
  if (votes != null) {
    json[r'votes'] = votes;
  }
  return json;
}