mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
Corrected color of titles in charts.
This commit is contained in:
@ -2,64 +2,70 @@ class AnalyticsDevice {
|
||||
const AnalyticsDevice({
|
||||
required this.uuid,
|
||||
required this.name,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
required this.deviceTuyaUuid,
|
||||
required this.isActive,
|
||||
required this.productDevice,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.deviceTuyaUuid,
|
||||
this.isActive,
|
||||
this.productDevice,
|
||||
this.spaceUuid,
|
||||
});
|
||||
|
||||
final String uuid;
|
||||
final String name;
|
||||
final DateTime createdAt;
|
||||
final DateTime updatedAt;
|
||||
final String deviceTuyaUuid;
|
||||
final bool isActive;
|
||||
final ProductDevice productDevice;
|
||||
final DateTime? createdAt;
|
||||
final DateTime? updatedAt;
|
||||
final String? deviceTuyaUuid;
|
||||
final bool? isActive;
|
||||
final ProductDevice? productDevice;
|
||||
final String? spaceUuid;
|
||||
|
||||
factory AnalyticsDevice.fromJson(Map<String, dynamic> json) {
|
||||
return AnalyticsDevice(
|
||||
uuid: json['uuid'] as String? ?? '',
|
||||
name: json['name'] as String? ?? '',
|
||||
createdAt: DateTime.parse(json['createdAt'] as String? ?? ''),
|
||||
updatedAt: DateTime.parse(json['updatedAt'] as String? ?? ''),
|
||||
deviceTuyaUuid: json['deviceTuyaUuid'] as String? ?? '',
|
||||
isActive: json['isActive'] as bool? ?? false,
|
||||
productDevice: ProductDevice.fromJson(
|
||||
json['productDevice'] as Map<String, dynamic>? ?? {},
|
||||
),
|
||||
uuid: json['uuid'] as String,
|
||||
name: json['name'] as String,
|
||||
createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt'] as String) : null,
|
||||
updatedAt: json['updatedAt'] != null ? DateTime.parse(json['updatedAt'] as String) : null,
|
||||
deviceTuyaUuid: json['deviceTuyaUuid'] as String?,
|
||||
isActive: json['isActive'] as bool?,
|
||||
productDevice: json['productDevice'] != null
|
||||
? ProductDevice.fromJson(json['productDevice'] as Map<String, dynamic>)
|
||||
: null,
|
||||
spaceUuid: (json['spaces'] as List<dynamic>?)
|
||||
?.map((e) => e['uuid'])
|
||||
.firstOrNull
|
||||
?.toString(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ProductDevice {
|
||||
const ProductDevice({
|
||||
required this.uuid,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
required this.catName,
|
||||
required this.prodId,
|
||||
required this.name,
|
||||
required this.prodType,
|
||||
this.uuid,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.catName,
|
||||
this.prodId,
|
||||
this.name,
|
||||
this.prodType,
|
||||
});
|
||||
|
||||
final String uuid;
|
||||
final DateTime createdAt;
|
||||
final DateTime updatedAt;
|
||||
final String catName;
|
||||
final String prodId;
|
||||
final String name;
|
||||
final String prodType;
|
||||
final String? uuid;
|
||||
final DateTime? createdAt;
|
||||
final DateTime? updatedAt;
|
||||
final String? catName;
|
||||
final String? prodId;
|
||||
final String? name;
|
||||
final String? prodType;
|
||||
|
||||
factory ProductDevice.fromJson(Map<String, dynamic> json) {
|
||||
return ProductDevice(
|
||||
uuid: json['uuid'] as String? ?? '',
|
||||
createdAt: DateTime.parse(json['createdAt'] as String? ?? ''),
|
||||
updatedAt: DateTime.parse(json['updatedAt'] as String? ?? ''),
|
||||
catName: json['catName'] as String? ?? '',
|
||||
prodId: json['prodId'] as String? ?? '',
|
||||
name: json['name'] as String? ?? '',
|
||||
prodType: json['prodType'] as String? ?? '',
|
||||
uuid: json['uuid'] as String?,
|
||||
createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt'] as String) : null,
|
||||
updatedAt: json['updatedAt'] != null ? DateTime.parse(json['updatedAt'] as String) : null,
|
||||
catName: json['catName'] as String?,
|
||||
prodId: json['prodId'] as String?,
|
||||
name: json['name'] as String?,
|
||||
prodType: json['prodType'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ abstract final class EnergyManagementChartsHelper {
|
||||
child: Text(
|
||||
value.toString(),
|
||||
style: context.textTheme.bodySmall?.copyWith(
|
||||
color: ColorsManager.greyColor,
|
||||
color: ColorsManager.lightGreyColor,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
|
@ -49,7 +49,7 @@ class AnalyticsDeviceDropdown extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildDevicesDropdown(BuildContext context, AnalyticsDevicesState state) {
|
||||
final spaceUuid = context.read<SpaceTreeBloc>().state.selectedSpaces.firstOrNull;
|
||||
final spaceUuid = state.selectedDevice?.spaceUuid;
|
||||
return DropdownButton<AnalyticsDevice?>(
|
||||
value: state.selectedDevice,
|
||||
isDense: true,
|
||||
|
@ -41,7 +41,7 @@ class EnergyConsumptionPerDeviceDevicesList extends StatelessWidget {
|
||||
.color;
|
||||
|
||||
return Tooltip(
|
||||
message: '${device.name}\n${device.productDevice.uuid}',
|
||||
message: '${device.name}\n${device.productDevice?.uuid ?? ''}',
|
||||
child: Container(
|
||||
height: MediaQuery.sizeOf(context).height * 0.0365,
|
||||
padding: const EdgeInsetsDirectional.symmetric(
|
||||
|
@ -19,7 +19,7 @@ class OccupancyChart extends StatelessWidget {
|
||||
maxY: 1.0,
|
||||
gridData: EnergyManagementChartsHelper.gridData().copyWith(
|
||||
checkToShowHorizontalLine: (value) => true,
|
||||
horizontalInterval: 0.25,
|
||||
horizontalInterval: 0.2,
|
||||
),
|
||||
borderData: EnergyManagementChartsHelper.borderData(),
|
||||
barTouchData: _barTouchData(context),
|
||||
@ -108,7 +108,7 @@ class OccupancyChart extends StatelessWidget {
|
||||
final leftTitles = titlesData.leftTitles.copyWith(
|
||||
sideTitles: titlesData.leftTitles.sideTitles.copyWith(
|
||||
reservedSize: 70,
|
||||
interval: 0.25,
|
||||
interval: 0.2,
|
||||
getTitlesWidget: (value, meta) => Padding(
|
||||
padding: const EdgeInsetsDirectional.only(end: 12),
|
||||
child: FittedBox(
|
||||
|
Reference in New Issue
Block a user