open_exchange_rates 0.0.1 copy "open_exchange_rates: ^0.0.1" to clipboard
open_exchange_rates: ^0.0.1 copied to clipboard

outdatedDart 1 only

A dartlang wrapping for openexchangerates api requests.

open_exchange_rates #

The open_exchange_rates library is a dartlang wrapping and make it easy to use.

It's still under development #

Any suggestions are welcome.

How to use? #

  1. Registry and get an app key from open_exchange_rates
  2. Example Code Here:

#

import 'package:open_exchange_rates/open_exchange_rates.dart';

// example code
main() async {
  String api_key = 'your_api_key_from_openexchange';
  ExchangerBloc blocLatest = ExchangerBloc.fromLatest(Latest());
  ExchangerBloc blocCurrencies = ExchangerBloc.fromCurrencies(Currencies());
  // Get Latest
  blocLatest.query.add(Params(api_key: api_key));
  blocLatest.results.forEach((item) => item.forEach((val) =>
      print('${val.currency}: ${val.ratio}')
  ));
  // Get Currencies
  blocCurrencies.query.add(Params(api_key: api_key));
  blocCurrencies.currency.forEach((item) => item.forEach((val) =>
      print('${val.currency}: ${val.name}')
  ));
  blocLatest.dispose();
  blocCurrencies.dispose();
}
1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A dartlang wrapping for openexchangerates api requests.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http, rxdart, uri

More

Packages that depend on open_exchange_rates