yahoo_finance 0.1.1 copy "yahoo_finance: ^0.1.1" to clipboard
yahoo_finance: ^0.1.1 copied to clipboard

A Yahoo Finance client for Flutter — the Dart equivalent of Python's yfinance. Fetch quotes, historical prices, and ticker metadata with browser-grade TLS fingerprinting to avoid Yahoo's rate limits.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:yahoo_finance/yahoo_finance.dart';

import 'features.dart';

void main() => runApp(const DemoApp());

class DemoApp extends StatelessWidget {
  const DemoApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'yahoo_finance demo',
      theme: ThemeData(colorSchemeSeed: Colors.blue, useMaterial3: true),
      home: const HomePage(),
    );
  }
}

/// Home: pick a symbol, then tap a feature to fetch and inspect it.
class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final _controller = TextEditingController(text: 'AAPL');
  String _symbol = 'AAPL';

  void _setSymbol(String value) {
    final v = value.trim();
    if (v.isNotEmpty) setState(() => _symbol = v);
  }

  @override
  Widget build(BuildContext context) {
    final features = buildFeatures(Ticker(_symbol));
    return Scaffold(
      appBar: AppBar(title: Text('yahoo_finance — ${_symbol.toUpperCase()}')),
      body: Column(
        children: [
          Padding(
            padding: const EdgeInsets.all(12),
            child: TextField(
              controller: _controller,
              textCapitalization: TextCapitalization.characters,
              decoration: InputDecoration(
                labelText: 'Symbol',
                hintText: 'AAPL, ^GSPC, BTC-USD, …',
                border: const OutlineInputBorder(),
                suffixIcon: IconButton(
                  icon: const Icon(Icons.check),
                  onPressed: () => _setSymbol(_controller.text),
                ),
              ),
              onSubmitted: _setSymbol,
            ),
          ),
          Expanded(
            child: ListView.builder(
              itemCount: features.length,
              itemBuilder: (context, i) {
                final feature = features[i];
                return ListTile(
                  title: Text(feature.title),
                  subtitle: Text(feature.subtitle),
                  trailing: const Icon(Icons.chevron_right),
                  onTap: () => Navigator.of(context).push(
                    MaterialPageRoute<void>(builder: (_) => feature.page()),
                  ),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}
1
likes
0
points
253
downloads

Publisher

unverified uploader

Weekly Downloads

A Yahoo Finance client for Flutter — the Dart equivalent of Python's yfinance. Fetch quotes, historical prices, and ticker metadata with browser-grade TLS fingerprinting to avoid Yahoo's rate limits.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cronet_http, cupertino_http, flutter, http, meta

More

Packages that depend on yahoo_finance