Merge branch 'dev' into 1511-occupancy-heat-map-tooltip

This commit is contained in:
Faris Armoush
2025-05-14 12:05:34 +03:00
committed by GitHub
9 changed files with 64 additions and 49 deletions
@@ -35,8 +35,7 @@ abstract final class FetchOccupancyDataHelper {
context.read<OccupancyHeatMapBloc>().add(
LoadOccupancyHeatMapEvent(
GetOccupancyHeatMapParam(
spaceId: spaceId,
communityId: communityId,
spaceUuid: spaceId,
year: datePickerState.yearlyDate,
),
),
@@ -15,8 +15,9 @@ class OccupancyHeatMap extends StatelessWidget {
static const _cellSize = 16.0;
static const _totalWeeks = 53;
int get _maxValue =>
heatMapData.isNotEmpty ? heatMapData.values.reduce(math.max) : 0;
int get _maxValue => heatMapData.isNotEmpty
? heatMapData.keys.map((key) => heatMapData[key] ?? 0).reduce(math.max)
: 0;
DateTime _getStartingDate() {
final jan1 = DateTime(DateTime.now().year, 1, 1);
@@ -68,7 +68,10 @@ class OccupancyHeatMapBox extends StatelessWidget {
Expanded(
child: OccupancyHeatMap(
heatMapData: state.heatMapData.asMap().map(
(_, value) => MapEntry(value.date, value.occupancy),
(_, value) => MapEntry(
value.eventDate,
value.countTotalPresenceDetected,
),
),
),
),