Account.fromJson constructor
Account.fromJson(
- Map<String, dynamic> json
)
Implementation
factory Account.fromJson(Map<String, dynamic> json) {
String walletType = "";
if(Platform.isIOS){
if (json.containsKey("walletType") && json['walletType'] != null) {
walletType = (json['walletType'] as Map<String, dynamic>).keys.first;
}
}else{
walletType = json['walletType'] ?? "";
}
return Account(
json['publicAddress'],
json['name'],
json['url'],
json['icons'] != null
? List<String>.from(json['icons'].map((x) => x))
: null,
json['description'],
json['mnemonic'],
json['chainId'],
walletType,
);
}