mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 11:54:55 +00:00
Implement Flush Mounted Presence Sensor Routine Control and change the device type logic
This commit is contained in:
@ -7,12 +7,12 @@ 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,
|
||||
required this.isAutomation,
|
||||
});
|
||||
const AlertDialogSliderSteps(
|
||||
{super.key,
|
||||
this.functionValue,
|
||||
required this.taskItem,
|
||||
required this.isAutomation,
|
||||
});
|
||||
|
||||
final dynamic functionValue;
|
||||
final SceneStaticFunction taskItem;
|
||||
@ -108,67 +108,69 @@ class _AlertDialogSliderStepsState extends State<AlertDialogSliderSteps> {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ToggleButtons(
|
||||
isSelected: [
|
||||
selectedToggleIndex == 0,
|
||||
selectedToggleIndex == 1,
|
||||
selectedToggleIndex == 2
|
||||
],
|
||||
onPressed: (index) {
|
||||
setState(() {
|
||||
selectedToggleIndex = index;
|
||||
});
|
||||
context.read<CreateSceneBloc>().add(
|
||||
SelectedValueEvent(
|
||||
value: _deNormalizeValue(groupValue),
|
||||
code: widget.taskItem.code,
|
||||
isAutomation: widget.isAutomation,
|
||||
comparator: _indexToComparator(selectedToggleIndex),
|
||||
widget.isAutomation
|
||||
? ToggleButtons(
|
||||
isSelected: [
|
||||
selectedToggleIndex == 0,
|
||||
selectedToggleIndex == 1,
|
||||
selectedToggleIndex == 2
|
||||
],
|
||||
onPressed: (index) {
|
||||
setState(() {
|
||||
selectedToggleIndex = index;
|
||||
});
|
||||
context.read<CreateSceneBloc>().add(
|
||||
SelectedValueEvent(
|
||||
value: _deNormalizeValue(groupValue),
|
||||
code: widget.taskItem.code,
|
||||
isAutomation: widget.isAutomation,
|
||||
comparator: _indexToComparator(selectedToggleIndex),
|
||||
),
|
||||
);
|
||||
},
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
selectedColor: Colors.white,
|
||||
color: ColorsManager.blackColor,
|
||||
fillColor: ColorsManager.primaryColorWithOpacity,
|
||||
borderColor: ColorsManager.greyColor,
|
||||
constraints: BoxConstraints.tight(const Size(70, 30)),
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 30,
|
||||
child: Container(
|
||||
color: selectedToggleIndex == 0
|
||||
? ColorsManager.primaryColorWithOpacity
|
||||
: ColorsManager.greyColor,
|
||||
alignment: Alignment.center,
|
||||
child: const Text("<"),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
selectedColor: Colors.white,
|
||||
color: ColorsManager.blackColor,
|
||||
fillColor: ColorsManager.primaryColorWithOpacity,
|
||||
borderColor: ColorsManager.greyColor,
|
||||
constraints: BoxConstraints.tight(const Size(70, 30)),
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 30,
|
||||
child: Container(
|
||||
color: selectedToggleIndex == 0
|
||||
? ColorsManager.primaryColorWithOpacity
|
||||
: ColorsManager.greyColor,
|
||||
alignment: Alignment.center,
|
||||
child: const Text("<"),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 30,
|
||||
child: Container(
|
||||
color: selectedToggleIndex == 1
|
||||
? ColorsManager.primaryColorWithOpacity
|
||||
: ColorsManager.greyColor,
|
||||
alignment: Alignment.center,
|
||||
child: const Text("="),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 30,
|
||||
child: Container(
|
||||
color: selectedToggleIndex == 2
|
||||
? ColorsManager.primaryColorWithOpacity
|
||||
: ColorsManager.greyColor,
|
||||
alignment: Alignment.center,
|
||||
child: const Text(">"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 30,
|
||||
child: Container(
|
||||
color: selectedToggleIndex == 1
|
||||
? ColorsManager.primaryColorWithOpacity
|
||||
: ColorsManager.greyColor,
|
||||
alignment: Alignment.center,
|
||||
child: const Text("="),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 30,
|
||||
child: Container(
|
||||
color: selectedToggleIndex == 2
|
||||
? ColorsManager.primaryColorWithOpacity
|
||||
: ColorsManager.greyColor,
|
||||
alignment: Alignment.center,
|
||||
child: const Text(">"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: SizedBox(),
|
||||
const SizedBox(height: 12),
|
||||
...widget.taskItem.operationalValues.map(
|
||||
(operation) => BlocBuilder<CreateSceneBloc, CreateSceneState>(
|
||||
|
||||
Reference in New Issue
Block a user