Activity Heatmap

Loading preview

Starting the Flutter app

A Flutter day-by-hour heatmap in CustomPaint with five color bins, a metric switch and a detail card for the selected time slot.

Get the source

Add it to your project

Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.

First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.

The grid uses seven rows of two-hour buckets, which keeps cells large enough to tap on a phone. _HeatmapPainter.cellAt is a static method, so gestures and painting share the same geometry, and heightFor grows rows with the available width. Values are rounded into five bins and _binColor blends from the empty track to the primary color, so the legend and cells always match. With nothing selected, the ring and card fall back to the busiest slot. Replace _generate with your aggregated counts as a list of seven lists, and change _buckets and _slot together if you want finer time resolution.