diff --git a/lib/pages/analytics/models/occupancy_heat_map_model.dart b/lib/pages/analytics/models/occupancy_heat_map_model.dart index 52016cc9..73e7d5d7 100644 --- a/lib/pages/analytics/models/occupancy_heat_map_model.dart +++ b/lib/pages/analytics/models/occupancy_heat_map_model.dart @@ -1,22 +1,28 @@ import 'package:equatable/equatable.dart'; class OccupancyHeatMapModel extends Equatable { - final DateTime date; + final String uuid; - final int occupancy; + final DateTime eventDate; + + final int countTotalPresenceDetected; const OccupancyHeatMapModel({ - required this.date, - required this.occupancy, + required this.uuid, + required this.eventDate, + required this.countTotalPresenceDetected, }); factory OccupancyHeatMapModel.fromJson(Map json) { return OccupancyHeatMapModel( - date: DateTime.parse(json['date'] as String), - occupancy: json['occupancy'] as int, + uuid: json['uuid'] as String? ?? '', + eventDate: DateTime.parse( + json['event_date'] as String? ?? '${DateTime.now()}', + ), + countTotalPresenceDetected: json['count_total_presence_detected'] as int? ?? 0, ); } @override - List get props => [date, occupancy]; + List get props => [uuid, eventDate, countTotalPresenceDetected]; } diff --git a/lib/pages/analytics/modules/occupancy/widgets/occupancy_heat_map_box.dart b/lib/pages/analytics/modules/occupancy/widgets/occupancy_heat_map_box.dart index c4cda268..d52604bf 100644 --- a/lib/pages/analytics/modules/occupancy/widgets/occupancy_heat_map_box.dart +++ b/lib/pages/analytics/modules/occupancy/widgets/occupancy_heat_map_box.dart @@ -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, + ), ), ), ),