open_exchange_rates 2.0.0
open_exchange_rates: ^2.0.0 copied to clipboard

Dart native
Flutter Android iOS Linux macOS Windows

A library for Open Exchange Rates API to make it easy to use and get data from the API right away.

open_exchange_rates #

The open_exchange_rates library helps you to use open exchange rates API much easier and simpler. By providing your open exchange rates API key to the library and get data from the API in one line!

pub package

Support methods #

  • [x] Get latest rates
  • [x] Get historical rates

How to use? #

  1. Registry and get an app key from open_exchange_rates
  2. Example Code Here:
import 'dart:io';

import 'package:open_exchange_rates/open_exchange_rates.dart';

void main(List<String> args) async {
  var oxr = Oxr(Platform.environment['OXR_API_KEY']);

  var latest = await oxr.getLatest();
  if (latest != null) {
    latest.rates.forEach((key, value) {
      print('${key}: ${value}');
    });
  }
  var historical = await oxr.getHistorical(DateTime(2020, 12, 1));
  if (historical != null) {
    historical.rates.forEach((key, value) {
      print('${key}: ${value}');
    });
  }
}

Run example #

export OXR_API_KEY=${YOUR_API_KEY}
dart example/main.dart 

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
90
pub points
0%
popularity

A library for Open Exchange Rates API to make it easy to use and get data from the API right away.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

cychiang0823@gmail.com

License

BSD (LICENSE)

Dependencies

http, intl, json_annotation, uri

More

Packages that depend on open_exchange_rates