flutter_heatmap_calendar
flutter_heatmap_calendar copied to clipboard
Heatmap gives error if all datapoints are 0

Does this issue persist or was this patched?
still an issue for me
this is how I get around it
// BUG: avoiding all 0 bug in flutter heatmap
// https://github.com/devappmin/flutter_heatmap_calendar/issues/11
bool allZero = records.values.every((value) => value == 0);
Color color;
if (allZero) {
// change all values to 1, because all zeros breaks
// we'll set color to white so it looks empty
color = Colors.white;
records = records.map((key, value) => MapEntry(key, 1));
} else {
// Otherwise, set the color to red
color = Colors.red;
}