push batch door sensor, design bugs

This commit is contained in:
ashrafzarkanisala
2024-10-02 01:41:15 +03:00
parent 0d49ad5106
commit 9dbf4b0540
16 changed files with 195 additions and 60 deletions

View File

@ -12,6 +12,7 @@ import 'package:syncrow_web/pages/device_managment/door_lock/view/door_lock_cont
import 'package:syncrow_web/pages/device_managment/gateway/view/gateway_batch_control.dart';
import 'package:syncrow_web/pages/device_managment/gateway/view/gateway_view.dart';
import 'package:syncrow_web/pages/device_managment/main_door_sensor/view/main_door_control_view.dart';
import 'package:syncrow_web/pages/device_managment/main_door_sensor/view/main_door_sensor_batch_view.dart';
import 'package:syncrow_web/pages/device_managment/one_gang_switch/view/wall_light_batch_control.dart';
import 'package:syncrow_web/pages/device_managment/one_gang_switch/view/wall_light_device_control.dart';
import 'package:syncrow_web/pages/device_managment/three_gang_switch/view/living_room_batch_controls.dart';
@ -76,7 +77,9 @@ mixin RouteControlsBasedCode {
WPS:
CPS:
AC:
CUR:
CUR:
WH:
DS:
*/
Widget routeBatchControlsWidgets({required List<AllDevicesModel> devices}) {
@ -148,7 +151,13 @@ mixin RouteControlsBasedCode {
.map((e) => e.uuid!)
.toList(),
);
case 'DS':
return MainDoorSensorBatchView(
devicesIds: devices
.where((e) => (e.productType == 'DS'))
.map((e) => e.uuid!)
.toList(),
);
default:
return const SizedBox();
}

View File

@ -63,6 +63,7 @@ class AllDevicesModel {
int? updateTime;
String? uuid;
int? batteryLevel;
String? productName;
AllDevicesModel({
this.room,
@ -90,6 +91,7 @@ class AllDevicesModel {
this.updateTime,
this.uuid,
this.batteryLevel,
this.productName,
});
AllDevicesModel.fromJson(Map<String, dynamic> json) {
room = (json['room'] != null && (json['room'] is Map))
@ -121,6 +123,7 @@ class AllDevicesModel {
updateTime = int.tryParse(json['updateTime']?.toString() ?? '');
uuid = json['uuid']?.toString();
batteryLevel = int.tryParse(json['battery']?.toString() ?? '');
productName = json['productName']?.toString();
}
String _getDefaultIcon(String? productType) {
@ -182,6 +185,7 @@ class AllDevicesModel {
data['updateTime'] = updateTime;
data['uuid'] = uuid;
data['battery'] = batteryLevel;
data['productName'] = productName;
return data;
}
@ -214,6 +218,7 @@ class AllDevicesModel {
other.timeZone == timeZone &&
other.updateTime == updateTime &&
other.uuid == uuid &&
other.productName == productName &&
other.batteryLevel == batteryLevel;
}
@ -243,6 +248,7 @@ class AllDevicesModel {
timeZone.hashCode ^
updateTime.hashCode ^
uuid.hashCode ^
productName.hashCode ^
batteryLevel.hashCode;
}
}

View File

@ -165,7 +165,7 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
data: devicesToShow.map((device) {
return [
device.name ?? '',
device.categoryName ?? '',
device.productName ?? '',
device.uuid ?? '',
device.unit?.name ?? '',
device.room?.name ?? '',