mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-23 10:47:55 +00:00
push integer step dialog design
This commit is contained in:
@@ -187,8 +187,11 @@ class ACFunctionsHelper {
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsCelsiusDegrees,
|
||||
value: 0,
|
||||
description: 'COOL TO',
|
||||
value: 0.0,
|
||||
description: '°C',
|
||||
minValue: 20,
|
||||
maxValue: 30,
|
||||
stepValue: 0.5,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -203,8 +206,11 @@ class ACFunctionsHelper {
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsCelsiusDegrees,
|
||||
value: 0,
|
||||
description: 'COOL TO',
|
||||
value: 0.0,
|
||||
description: '°C',
|
||||
minValue: -9.9,
|
||||
maxValue: 99.9,
|
||||
stepValue: 0.1,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -41,7 +41,10 @@ class DoorLockHelperFunctions {
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
description: "",
|
||||
value: 0,
|
||||
value: 0.0,
|
||||
minValue: 0.0,
|
||||
maxValue: 999,
|
||||
stepValue: 1.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -57,7 +60,10 @@ class DoorLockHelperFunctions {
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
description: "",
|
||||
value: 0,
|
||||
value: 0.0,
|
||||
minValue: 0.0,
|
||||
maxValue: 999,
|
||||
stepValue: 1.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -73,7 +79,10 @@ class DoorLockHelperFunctions {
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
description: "",
|
||||
value: 0,
|
||||
value: 0.0,
|
||||
minValue: 0.0,
|
||||
maxValue: 999,
|
||||
stepValue: 1.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -84,8 +93,14 @@ class DoorLockHelperFunctions {
|
||||
operationName: 'Lock Alarm',
|
||||
functionValue: functionValue,
|
||||
code: 'alarm_lock',
|
||||
operationDialogType: OperationDialogType.none,
|
||||
operationalValues: [],
|
||||
operationDialogType: OperationDialogType.listOfOptions,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFingerprintUnlock,
|
||||
description: "Fingerprint Mismatch",
|
||||
value: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
SceneStaticFunction(
|
||||
deviceId: deviceId,
|
||||
@@ -99,7 +114,10 @@ class DoorLockHelperFunctions {
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
description: "",
|
||||
value: 0,
|
||||
value: 0.0,
|
||||
minValue: 0,
|
||||
maxValue: 90,
|
||||
stepValue: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -115,7 +133,10 @@ class DoorLockHelperFunctions {
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
description: "",
|
||||
value: 0,
|
||||
value: 0.0,
|
||||
minValue: 0,
|
||||
maxValue: 100,
|
||||
stepValue: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -152,7 +173,10 @@ class DoorLockHelperFunctions {
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
description: "",
|
||||
value: 0,
|
||||
value: 0.0,
|
||||
minValue: 0,
|
||||
maxValue: 999,
|
||||
stepValue: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -231,7 +255,10 @@ class DoorLockHelperFunctions {
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
description: "",
|
||||
value: 0,
|
||||
value: 0.0,
|
||||
minValue: 0,
|
||||
maxValue: 999,
|
||||
stepValue: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -171,4 +171,239 @@ class HumanPresenceHelperFunctions {
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
static List<SceneStaticFunction> automationHumanPresenceFunctions(
|
||||
String deviceId, String deviceName, functionValue) {
|
||||
return [
|
||||
SceneStaticFunction(
|
||||
deviceId: deviceId,
|
||||
deviceName: deviceName,
|
||||
icon: Assets.assetsPresenceState,
|
||||
operationName: 'Presence State',
|
||||
code: 'presence_state',
|
||||
functionValue: functionValue,
|
||||
operationDialogType: OperationDialogType.listOfOptions,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsIconsPresenceSensorAssetsEmpty,
|
||||
value: 'none',
|
||||
description: 'None',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsPresence,
|
||||
value: 'presence',
|
||||
description: 'Presence',
|
||||
),
|
||||
],
|
||||
),
|
||||
SceneStaticFunction(
|
||||
deviceId: deviceId,
|
||||
deviceName: deviceName,
|
||||
icon: Assets.assetsIconsPresenceSensorAssetsDistance,
|
||||
operationName: 'Current Distance',
|
||||
code: 'dis_current',
|
||||
functionValue: functionValue,
|
||||
operationDialogType: OperationDialogType.integerSteps,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
value: 0.0,
|
||||
description: "CM",
|
||||
minValue: 1,
|
||||
maxValue: 600,
|
||||
stepValue: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
SceneStaticFunction(
|
||||
deviceId: deviceId,
|
||||
deviceName: deviceName,
|
||||
icon: Assets.assetsIconsPresenceSensorAssetsIlluminanceValue,
|
||||
operationName: 'Illuminance Value',
|
||||
code: 'illuminance_value',
|
||||
functionValue: functionValue,
|
||||
operationDialogType: OperationDialogType.integerSteps,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
value: 0.0,
|
||||
description: "Lux",
|
||||
minValue: 0,
|
||||
maxValue: 10000,
|
||||
stepValue: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
SceneStaticFunction(
|
||||
deviceId: deviceId,
|
||||
deviceName: deviceName,
|
||||
icon: Assets.assetsFarDetection,
|
||||
operationName: 'Far Detection',
|
||||
code: 'far_detection',
|
||||
functionValue: functionValue,
|
||||
operationDialogType: OperationDialogType.listOfOptions,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 75,
|
||||
description: '75cm',
|
||||
iconValue: '75',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 150,
|
||||
description: '150cm',
|
||||
iconValue: '150',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 225,
|
||||
description: '225cm',
|
||||
iconValue: '225',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 300,
|
||||
description: '300cm',
|
||||
iconValue: '300',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 375,
|
||||
description: '375cm',
|
||||
iconValue: '375',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 450,
|
||||
description: '450cm',
|
||||
iconValue: '450',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 525,
|
||||
description: '525cm',
|
||||
iconValue: '525',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 600,
|
||||
description: '600cm',
|
||||
iconValue: '600',
|
||||
),
|
||||
],
|
||||
),
|
||||
SceneStaticFunction(
|
||||
deviceId: deviceId,
|
||||
deviceName: deviceName,
|
||||
icon: Assets.assetsMotionDetection,
|
||||
operationName: 'Motion Detection Sensitivity',
|
||||
code: 'motion_sensitivity_value',
|
||||
functionValue: functionValue,
|
||||
operationDialogType: OperationDialogType.listOfOptions,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 1,
|
||||
description: 1.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 2,
|
||||
description: 2.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 3,
|
||||
description: 3.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 4,
|
||||
description: 4.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 5,
|
||||
description: 5.toString(),
|
||||
),
|
||||
],
|
||||
),
|
||||
SceneStaticFunction(
|
||||
deviceId: deviceId,
|
||||
deviceName: deviceName,
|
||||
icon: Assets.assetsMotionlessDetection,
|
||||
operationName: 'Motionless Detection Sensitivity',
|
||||
code: 'motionless_sensitivity',
|
||||
functionValue: functionValue,
|
||||
operationDialogType: OperationDialogType.listOfOptions,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
iconValue: '1',
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 1,
|
||||
description: '1',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 2,
|
||||
description: '2',
|
||||
iconValue: '2',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 3,
|
||||
description: '3',
|
||||
iconValue: '3',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 4,
|
||||
description: '4',
|
||||
iconValue: '4',
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFarDetectionFunction,
|
||||
value: 5,
|
||||
description: '5',
|
||||
iconValue: '5',
|
||||
),
|
||||
],
|
||||
),
|
||||
SceneStaticFunction(
|
||||
deviceId: deviceId,
|
||||
deviceName: deviceName,
|
||||
icon: Assets.assetsIndicator,
|
||||
operationName: 'Indicator',
|
||||
code: 'indicator',
|
||||
functionValue: functionValue,
|
||||
operationDialogType: OperationDialogType.onOff,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsAcPower, description: "ON", value: true),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
|
||||
],
|
||||
),
|
||||
SceneStaticFunction(
|
||||
deviceId: deviceId,
|
||||
deviceName: deviceName,
|
||||
icon: Assets.assetsIconsPresenceSensorAssetsTime,
|
||||
operationName: 'Presence Time',
|
||||
code: 'presence_time',
|
||||
functionValue: functionValue,
|
||||
operationDialogType: OperationDialogType.integerSteps,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: '',
|
||||
value: 0.0,
|
||||
minValue: 0.0,
|
||||
maxValue: 65535,
|
||||
stepValue: 1,
|
||||
description: 'min'
|
||||
),
|
||||
],
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,57 +106,15 @@ class PresenceSensorHelperFunctions {
|
||||
operationName: 'Sensitivity',
|
||||
code: 'sensitivity',
|
||||
functionValue: functionValue,
|
||||
operationDialogType: OperationDialogType.listOfOptions,
|
||||
operationDialogType: OperationDialogType.integerSteps,
|
||||
operationalValues: [
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 1,
|
||||
description: 1.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 2,
|
||||
description: 2.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 3,
|
||||
description: 3.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 4,
|
||||
description: 4.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 5,
|
||||
description: 5.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 6,
|
||||
description: 6.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 7,
|
||||
description: 7.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 8,
|
||||
description: 8.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 9,
|
||||
description: 9.toString(),
|
||||
),
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsSensitivityOperationIcon,
|
||||
value: 10,
|
||||
description: 10.toString(),
|
||||
icon: '',
|
||||
description: "",
|
||||
value: 0.0,
|
||||
minValue: 0,
|
||||
maxValue: 10,
|
||||
stepValue: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
|
||||
|
||||
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_countdown.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_functions_body.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_slider_steps.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_temperature_body.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
|
||||
@@ -96,6 +97,12 @@ mixin SceneLogicHelper {
|
||||
functionValue: functionValue ?? taskItem.functionValue,
|
||||
function: taskItem,
|
||||
);
|
||||
} else if (taskItem.operationDialogType ==
|
||||
OperationDialogType.integerSteps) {
|
||||
return AlertDialogSliderSteps(
|
||||
taskItem: taskItem,
|
||||
functionValue: functionValue ?? taskItem.functionValue,
|
||||
);
|
||||
}
|
||||
|
||||
return AlertDialogFunctionsOperationsBody(
|
||||
|
||||
@@ -166,6 +166,10 @@ mixin SceneOperationsDataHelper {
|
||||
required functionValue,
|
||||
required bool isAutomation,
|
||||
}) {
|
||||
if (isAutomation) {
|
||||
return HumanPresenceHelperFunctions.automationHumanPresenceFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
}
|
||||
return HumanPresenceHelperFunctions.tabToRunHumanPresenceFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
}
|
||||
|
||||
@@ -130,12 +130,18 @@ class SceneOperationalValue {
|
||||
final dynamic value;
|
||||
final String? description;
|
||||
final String? iconValue;
|
||||
final double? minValue;
|
||||
final double? maxValue;
|
||||
final double? stepValue;
|
||||
|
||||
SceneOperationalValue({
|
||||
required this.icon,
|
||||
required this.value,
|
||||
this.description,
|
||||
this.iconValue,
|
||||
this.minValue,
|
||||
this.maxValue,
|
||||
this.stepValue,
|
||||
});
|
||||
|
||||
SceneOperationalValue copyWith({
|
||||
@@ -143,12 +149,18 @@ class SceneOperationalValue {
|
||||
dynamic value,
|
||||
String? description,
|
||||
String? iconValue,
|
||||
double? minValue,
|
||||
double? maxValue,
|
||||
double? stepValue,
|
||||
}) {
|
||||
return SceneOperationalValue(
|
||||
icon: icon ?? this.icon,
|
||||
value: value ?? this.value,
|
||||
description: description ?? this.description,
|
||||
iconValue: iconValue ?? this.iconValue,
|
||||
minValue: minValue ?? this.minValue,
|
||||
maxValue: maxValue ?? this.maxValue,
|
||||
stepValue: stepValue ?? this.stepValue,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -157,7 +169,10 @@ class SceneOperationalValue {
|
||||
'icon': icon,
|
||||
'value': value,
|
||||
'description': description,
|
||||
'iconValue': iconValue
|
||||
'iconValue': iconValue,
|
||||
'minValue': minValue,
|
||||
'maxValue': maxValue,
|
||||
'stepValue': stepValue
|
||||
};
|
||||
}
|
||||
|
||||
@@ -167,6 +182,9 @@ class SceneOperationalValue {
|
||||
value: map['value'],
|
||||
description: map['description'],
|
||||
iconValue: map['iconValue'] ?? '',
|
||||
minValue: map['minValue'],
|
||||
maxValue: map['maxValue'],
|
||||
stepValue: map['stepValue'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -177,7 +195,7 @@ class SceneOperationalValue {
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
'StaticFunctionOperationHelper(icon: $icon, value: $value, description: $description, iconValue: $iconValue)';
|
||||
'StaticFunctionOperationHelper(icon: $icon, value: $value, description: $description, iconValue: $iconValue, minValue: $minValue, maxValue: $maxValue, stepValue: $stepValue)';
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
@@ -187,6 +205,9 @@ class SceneOperationalValue {
|
||||
other.icon == icon &&
|
||||
other.description == description &&
|
||||
other.iconValue == iconValue &&
|
||||
other.minValue == minValue &&
|
||||
other.maxValue == maxValue &&
|
||||
other.stepValue == stepValue &&
|
||||
other.value == value;
|
||||
}
|
||||
|
||||
@@ -196,5 +217,8 @@ class SceneOperationalValue {
|
||||
value.hashCode ^
|
||||
description.hashCode ^
|
||||
iconValue.hashCode ^
|
||||
minValue.hashCode ^
|
||||
maxValue.hashCode ^
|
||||
stepValue.hashCode ^
|
||||
description.hashCode;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_small.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class AlertDialogSliderSteps extends StatefulWidget {
|
||||
const AlertDialogSliderSteps({
|
||||
super.key,
|
||||
this.functionValue,
|
||||
required this.taskItem,
|
||||
});
|
||||
|
||||
final dynamic functionValue;
|
||||
final SceneStaticFunction taskItem;
|
||||
|
||||
@override
|
||||
State<AlertDialogSliderSteps> createState() => _AlertDialogSliderStepsState();
|
||||
}
|
||||
|
||||
class _AlertDialogSliderStepsState extends State<AlertDialogSliderSteps> {
|
||||
double? groupValue;
|
||||
int selectedToggleIndex = 0;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
final tempTaskList = context.read<CreateSceneBloc>().tempTasksList;
|
||||
if (tempTaskList.isNotEmpty) {
|
||||
for (var element in tempTaskList) {
|
||||
if (element.code == widget.taskItem.code) {
|
||||
groupValue = element.functionValue;
|
||||
} else {
|
||||
context
|
||||
.read<CreateSceneBloc>()
|
||||
.add(RemoveFromSelectedValueById(code: widget.taskItem.code));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (widget.functionValue != null) {
|
||||
setState(() {
|
||||
groupValue = widget.functionValue;
|
||||
});
|
||||
} else {
|
||||
groupValue = widget.taskItem.operationalValues[0].minValue;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ToggleButtons(
|
||||
isSelected: [
|
||||
selectedToggleIndex == 0,
|
||||
selectedToggleIndex == 1,
|
||||
selectedToggleIndex == 2
|
||||
],
|
||||
onPressed: (index) {
|
||||
setState(() {
|
||||
selectedToggleIndex = index;
|
||||
});
|
||||
},
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
selectedColor: Colors.white,
|
||||
color: ColorsManager.blackColor,
|
||||
fillColor: ColorsManager.primaryColorWithOpacity,
|
||||
constraints: const BoxConstraints(minHeight: 30, minWidth: 30),
|
||||
children: const [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
||||
child: Text("<"),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
||||
child: Text("="),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
||||
child: Text(">"),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
...widget.taskItem.operationalValues.map(
|
||||
(operation) => BlocBuilder<CreateSceneBloc, CreateSceneState>(
|
||||
builder: (context, state) {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
TitleMedium(
|
||||
text: groupValue?.toStringAsFixed(1) ?? "0",
|
||||
style: context.titleMedium.copyWith(
|
||||
color: ColorsManager.primaryColorWithOpacity,
|
||||
fontSize: 30,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
TitleMedium(
|
||||
text: operation.description.toString(),
|
||||
style: context.titleMedium.copyWith(
|
||||
color: ColorsManager.primaryColorWithOpacity,
|
||||
fontSize: 30,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Slider(
|
||||
value: groupValue ?? 0,
|
||||
min: operation.minValue?.toDouble() ?? 0,
|
||||
max: operation.maxValue?.toDouble() ?? 0,
|
||||
inactiveColor: ColorsManager.primaryColorWithOpacity,
|
||||
divisions: operation.stepValue != null
|
||||
? ((operation.maxValue!.toDouble() -
|
||||
operation.minValue!.toDouble()) /
|
||||
operation.stepValue!.toDouble())
|
||||
.round()
|
||||
: null,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
groupValue = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1024,4 +1024,9 @@ class Assets {
|
||||
|
||||
static const String assetsCurrentTemp =
|
||||
"assets/icons/functions_icons/automation_functions/current_temp.svg";
|
||||
|
||||
//assets/icons/functions_icons/automation_functions/presence_state.svg
|
||||
|
||||
static const String assetsPresenceState =
|
||||
"assets/icons/functions_icons/automation_functions/presence_state.svg";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user