open_exchange_rates 0.0.5

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new72

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

void runLatest(String api_key) async {
  QueryLatest latest = QueryLatest.get();
  latest.query.add(Params(api_key: api_key));
  // Query Latest
  await for (List<Rate> _rates in latest.results) {
    for (Rate rate in _rates) {
      print('${rate.currency}: ${rate.ratio}');
    }
  }
}

void runHistorical(String api_key) async {
  QueryHistorical historical = QueryHistorical.get();
  historical.query.add(Params(api_key: api_key, date: '2018-07-01'));
  // Query Historical
  await for (List<Rate> _rates in historical.results) {
    for (Rate rate in _rates) {
      print('${rate.currency}: ${rate.ratio}');
    }
  }
}

void runCurrencies(String api_key) async {
  QueryCurrencies currencies = QueryCurrencies.get();
  currencies.query.add(Params(api_key: api_key));
  // Query Currencies
  await for (List<Currency> _currencies in currencies.results) {
    for (Currency _currency in _currencies) {
      print('${_currency.currency}: ${_currency.name}');
    }
  }
}

main() async {
  String api_key = 'api_key';
  runLatest(api_key);
  runHistorical(api_key);
  runCurrencies(api_key);
}

0.0.5

  • fix uri query parameters error

0.0.4

  • add null item to stop stream

0.0.3

  • Cleanup unused package
  • Refactor some parts of code
  • Update example
  • Add TODO list

0.0.2

Supported API Endpoints

  • /latest.json
  • /currencies.json
  • /historical/${date}.json

Update API usage example.

0.0.1

Supported API Endpoints

  • /latest.json
  • /currencies.json

example/main.dart

import 'package:open_exchange_rates/open_exchange_rates.dart';

// example code

void runLatest(String api_key) async {
  QueryLatest latest = QueryLatest.get();
  latest.query.add(Params(api_key: api_key, symbols: "TWD,JPY"));
  // Query Latest
  await for (List<Rate> _rates in latest.results) {
    for (Rate rate in _rates) {
      if (rate.currency == "null") break;
      print('${rate.currency}: ${rate.ratio}');
    }
    break;
  }
}

void runHistorical(String api_key) async {
  QueryHistorical historical = QueryHistorical.get();
  historical.query.add(Params(api_key: api_key, date: '2018-07-01'));
  // Query Historical
  await for (List<Rate> _rates in historical.results) {
    for (Rate rate in _rates) {
      if (rate.currency == "null") break;
      print('${rate.currency}: ${rate.ratio}');
    }
    break;
  }
}

void runCurrencies(String api_key) async {
  QueryCurrencies currencies = QueryCurrencies.get();
  currencies.query.add(Params(api_key: api_key));
  // Query Currencies
  await for (List<Currency> _currencies in currencies.results) {
    for (Currency _currency in _currencies) {
      if (_currency.currency == "null") break;
      print('${_currency.currency}: ${_currency.name}');
    }
    break;
  }
}

main() async {
  String api_key = 'api_key';
  runLatest(api_key);
//  runHistorical(api_key);
//  runCurrencies(api_key);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  open_exchange_rates: "^0.0.5"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:open_exchange_rates/open_exchange_rates.dart';
  
Version Uploaded Documentation Archive
0.0.5 Jul 10, 2018 Go to the documentation of open_exchange_rates 0.0.5 Download open_exchange_rates 0.0.5 archive
0.0.4 Jul 9, 2018 Go to the documentation of open_exchange_rates 0.0.4 Download open_exchange_rates 0.0.4 archive
0.0.3 Jul 5, 2018 Go to the documentation of open_exchange_rates 0.0.3 Download open_exchange_rates 0.0.3 archive
0.0.2 Jul 4, 2018 Go to the documentation of open_exchange_rates 0.0.2 Download open_exchange_rates 0.0.2 archive
0.0.1 Jul 1, 2018 Go to the documentation of open_exchange_rates 0.0.1 Download open_exchange_rates 0.0.1 archive

Analysis

We analyzed this package on Jul 13, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
43 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
72
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:open_exchange_rates/open_exchange_rates.dart.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.55.0 <2.0.0
http ^0.11.3+16 0.11.3+17
rxdart ^0.18.1 0.18.1
Transitive dependencies
async 2.0.7
charcode 1.1.2
collection 1.14.10
http_parser 3.1.2
path 1.6.1
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5