mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
spaceName
This commit is contained in:
@ -23,6 +23,7 @@ class DeviceModel {
|
||||
dynamic timeZone;
|
||||
dynamic updateTime;
|
||||
dynamic uuid;
|
||||
dynamic spaceName;
|
||||
|
||||
DeviceModel({
|
||||
required this.productUuid,
|
||||
@ -45,6 +46,7 @@ class DeviceModel {
|
||||
required this.timeZone,
|
||||
required this.updateTime,
|
||||
required this.uuid,
|
||||
required this.spaceName,
|
||||
});
|
||||
|
||||
// Deserialize from JSON
|
||||
@ -53,7 +55,8 @@ class DeviceModel {
|
||||
DeviceType type = devicesTypesMap[json['productType']] ?? DeviceType.Other;
|
||||
if (type == DeviceType.LightBulb) {
|
||||
tempIcon = Assets.lightBulb;
|
||||
} else if (type == DeviceType.CeilingSensor || type == DeviceType.WallSensor) {
|
||||
} else if (type == DeviceType.CeilingSensor ||
|
||||
type == DeviceType.WallSensor) {
|
||||
tempIcon = Assets.sensors;
|
||||
} else if (type == DeviceType.AC) {
|
||||
tempIcon = Assets.ac;
|
||||
@ -102,6 +105,7 @@ class DeviceModel {
|
||||
timeZone: json['timeZone'],
|
||||
updateTime: json['updateTime'],
|
||||
uuid: json['uuid'],
|
||||
spaceName: json['spaceName'],
|
||||
);
|
||||
}
|
||||
|
||||
@ -128,6 +132,7 @@ class DeviceModel {
|
||||
'timeZone': timeZone,
|
||||
'updateTime': updateTime,
|
||||
'uuid': uuid,
|
||||
'spaceName': spaceName
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,8 @@ class AddDeviceDialog extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
Size size = MediaQuery.of(context).size;
|
||||
return BlocProvider(
|
||||
create: (context) => VisitorPasswordBloc(context.read<ProjectCubit>())..add(FetchDevice()),
|
||||
create: (context) =>
|
||||
VisitorPasswordBloc(context.read<ProjectCubit>())..add(FetchDevice()),
|
||||
child: BlocBuilder<VisitorPasswordBloc, VisitorPasswordState>(
|
||||
builder: (BuildContext context, VisitorPasswordState state) {
|
||||
final visitorBloc = BlocProvider.of<VisitorPasswordBloc>(context);
|
||||
@ -36,10 +37,10 @@ class AddDeviceDialog extends StatelessWidget {
|
||||
backgroundColor: Colors.white,
|
||||
title: Text(
|
||||
'Add Accessible Device',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.headlineLarge!
|
||||
.copyWith(fontWeight: FontWeight.w400, fontSize: 24, color: Colors.black),
|
||||
style: Theme.of(context).textTheme.headlineLarge!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 24,
|
||||
color: Colors.black),
|
||||
),
|
||||
content: SizedBox(
|
||||
height: MediaQuery.of(context).size.height / 1.7,
|
||||
@ -69,7 +70,10 @@ class AddDeviceDialog extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
'Only online accessible devices can be added',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 12,
|
||||
color: ColorsManager.grayColor),
|
||||
@ -153,7 +157,8 @@ class AddDeviceDialog extends StatelessWidget {
|
||||
visitorBloc.deviceNameController.clear();
|
||||
visitorBloc.deviceIdController.clear();
|
||||
visitorBloc.unitNameController.clear();
|
||||
visitorBloc.add(FetchDevice()); // Reset to original list
|
||||
visitorBloc.add(
|
||||
FetchDevice()); // Reset to original list
|
||||
},
|
||||
),
|
||||
),
|
||||
@ -173,7 +178,8 @@ class AddDeviceDialog extends StatelessWidget {
|
||||
selectAll: (p0) {
|
||||
visitorBloc.selectedDeviceIds.clear();
|
||||
for (var item in state.data) {
|
||||
visitorBloc.add(SelectDeviceEvent(item.uuid));
|
||||
visitorBloc
|
||||
.add(SelectDeviceEvent(item.uuid));
|
||||
}
|
||||
},
|
||||
onRowSelected: (index, isSelected, row) {
|
||||
@ -194,7 +200,7 @@ class AddDeviceDialog extends StatelessWidget {
|
||||
item.name.toString(),
|
||||
item.uuid.toString(),
|
||||
item.productType.toString(),
|
||||
'',
|
||||
item.spaceName.toString(),
|
||||
item.online.value.toString(),
|
||||
];
|
||||
}).toList(),
|
||||
|
Reference in New Issue
Block a user