calendarHeatmapData method
Generates calendar heatmap data.
Implementation
Map<DateTime, double> calendarHeatmapData({
required DateTime start,
required DateTime end,
double minValue = 0,
double maxValue = 10,
double emptyProbability = 0.2,
}) {
final data = <DateTime, double>{};
var current = start;
while (!current.isAfter(end)) {
if (!_random.boolean(emptyProbability)) {
data[DateTime(current.year, current.month, current.day)] =
_random.uniform(minValue, maxValue);
}
current = current.add(const Duration(days: 1));
}
return data;
}