finance 0.0.3 copy "finance: ^0.0.3" to clipboard
finance: ^0.0.3 copied to clipboard

outdated

A Dart plugin that provides a set of high-level functions and classes that make it easy to retrieve financial quote prices for stocks (Amazon, Google, ...), commodities (Gold, Oil, ...) and crypto-cur [...]

example/main.dart

import 'package:finance/finance.dart';

Future<void> main(List<String> arguments) async {
  final Map<String, Map<String, dynamic>> quoteRaw =
      await Finance.downloadRawQuote(
          QuoteProvider.yahoo, <String>['KO', 'GOOG']);

  print('Number of quotes retrieved: ${quoteRaw.keys.length}.');
  print(
      'Number of attributes retrieved for KO: ${quoteRaw['KO'].keys.length}.');
  print(
      'Current market price for KO: ${quoteRaw['GOOG']['regularMarketPrice']}.');
  print(
      'Number of attributes retrieved for GOOG: ${quoteRaw['GOOG'].keys.length}.');
  print(
      'Current market price for KO: ${quoteRaw['GOOG']['regularMarketPrice']}.');

  final Map<String, Map<String, String>> quotePrice =
      await Finance.downloadQuotePrice(
          QuoteProvider.yahoo, <String>['KO', 'GOOG']);

  print('Number of quotes retrieved: ${quotePrice.keys.length}.');
  print(
      'Number of attributes retrieved for KO: ${quotePrice['KO'].keys.length}.');
  print('Current market price for KO: ${quotePrice['KO']['price']}.');
  print(
      'Number of attributes retrieved for GOOG: ${quotePrice['GOOG'].keys.length}.');
  print('Current market price for KO: ${quotePrice['GOOG']['price']}.');

  final Map<String, Map<String, dynamic>> cryptoQuoteRaw =
      await Finance.downloadRawQuote(
          QuoteProvider.coincap, <String>['bitcoin', 'ethereum']);

  print('Number of quotes retrieved: ${cryptoQuoteRaw.keys.length}.');
  print(
      'Number of attributes retrieved for bitcoin: ${cryptoQuoteRaw['bitcoin'].keys.length}.');
  print(
      'Current market price for bitcoin: ${cryptoQuoteRaw['bitcoin']['priceUsd']}.');
  print(
      'Number of attributes retrieved for ethereum: ${cryptoQuoteRaw['ethereum'].keys.length}.');
  print(
      'Current market price for ethereum: ${cryptoQuoteRaw['ethereum']['priceUsd']}.');
}
23
likes
0
pub points
72%
popularity

Publisher

unverified uploader

A Dart plugin that provides a set of high-level functions and classes that make it easy to retrieve financial quote prices for stocks (Amazon, Google, ...), commodities (Gold, Oil, ...) and crypto-currencies (Bitcoin, Ethereum, ...). It's platform-independent, supports iOS and Android.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

html, http, intl, logger

More

Packages that depend on finance