CachedRateProvider class
An in-memory cached rate provider that wraps another provider.
PkCurrencyFormatter.configureRates(
CachedRateProvider(
ExchangeRateApiProvider(),
ttl: Duration(hours: 1),
),
);
- Implemented types
Constructors
- CachedRateProvider(CurrencyRateProvider _inner, {Duration ttl = const Duration(hours: 1)})
Properties
Methods
-
clearCache(
) → void -
getAllRates(
String base) → Future< Map< String, double> > -
Returns all rates relative to
basecurrency.override -
getRate(
String from, String to) → Future< double> -
Returns the exchange rate from
fromtoto.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited