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

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

example/main.dart

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}');
    });
  }
}
1
likes
40
pub points
0%
popularity

Publisher

unverified uploader

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

License

BSD-3-Clause (LICENSE)

Dependencies

http, intl, json_annotation, uri

More

Packages that depend on open_exchange_rates