mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 03:04:54 +00:00
Fixed design issues
This commit is contained in:
@ -15,10 +15,13 @@ import 'package:syncrow_app/utils/context_extension.dart';
|
||||
|
||||
mixin SceneLogicHelper {
|
||||
bool isOnlyDelayOrDelayLast(List<SceneStaticFunction> tasks) {
|
||||
final lastTask = tasks.last;
|
||||
return tasks.every((task) => task.code == 'delay') ||
|
||||
lastTask.code == 'delay' ||
|
||||
lastTask.deviceId == 'delay';
|
||||
final lastTask = tasks.isNotEmpty ? tasks.last : null;
|
||||
|
||||
return tasks.isNotEmpty
|
||||
? tasks.every((task) => task.code == 'delay') ||
|
||||
lastTask!.code == 'delay' ||
|
||||
lastTask.deviceId == 'delay'
|
||||
: false;
|
||||
}
|
||||
|
||||
void handleSaveButtonPress(
|
||||
@ -177,24 +180,21 @@ mixin SceneLogicHelper {
|
||||
}
|
||||
}
|
||||
|
||||
Widget getTheCorrectDialogBody(
|
||||
SceneStaticFunction taskItem, dynamic functionValue,
|
||||
Widget getTheCorrectDialogBody(SceneStaticFunction taskItem, dynamic functionValue,
|
||||
{required bool isAutomation}) {
|
||||
if (taskItem.operationDialogType == OperationDialogType.temperature) {
|
||||
return AlertDialogTemperatureBody(
|
||||
taskItem: taskItem,
|
||||
functionValue: functionValue ?? taskItem.functionValue,
|
||||
);
|
||||
} else if ((taskItem.operationDialogType ==
|
||||
OperationDialogType.countdown) ||
|
||||
} else if ((taskItem.operationDialogType == OperationDialogType.countdown) ||
|
||||
(taskItem.operationDialogType == OperationDialogType.delay)) {
|
||||
return AlertDialogCountdown(
|
||||
durationValue: taskItem.functionValue ?? 0,
|
||||
functionValue: functionValue ?? taskItem.functionValue,
|
||||
function: taskItem,
|
||||
);
|
||||
} else if (taskItem.operationDialogType ==
|
||||
OperationDialogType.integerSteps) {
|
||||
} else if (taskItem.operationDialogType == OperationDialogType.integerSteps) {
|
||||
return AlertDialogSliderSteps(
|
||||
taskItem: taskItem,
|
||||
functionValue: functionValue ?? taskItem.functionValue,
|
||||
|
||||
Reference in New Issue
Block a user