made charts based on states and not based on metrics.

This commit is contained in:
Faris Armoush
2025-06-01 12:36:09 +03:00
parent 7b31914e1c
commit ca1feb9600
3 changed files with 66 additions and 64 deletions

View File

@ -4,28 +4,28 @@ import 'package:syncrow_web/utils/color_manager.dart';
class AirQualityDataModel {
const AirQualityDataModel({
required this.date,
this.aqi,
this.pm25,
this.pm10,
this.hcho,
this.tvoc,
this.co2,
this.good,
this.moderate,
this.poor,
this.unhealthy,
this.severe,
this.hazardous,
});
final DateTime date;
final double? aqi;
final double? pm25;
final double? pm10;
final double? hcho;
final double? tvoc;
final double? co2;
final double? good;
final double? moderate;
final double? poor;
final double? unhealthy;
final double? severe;
final double? hazardous;
static final Map<String, Color> metricColors = {
'aqi': ColorsManager.goodGreen.withValues(alpha: 0.7),
'pm25': ColorsManager.moderateYellow.withValues(alpha: 0.7),
'pm10': ColorsManager.poorOrange.withValues(alpha: 0.7),
'hcho': ColorsManager.unhealthyRed.withValues(alpha: 0.7),
'tvoc': ColorsManager.severePink.withValues(alpha: 0.7),
'co2': ColorsManager.hazardousPurple.withValues(alpha: 0.7),
'good': ColorsManager.goodGreen.withValues(alpha: 0.7),
'moderate': ColorsManager.moderateYellow.withValues(alpha: 0.7),
'poor': ColorsManager.poorOrange.withValues(alpha: 0.7),
'unhealthy': ColorsManager.unhealthyRed.withValues(alpha: 0.7),
'severe': ColorsManager.severePink.withValues(alpha: 0.7),
'hazardous': ColorsManager.hazardousPurple.withValues(alpha: 0.7),
};
}