exchangeRate method
Get currency exchange rate.
Implementation
Future<double> exchangeRate(String code, {DateTime? date}) async {
if (_exchangeRate.containsKey(code)) {
return Future.value(_exchangeRate[code]);
}
final response = await dio
.get('/cube/exchangeRate/$code', queryParameters: {'date': date});
_exchangeRate[code] = double.parse(response.data);
return response.data ?? 1;
}