Chain.fromMap constructor
Implementation
factory Chain.fromMap(Map<String, dynamic> map) {
return Chain(
id: map['id'],
name: map['name'],
nativeCurrency: map['nativeCurrency'] != null
? ChainNativeCurrency.fromMap(map['nativeCurrency'])
: null,
rpcUrls: map['rpcUrls'] != null
? (map['rpcUrls'] as Map<String, dynamic>).map(
(key, value) {
return MapEntry(key, ChainRpcUrls.fromMap(value));
},
)
: null,
blockExplorers: map['blockExplorers'] != null
? (map['blockExplorers'] as Map<String, dynamic>).map(
(key, value) => MapEntry(key, ChainBlockExplorer.fromMap(value)),
)
: null,
contracts: map['contracts'] != null
? (map['contracts'] as Map<String, dynamic>).map(
(key, value) => MapEntry(key, ChainContract.fromMap(value)),
)
: null,
// ignore: prefer_if_null_operators
sourceId: map['sourceId'] != null ? map['sourceId'] : null,
// ignore: prefer_if_null_operators
testnet: map['testnet'] != null ? map['testnet'] : null,
// ignore: prefer_if_null_operators
custom: map['custom'] != null ? map['custom'] : null,
fees: map['fees'] != null ? ChainFees.fromMap(map['fees']) : null,
formatters: map['formatters'] != null && map['formatters'] is Map
? ChainFormatters.fromMap(map['formatters'])
: null,
serializers: map['serializers'] != null && map['serializers'] is Map
? ChainSerializers.fromMap(map['serializers'])
: null,
);
}