fast_charts 0.0.1 copy "fast_charts: ^0.0.1" to clipboard
fast_charts: ^0.0.1 copied to clipboard

A package of widgets for representing horizontal and vertical stacked bar charts.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'pages/bar_single.dart';
import 'pages/pie_single.dart';
import 'pages/stacked_bar_list.dart';
import 'pages/stacked_bar_single.dart';


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


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

  @override
  Widget build(final BuildContext context)
  {
    return MaterialApp(
      theme: ThemeData.light(),
      darkTheme: ThemeData.dark(),
      themeMode: ThemeMode.system,
      routes: {
        '/example': (context) => const ExamplePage(),
        '/example/bar/single': (context) => const BarSinglePage(),
        '/example/stacked/single': (context) => const StackedBarSinglePage(),
        '/example/pie/single': (context) => const PieSinglePage(),
        '/example/stacked/list': (context) => const StackedBarListPage(),
      },
      initialRoute: '/example',
    );
  }
}


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

  @override
  Widget build(final BuildContext context)
  {
    return Scaffold(
      appBar: AppBar(title: const Text('Example')),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Center(
          child: SizedBox(
            width: 320,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                ElevatedButton(
                  onPressed: () => Navigator.of(context).pushNamed(
                    '/example/bar/single',
                  ),
                  child: const Text('Single bar chart'),
                ),
                ElevatedButton(
                  onPressed: () => Navigator.of(context).pushNamed(
                    '/example/stacked/single',
                  ),
                  child: const Text('Single stacked bar chart'),
                ),
                ElevatedButton(
                  onPressed: () => Navigator.of(context).pushNamed(
                    '/example/pie/single',
                  ),
                  child: const Text('Single pie chart'),
                ),
                ElevatedButton(
                  onPressed: () => Navigator.of(context).pushNamed(
                    '/example/stacked/list',
                  ),
                  child: const Text('List of stacked bar charts'),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
12
likes
0
pub points
73%
popularity

Publisher

verified publisherrightbrain.pro

A package of widgets for representing horizontal and vertical stacked bar charts.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on fast_charts