mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
fix edit problem
and funtion name in dialog was olways keep close now it is really take the real value
This commit is contained in:
@ -195,10 +195,10 @@ class _ScheduleTableView extends StatelessWidget {
|
||||
child: Text(_getSelectedDays(
|
||||
ScheduleModel.parseSelectedDays(schedule.days)))),
|
||||
Center(child: Text(formatIsoStringToTime(schedule.time, context))),
|
||||
schedule.category == 'CUR_2'
|
||||
? Center(
|
||||
child: Text(schedule.function.value == true ? 'open' : 'close'))
|
||||
: Center(child: Text(schedule.function.value ? 'On' : 'Off')),
|
||||
if (schedule.category == 'CUR_2')
|
||||
Center(child: Text(schedule.function.value))
|
||||
else
|
||||
Center(child: Text(schedule.function.value ? 'On' : 'Off')),
|
||||
Center(
|
||||
child: Wrap(
|
||||
runAlignment: WrapAlignment.center,
|
||||
|
@ -19,13 +19,19 @@ class ScheduleDialogHelper {
|
||||
bool isEdit = false,
|
||||
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
|
||||
? _convertStringToTimeOfDay(schedule.time)
|
||||
: TimeOfDay.now();
|
||||
final initialDays = schedule != null
|
||||
? _convertDaysStringToBooleans(schedule.days)
|
||||
: List.filled(7, false);
|
||||
bool? functionOn = schedule?.function.value ?? true;
|
||||
bool? functionOn = temp;
|
||||
TimeOfDay selectedTime = initialTime;
|
||||
List<bool> selectedDays = List.of(initialDays);
|
||||
|
||||
|
Reference in New Issue
Block a user