[FE] Create Scheduling UI (#309)

and funtion name in dialog was olways keep close now it is really take
the real value

<!--
  Thanks for contributing!

Provide a description of your changes below and a general summary in the
title

Please look at the following checklist to ensure that your PR can be
accepted quickly:
-->

## Jira Ticket
[SP-1705](https://syncrow.atlassian.net/browse/SP-1705)

## Description
in curtain Module
fix edit issue and insure function name in  table 

## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [ ]  New feature (non-breaking change which adds functionality)
- [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ]  Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] 🧹 Code refactor
- [ ]  Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore 


[SP-1705]:
https://syncrow.atlassian.net/browse/SP-1705?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This commit is contained in:
Rafeek-khoudare
2025-06-29 13:14:08 +03:00
committed by GitHub
2 changed files with 11 additions and 5 deletions

View File

@ -195,10 +195,10 @@ class _ScheduleTableView extends StatelessWidget {
child: Text(_getSelectedDays( child: Text(_getSelectedDays(
ScheduleModel.parseSelectedDays(schedule.days)))), ScheduleModel.parseSelectedDays(schedule.days)))),
Center(child: Text(formatIsoStringToTime(schedule.time, context))), Center(child: Text(formatIsoStringToTime(schedule.time, context))),
schedule.category == 'CUR_2' if (schedule.category == 'CUR_2')
? Center( Center(child: Text(schedule.function.value))
child: Text(schedule.function.value == true ? 'open' : 'close')) else
: Center(child: Text(schedule.function.value ? 'On' : 'Off')), Center(child: Text(schedule.function.value ? 'On' : 'Off')),
Center( Center(
child: Wrap( child: Wrap(
runAlignment: WrapAlignment.center, runAlignment: WrapAlignment.center,

View File

@ -19,13 +19,19 @@ class ScheduleDialogHelper {
bool isEdit = false, bool isEdit = false,
String? code, String? code,
}) { }) {
bool temp;
if (schedule?.category == 'CUR_2') {
temp = schedule!.function.value == 'open' ? true : false;
} else {
temp = schedule!.function.value;
}
final initialTime = schedule != null final initialTime = schedule != null
? _convertStringToTimeOfDay(schedule.time) ? _convertStringToTimeOfDay(schedule.time)
: TimeOfDay.now(); : TimeOfDay.now();
final initialDays = schedule != null final initialDays = schedule != null
? _convertDaysStringToBooleans(schedule.days) ? _convertDaysStringToBooleans(schedule.days)
: List.filled(7, false); : List.filled(7, false);
bool? functionOn = schedule?.function.value ?? true; bool? functionOn = temp;
TimeOfDay selectedTime = initialTime; TimeOfDay selectedTime = initialTime;
List<bool> selectedDays = List.of(initialDays); List<bool> selectedDays = List.of(initialDays);