fixes unique id for card drag

This commit is contained in:
ashrafzarkanisala
2024-11-24 01:10:31 +03:00
parent 590a41ff83
commit 5e94de5d78
17 changed files with 905 additions and 712 deletions
@@ -39,24 +39,28 @@ class DeviceDialogHelper {
List<DeviceFunction> functions,
) async {
final routineBloc = context.read<RoutineBloc>();
final deviceSelectedFunctions = routineBloc.state.selectedFunctions
.where((f) => f.entityId == data['deviceId'])
.toList();
final deviceSelectedFunctions =
routineBloc.state.selectedFunctions[data['uniqueCustomId']] ?? [];
switch (productType) {
case 'AC':
return ACHelper.showACFunctionsDialog(
context, functions, data['device'], deviceSelectedFunctions);
return ACHelper.showACFunctionsDialog(context, functions,
data['device'], deviceSelectedFunctions, data['uniqueCustomId']);
case '1G':
return OneGangSwitchHelper.showSwitchFunctionsDialog(
context, functions, data['device'], deviceSelectedFunctions);
return OneGangSwitchHelper.showSwitchFunctionsDialog(context, functions,
data['device'], deviceSelectedFunctions, data['uniqueCustomId']);
case '2G':
return TwoGangSwitchHelper.showSwitchFunctionsDialog(
context, functions);
return TwoGangSwitchHelper.showSwitchFunctionsDialog(context, functions,
data['device'], deviceSelectedFunctions, data['uniqueCustomId']);
case '3G':
return ThreeGangSwitchHelper.showSwitchFunctionsDialog(
context, functions);
context,
functions,
data['device'],
deviceSelectedFunctions,
data['uniqueCustomId'],
);
default:
return null;
}