forex_conversion

Creator: coderz1093

Last updated:

Add to Cart

Description:

forex conversion

A Flutter package to quickly fetch Forex prices and perform currency conversions.
Features #

List of all forex prices in the open market.
Convert money from one currency to another using open market prices.

Getting started #
import 'package:forex_conversion/forex_conversion.dart';
copied to clipboard
Usage #
If you want the latest prices of all currencies with respect to price of USD, you can do it with minimal hassle.
final fx = Forex();
Map<String, double> allPrices = await fx.getAllCurrenciesPrices();
print("Exchange rate of PKR: ${allPrices['PKR']}");
print("Exchange rate of EUR: ${allPrices['EUR']}");
print("Exchange rate of TRY: ${allPrices['TRY']}");
copied to clipboard
If you want to check the list of all the supported currencies, you can do it easily.
final fx = Forex();
List<String> availableCurrencies = await fx.getAvailableCurrencies();
print("The list of all available currencies: ${availableCurrencies}");
copied to clipboard
For a simple currency conversion, you can use the following method for instant conversion. You must make sure you are entering only supported currencies, which can be obtained through the method provided above.
final fx = Forex();
double myPriceInPKR = await fx.getCurrencyConverted("USD", "PKR", 252.5);
print("252.5 USD in PKR: ${myPriceInPKR}");
copied to clipboard
You can initialize the class with default values for source and destination currencies. Also for the number of decimal places.
final fx = Forex(defaultDestinationCurrency: 'PKR', defaultSourceCurrency: 'EUR', defaultNumberOfDecimals: 1);
copied to clipboard
Additional information #
This package uses real-time currency rates from a third-party prices provider convertmymoney.com. The forex prices data is bound to their terms and conditions.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.