add close open if it is curtain module for schdule

This commit is contained in:
Rafeek-Khoudare
2025-06-29 10:50:51 +03:00
parent 5827ba4296
commit a1562110d5

View File

@ -97,7 +97,8 @@ class ScheduleDialogHelper {
setState(() => selectedDays[i] = v);
}),
const SizedBox(height: 16),
_buildFunctionSwitch(ctx, functionOn!, (v) {
_buildFunctionSwitch(schedule!.category, ctx, functionOn!,
(v) {
setState(() => functionOn = v);
}),
],
@ -197,7 +198,7 @@ class ScheduleDialogHelper {
}
static Widget _buildFunctionSwitch(
BuildContext ctx, bool isOn, Function(bool) onChanged) {
String categor, BuildContext ctx, bool isOn, Function(bool) onChanged) {
return Row(
children: [
Text(
@ -211,14 +212,14 @@ class ScheduleDialogHelper {
groupValue: isOn,
onChanged: (val) => onChanged(true),
),
const Text('On'),
Text(categor == 'CUR_2' ? 'open' : 'On'),
const SizedBox(width: 10),
Radio<bool>(
value: false,
groupValue: isOn,
onChanged: (val) => onChanged(false),
),
const Text('Off'),
Text(categor == 'CUR_2' ? 'close' : 'Off'),
],
);
}