fromJson static method
Implementation
static ReferendumItem fromJson(Map<String, dynamic> json) {
ReferendumItem info = ReferendumItem(
key: json['key'],
trackId: json['trackId'],
callMethod: json['expanded']['callMethod'],
callDocs: json['expanded']['callDocs'],
proposalHash: json['expanded']['proposalHash'],
submissionDeposit:
json['expanded']['submissionDeposit']['amount'].toString(),
submissionDepositAddress: json['expanded']['submissionDeposit']['who'],
decisionDeposit:
((json['expanded']['decisionDeposit'] ?? {})['amount'] ?? 0)
.toString(),
decisionDepositAddress:
(json['expanded']['decisionDeposit'] ?? {})['who'],
confirmEnd: json['expanded']['confirmEnd'],
decideEnd: json['expanded']['decideEnd'],
prepareEnd: json['expanded']['prepareEnd'],
periodEnd: json['expanded']['periodEnd'],
ayes: json['expanded']['tally']['ayes'].toString(),
nays: json['expanded']['tally']['nays'].toString(),
support: json['expanded']['tally']['support'].toString(),
tallyTotal: json['expanded']['tallyTotal'].toString(),
);
return info;
}