fromJson static method

ReferendumInfo fromJson(
  1. Map<String, dynamic> json
)

Implementation

static ReferendumInfo fromJson(Map<String, dynamic> json) {
  ReferendumInfo info = ReferendumInfo();
  info.index = BigInt.parse(json['index'].toString());
  info.imageHash = json['imageHash'];
  info.status = json['status'];
  info.image = json['image'];
  info.detail = json['detail'];

  info.isPassing = json['isPassing'];
  info.voteCountAye = json['voteCountAye'];
  info.voteCountNay = json['voteCountNay'];
  info.votedAye = json['votedAye'].toString();
  info.votedNay = json['votedNay'].toString();
  info.votedTotal = json['votedTotal'].toString();
  info.changeAye = info.detail!['changes']['changeAye'].toString();
  info.changeNay = info.detail!['changes']['changeNay'].toString();

  info.userVoted = info.detail!['userVoted'];
  return info;
}