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

Flutter heatmap calendar inspired by github contribution chart.

flutter_calendar_heatmap #

Flutter heatmap calendar inspired by github contribution chart.

img

Getting Started #

Usage #

1 - Depend on it #

Add it to your package's pubspec.yaml file

dependencies:
  flutter_calendar_heatmap: ^0.1.0

2 - Install it #

Install packages from the command line

flutter packages get

3 - Use it #

example code:

class _MyAppState extends State<MyApp> {
  Map<DateTime, int> _data = {};

  @override
  void initState() {
    _initExampleData();
    super.initState();
  }

  void _initExampleData() {
    var rng = Random();
    var now = DateTime.now();
    var today = DateTime(now.year, now.month, now.day);
    for (int i = 0; i < 200; i++) {
      DateTime date = today.subtract(Duration(days: i));
      _data[date] = rng.nextInt(6); // Random number between 0 and 5
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Heatmap plugin example app'),
        ),
        body: SingleChildScrollView(
          child: Padding(
            padding: const EdgeInsets.all(20),
            child: Column(
              children: [
                const SizedBox(height: 16),
                const Text("HeatMap", textScaleFactor: 1.4),
                const Text(
                  "Flutter heatmap calendar inspired by github contribution chart.",
                  textAlign: TextAlign.center,
                ),
                const SizedBox(height: 30),
                HeatMap(aspectRatio: 2.3, data: _data),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
8
likes
120
points
32
downloads

Publisher

verified publishersinyu1012.cn

Weekly Downloads

Flutter heatmap calendar inspired by github contribution chart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_web_plugins, intl, plugin_platform_interface

More

Packages that depend on flutter_calendar_heatmap