formatted all files.

This commit is contained in:
Faris Armoush
2025-06-12 15:33:32 +03:00
parent 29959f567e
commit 04250ebc98
474 changed files with 5425 additions and 4338 deletions

View File

@ -15,7 +15,8 @@ class AirQualityDataModel extends Equatable {
return AirQualityDataModel(
date: DateTime.parse(json['date'] as String),
data: (json['data'] as List<dynamic>)
.map((e) => AirQualityPercentageData.fromJson(e as Map<String, dynamic>))
.map((e) =>
AirQualityPercentageData.fromJson(e as Map<String, dynamic>))
.toList(),
);
}
@ -46,7 +47,7 @@ class AirQualityPercentageData extends Equatable {
factory AirQualityPercentageData.fromJson(Map<String, dynamic> json) {
return AirQualityPercentageData(
type: json['type'] as String? ?? '',
type: json['type'] as String? ?? '',
name: json['name'] as String? ?? '',
percentage: (json['percentage'] as num?)?.toDouble() ?? 0,
);

View File

@ -36,11 +36,14 @@ class AnalyticsDevice {
deviceTuyaUuid: json['deviceTuyaUuid'] as String?,
isActive: json['isActive'] as bool?,
productDevice: json['productDevice'] != null
? ProductDevice.fromJson(json['productDevice'] as Map<String, dynamic>)
? ProductDevice.fromJson(
json['productDevice'] as Map<String, dynamic>)
: null,
spaceUuid: json['spaceUuid'] as String?,
latitude: json['lat'] != null ? double.parse(json['lat'] as String) : null,
longitude: json['lon'] != null ? double.parse(json['lon'] as String) : null,
latitude:
json['lat'] != null ? double.parse(json['lat'] as String) : null,
longitude:
json['lon'] != null ? double.parse(json['lon'] as String) : null,
);
}
}

View File

@ -15,7 +15,8 @@ class Occupacy extends Equatable {
factory Occupacy.fromJson(Map<String, dynamic> json) {
return Occupacy(
date: DateTime.parse(json['event_date'] as String? ?? '${DateTime.now()}'),
date:
DateTime.parse(json['event_date'] as String? ?? '${DateTime.now()}'),
occupancy: (json['occupancy_percentage'] ?? 0).toString(),
spaceUuid: json['space_uuid'] as String? ?? '',
occupiedSeconds: json['occupied_seconds'] as int? ?? 0,

View File

@ -19,7 +19,8 @@ class OccupancyHeatMapModel extends Equatable {
eventDate: DateTime.parse(
json['event_date'] as String? ?? '${DateTime.now()}',
),
countTotalPresenceDetected: json['count_total_presence_detected'] as int? ?? 0,
countTotalPresenceDetected:
json['count_total_presence_detected'] as int? ?? 0,
);
}