CurrencyRateProvider class abstract

Abstract interface for fetching live currency exchange rates.

PkCurrencyFormatter.configureRates(ExchangeRateApiProvider(apiKey: '...'));
final rate = await PkCurrencyFormatter.getRate('USD', 'EUR');
Implementers

Constructors

CurrencyRateProvider()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAllRates(String base) Future<Map<String, double>>
Returns all rates relative to base currency.
getRate(String from, String to) Future<double>
Returns the exchange rate from from to to.
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