mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 21:44:54 +00:00
updated add to room, and verify to space
This commit is contained in:
@ -77,10 +77,25 @@ class AssignDeviceView extends StatelessWidget {
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (state.roomDevicesId[state
|
||||
.allDevices[index]
|
||||
.uuid!] ??
|
||||
false == false) {
|
||||
bool isAssigned =
|
||||
state.roomDevicesId[state
|
||||
.allDevices[index]
|
||||
.uuid!] ??
|
||||
false;
|
||||
if (isAssigned) {
|
||||
BlocProvider.of<
|
||||
ManageUnitBloc>(
|
||||
context)
|
||||
.add(UnassignRoomEvent(
|
||||
deviceId: state
|
||||
.allDevices[
|
||||
index]
|
||||
.uuid ??
|
||||
'',
|
||||
unit: unit,
|
||||
roomId: roomId));
|
||||
} else {
|
||||
// Tick (assign) the device
|
||||
BlocProvider.of<
|
||||
ManageUnitBloc>(
|
||||
context)
|
||||
|
||||
Reference in New Issue
Block a user