listAssetPlatforms method
List all asset platforms (Blockchain networks).
Query: /asset_platforms
Implementation
Future<CoinGeckoResult<List<AssetPlatform>>> listAssetPlatforms() async {
final response = await _dio.get(
'/asset_platforms',
);
if (response.statusCode == 200) {
final list = Convert.toListN(response.data);
final List<AssetPlatform> categoryList = list != null
? list.map((e) => AssetPlatform.fromJson(e)).toList()
: [];
return CoinGeckoResult(categoryList);
} else {
return CoinGeckoResult(
[],
errorMessage: response.data.toString(),
errorCode: response.statusCode ?? null,
isError: true,
);
}
}