flutter_edgar_sec 0.0.2 copy "flutter_edgar_sec: ^0.0.2" to clipboard
flutter_edgar_sec: ^0.0.2 copied to clipboard

Connect to edgar sec to get fundamental stock data, income statements, balance sheets, cash flow statements, and metrics

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) => MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'Flutter Demo',
        theme: ThemeData.dark(),
        home: const MyHomePage(),
      );
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final TextEditingController _textEditingController =
      TextEditingController(text: 'AAPL');
  bool useRepository = true;

  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
          title: const Text('Edgar SEC'),
          actions: [
            IconButton(
              icon: const Icon(Icons.bar_chart),
              onPressed: () => Navigator.of(context).push(
                MaterialPageRoute<Widget>(
                  builder: (BuildContext context) => ChartPage(
                    symbol: _textEditingController.text,
                  ),
                ),
              ),
            ),
          ],
        ),
        body: Center(
          child: Container(
            margin: const EdgeInsets.all(20),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Row(
                  children: [
                    Expanded(
                      child: TextField(
                        controller: _textEditingController,
                        onSubmitted: (String value) {
                          setState(() {});
                        },
                      ),
                    ),
                    Checkbox(
                      value: useRepository,
                      onChanged: (value) {
                        setState(() {
                          useRepository = !useRepository;
                        });
                      },
                    ),
                  ],
                ),
                MaterialButton(
                  color: Colors.green,
                  onPressed: () => setState(() {}),
                  child: const Text('Get Financial Statements'),
                ),
                const SizedBox(
                  height: 20,
                ),
                Expanded(
                  child: EdgarTableUI(
                    symbol: _textEditingController.text,
                    key: UniqueKey(),
                    useCache: useRepository,
                  ),
                ),
              ],
            ),
          ),
        ), // This trailing comma makes auto-formatting nicer for build methods.
      );
}

class ChartPage extends StatelessWidget {
  final String symbol;

  const ChartPage({
    required this.symbol,
    super.key,
  });

  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
          title: Text(symbol),
        ),
        body: SingleChildScrollView(
          child: Center(
            child: Container(
              margin: const EdgeInsets.all(20),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  CompanyChartUI(
                    symbol: symbol,
                  ),
                ],
              ),
            ),
          ),
        ),
      );
}
0
likes
150
points
149
downloads

Publisher

verified publisherincaview.com

Weekly Downloads

Connect to edgar sec to get fundamental stock data, income statements, balance sheets, cash flow statements, and metrics

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, horizontal_data_table, http, intl, logger, path, path_provider, sembast, sembast_web, yahoo_finance_data_reader

More

Packages that depend on flutter_edgar_sec