ExchangeRates class

Container for ExchangeRate.

Constructors

ExchangeRates(HttpClient httpClient, CruzawlPreferences preferences, {ExchangeRatesCallback update = defaultExchangeRatesUpdate, Duration updateDuration = const Duration(minutes: 10), StringCallback debugPrint})

Properties

data Map<String, ExchangeRate>
read / write
debugPrint StringCallback
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
httpClient HttpClient
read / write
preferences CruzawlPreferences
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
update ExchangeRatesCallback
read / write
updated DateTime
read / write
updateDuration Duration
read / write

Methods

checkForUpdate() → void
Calls update rate-limited to once per updateDuration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
prepareUpdateRate(String base, String currency, {bool rateLimit = false}) ExchangeRate
Called before requesting updated basecurrency.
rateViaBTC(String source, String target) num
Converts source → BTC → target.
toString() String
A string representation of this object. [...]
inherited
updateRate(String base, String currency, num amount, [String via]) ExchangeRate
Update basecurrency exchange rate to amount.

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited