Merge branch 'dev' of https://github.com/SyncrowIOT/web into SP-1275-FE-Identify-Add-Ceiling-Sensor-Card-to-IF-THEN-Sections

This commit is contained in:
Faris Armoush
2025-04-09 13:21:43 +03:00
17 changed files with 630 additions and 82 deletions

View File

@ -27,8 +27,8 @@ class IfContainer extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('IF',
style: TextStyle(
fontSize: 18, fontWeight: FontWeight.bold)),
style:
TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
if (state.isAutomation && state.ifItems.isNotEmpty)
AutomationOperatorSelector(
selectedOperator: state.selectedAutomationOperator),
@ -55,8 +55,8 @@ class IfContainer extends StatelessWidget {
(index) => GestureDetector(
onTap: () async {
if (!state.isTabToRun) {
final result = await DeviceDialogHelper
.showDeviceDialog(
final result =
await DeviceDialogHelper.showDeviceDialog(
context: context,
data: state.ifItems[index],
removeComparetors: false,
@ -72,6 +72,7 @@ class IfContainer extends StatelessWidget {
'2G',
'3G',
'WPS',
'GW',
'CPS',
].contains(
state.ifItems[index]['productType'])) {
@ -82,8 +83,7 @@ class IfContainer extends StatelessWidget {
}
},
child: DraggableCard(
imagePath:
state.ifItems[index]['imagePath'] ?? '',
imagePath: state.ifItems[index]['imagePath'] ?? '',
title: state.ifItems[index]['title'] ?? '',
deviceData: state.ifItems[index],
padding: const EdgeInsets.symmetric(
@ -91,12 +91,11 @@ class IfContainer extends StatelessWidget {
isFromThen: false,
isFromIf: true,
onRemove: () {
context.read<RoutineBloc>().add(
RemoveDragCard(
index: index,
isFromThen: false,
key: state.ifItems[index]
['uniqueCustomId']));
context.read<RoutineBloc>().add(RemoveDragCard(
index: index,
isFromThen: false,
key: state.ifItems[index]
['uniqueCustomId']));
},
),
)),
@ -116,9 +115,7 @@ class IfContainer extends StatelessWidget {
if (!state.isTabToRun) {
if (mutableData['deviceId'] == 'tab_to_run') {
context
.read<RoutineBloc>()
.add(AddToIfContainer(mutableData, true));
context.read<RoutineBloc>().add(AddToIfContainer(mutableData, true));
} else {
final result = await DeviceDialogHelper.showDeviceDialog(
dialogType: 'IF',
@ -130,7 +127,7 @@ class IfContainer extends StatelessWidget {
context
.read<RoutineBloc>()
.add(AddToIfContainer(mutableData, false));
} else if (!['AC', '1G', '2G', '3G', 'WPS', 'CPS']
} else if (!['AC', '1G', '2G', '3G', 'WPS', 'GW', 'CPS']
.contains(mutableData['productType'])) {
context
.read<RoutineBloc>()