CurrencyConverter class
Currency converter service that uses the Exchange Rate API https://open.er-api.com/
Constructors
- CurrencyConverter()
-
factory
Properties
- client → FittorClient
-
Fetch data from URL using built-in Dart functionality
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
convert(
{required String fromCurrency, required String toCurrency, required double amount}) → Future< double> -
Convert an amount from one currency to another
fromCurrency
- Source currency code (e.g., 'USD')toCurrency
- Target currency code (e.g., 'EUR')amount
- Amount to convert -
getAvailableCurrencies(
) → Future< List< CurrencyInfo> > - Get a list of all available currencies
-
getCacheInfo(
) → Map< String, dynamic> - Get information about the cache status
-
getLatestRates(
String baseCode) → Future< Map< String, dynamic> > -
Get latest exchange rates for a specific base currency
baseCode
is the three-letter currency code (e.g., 'USD', 'INR', 'EUR') -
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