getCurrentTokenValue method
Future<NetworkResponse>
getCurrentTokenValue(
- dynamic tokenType, {
- dynamic currency = 'EUR',
override
Implementation
@override
Future<NetworkResponse> getCurrentTokenValue(tokenType,
{currency = 'EUR'}) async {
bool isDisconnect = await WifiService.isDisconnectWhenCallApi();
if (isDisconnect) return NetworkResponse.withDisconnect();
try {
Response response = await AppClientsWeb(requiredToken: false).get(
AppEndpoint.getCurrentTokenValue(),
queryParameters: {'tokenType': tokenType, 'currency': currency});
return NetworkResponse.fromResponse(response,
converter: (json) => double.parse(json.toString()));
} on DioError catch (e) {
return NetworkResponse.withErrorRequest(e);
} catch (e) {
return NetworkResponse.withErrorConvert(e);
}
}