| 1 | class N2Node { |
| 2 | N2Node({ |
| 3 | this.weight, |
| 4 | this.uptime, |
| 5 | this.score, |
| 6 | this.account, |
| 7 | this.alias, |
| 8 | }); |
| 9 | |
| 10 | String? uptime; |
| 11 | double? weight; |
| 12 | int? score; |
| 13 | String? account; |
| 14 | String? alias; |
| 15 | |
| 16 | factory N2Node.fromJson(Map<String, dynamic> json) => N2Node( |
| 17 | weight: double.tryParse((json['weight'] as num?).toString()), |
| 18 | uptime: json['uptime'] as String?, |
| 19 | score: json['score'] as int?, |
| 20 | account: json['rep_address'] as String?, |
| 21 | alias: json['alias'] as String?, |
| 22 | ); |
| 23 | |
| 24 | Map<String, dynamic> toJson() => <String, dynamic>{ |
| 25 | 'uptime': uptime, |
| 26 | 'weight': weight, |
| 27 | 'score': score, |
| 28 | 'rep_address': account, |
| 29 | 'alias': alias, |
| 30 | }; |
| 31 | } |