diff --git a/lib/pages/device_managment/garage_door/view/garage_door_control_view.dart b/lib/pages/device_managment/garage_door/view/garage_door_control_view.dart index 30d9bf5d..86ca1317 100644 --- a/lib/pages/device_managment/garage_door/view/garage_door_control_view.dart +++ b/lib/pages/device_managment/garage_door/view/garage_door_control_view.dart @@ -6,6 +6,7 @@ import 'package:syncrow_web/pages/device_managment/garage_door/bloc/garage_door_ import 'package:syncrow_web/pages/device_managment/garage_door/helper/garage_door_helper.dart'; import 'package:syncrow_web/pages/device_managment/garage_door/models/garage_door_model.dart'; import 'package:syncrow_web/pages/device_managment/garage_door/schedule_view/schedule_garage_view.dart'; +import 'package:syncrow_web/pages/device_managment/schedule_device/schedule_widgets/schedual_view.dart'; import 'package:syncrow_web/pages/device_managment/shared/icon_name_status_container.dart'; import 'package:syncrow_web/pages/device_managment/shared/table/report_table.dart'; import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart'; @@ -94,11 +95,18 @@ class GarageDoorControlView extends StatelessWidget FetchGarageDoorSchedulesEvent( deviceId: deviceId, category: 'doorcontact_state'), ); - showDialog( + + showDialog( context: context, builder: (ctx) => BlocProvider.value( value: BlocProvider.of(context), - child: BuildGarageDoorScheduleView(status: status), + child: BuildScheduleView( + deviceUuid: deviceId, + category: 'Timer', + code: 'doorcontact_state', + countdownCode: 'Timer', + deviceType: 'GD', + ), )); }, name: 'Scheduling', diff --git a/lib/pages/device_managment/schedule_device/bloc/schedule_bloc.dart b/lib/pages/device_managment/schedule_device/bloc/schedule_bloc.dart index 62bef920..11b2ebbb 100644 --- a/lib/pages/device_managment/schedule_device/bloc/schedule_bloc.dart +++ b/lib/pages/device_managment/schedule_device/bloc/schedule_bloc.dart @@ -287,7 +287,8 @@ class ScheduleBloc extends Bloc { try { if (state is ScheduleLoaded) { Status status = Status(code: '', value: ''); - if (event.deviceType == 'CUR_2') { + if (event.deviceType == 'CUR_2' || + event.deviceType == 'GD' ) { status = status.copyWith( code: 'control', value: event.functionOn == true ? 'open' : 'close'); diff --git a/lib/pages/device_managment/schedule_device/schedule_widgets/count_down_button.dart b/lib/pages/device_managment/schedule_device/schedule_widgets/count_down_button.dart index 8fa1e290..752f2243 100644 --- a/lib/pages/device_managment/schedule_device/schedule_widgets/count_down_button.dart +++ b/lib/pages/device_managment/schedule_device/schedule_widgets/count_down_button.dart @@ -69,7 +69,7 @@ class CountdownModeButtons extends StatelessWidget { countDownCode: countDownCode), ); }, - backgroundColor: ColorsManager.primaryColorWithOpacity, + backgroundColor: ColorsManager.secondaryColor, child: const Text('Save'), ), ), diff --git a/lib/pages/device_managment/schedule_device/schedule_widgets/inching_mode_buttons.dart b/lib/pages/device_managment/schedule_device/schedule_widgets/inching_mode_buttons.dart index e8dc5e79..c8fe1357 100644 --- a/lib/pages/device_managment/schedule_device/schedule_widgets/inching_mode_buttons.dart +++ b/lib/pages/device_managment/schedule_device/schedule_widgets/inching_mode_buttons.dart @@ -63,7 +63,7 @@ class InchingModeButtons extends StatelessWidget { ), ); }, - backgroundColor: ColorsManager.primaryColor, + backgroundColor: ColorsManager.secondaryColor, child: const Text('Save'), ), ), diff --git a/lib/pages/device_managment/schedule_device/schedule_widgets/schedual_view.dart b/lib/pages/device_managment/schedule_device/schedule_widgets/schedual_view.dart index d5194f35..5103e9d0 100644 --- a/lib/pages/device_managment/schedule_device/schedule_widgets/schedual_view.dart +++ b/lib/pages/device_managment/schedule_device/schedule_widgets/schedual_view.dart @@ -31,11 +31,12 @@ class BuildScheduleView extends StatelessWidget { @override Widget build(BuildContext context) { return BlocProvider( - create: (_) => ScheduleBloc(deviceId: deviceUuid,) + create: (_) => ScheduleBloc( + deviceId: deviceUuid, + ) ..add(ScheduleGetEvent(category: category)) ..add(ScheduleFetchStatusEvent( - deviceId: deviceUuid, - countdownCode: countdownCode ?? '')), + deviceId: deviceUuid, countdownCode: countdownCode ?? '')), child: Dialog( backgroundColor: Colors.white, insetPadding: const EdgeInsets.all(20), @@ -56,7 +57,7 @@ class BuildScheduleView extends StatelessWidget { children: [ const ScheduleHeader(), const SizedBox(height: 20), - if (deviceType == 'CUR_2') + if (deviceType == 'CUR_2' || deviceType == 'GD') const SizedBox() else ScheduleModeSelector( @@ -76,8 +77,7 @@ class BuildScheduleView extends StatelessWidget { category: category, time: '', function: Status( - code: code.toString(), - value: true), + code: code.toString(), value: true), days: [], ), isEdit: false, @@ -96,7 +96,7 @@ class BuildScheduleView extends StatelessWidget { } }, ), - if (deviceType != 'CUR_2') + if (deviceType != 'CUR_2'|| deviceType != 'GD') if (state.scheduleMode == ScheduleModes.countdown || state.scheduleMode == ScheduleModes.inching) CountdownInchingView( diff --git a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_managment_ui.dart b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_managment_ui.dart index 39899fe5..924524f0 100644 --- a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_managment_ui.dart +++ b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_managment_ui.dart @@ -24,12 +24,13 @@ class ScheduleManagementUI extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - width: 170, + width: 177, height: 40, child: DefaultButton( - borderColor: ColorsManager.grayColor.withOpacity(0.5), - padding: 2, - backgroundColor: ColorsManager.graysColor, + borderWidth: 4, + borderColor: ColorsManager.neutralGray, + padding: 8, + backgroundColor: ColorsManager.textFieldGreyColor, borderRadius: 15, onPressed: onAddSchedule, child: Row( diff --git a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_buttons.dart b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_buttons.dart index f1df1f20..76accf60 100644 --- a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_buttons.dart +++ b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_buttons.dart @@ -39,7 +39,7 @@ class ScheduleModeButtons extends StatelessWidget { borderRadius: 8, height: 40, onPressed: onSave, - backgroundColor: ColorsManager.primaryColorWithOpacity, + backgroundColor: ColorsManager.secondaryColor, child: const Text('Save'), ), ), diff --git a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_table.dart b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_table.dart index c1771c1b..8dc4d211 100644 --- a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_table.dart +++ b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_table.dart @@ -194,7 +194,7 @@ class _ScheduleTableView extends StatelessWidget { child: Text(_getSelectedDays( ScheduleModel.parseSelectedDays(schedule.days)))), Center(child: Text(formatIsoStringToTime(schedule.time, context))), - if (deviceType == 'CUR_2') + if (deviceType == 'CUR_2' || deviceType == 'GD') Center( child: Text(schedule.function.value == true ? 'open' : 'close')) else diff --git a/lib/pages/device_managment/water_heater/helper/add_schedule_dialog_helper.dart b/lib/pages/device_managment/water_heater/helper/add_schedule_dialog_helper.dart index e5695b9e..d94a75d0 100644 --- a/lib/pages/device_managment/water_heater/helper/add_schedule_dialog_helper.dart +++ b/lib/pages/device_managment/water_heater/helper/add_schedule_dialog_helper.dart @@ -23,7 +23,7 @@ class ScheduleDialogHelper { required String deviceType, }) { bool temp; - if (deviceType == 'CUR_2') { + if (deviceType == 'CUR_2' || deviceType == 'GD') { temp = schedule!.function.value == 'open' ? true : false; } else { temp = schedule!.function.value; @@ -116,7 +116,7 @@ class ScheduleDialogHelper { ScheduleModeButtons( onSave: () { dynamic temp; - if (deviceType == 'CUR_2') { + if (deviceType == 'CUR_2' || deviceType == 'GD') { temp = functionOn! ? 'open' : 'close'; } else { temp = functionOn; @@ -202,18 +202,23 @@ class ScheduleDialogHelper { ), const SizedBox(width: 10), Radio( + activeColor: ColorsManager.secondaryColor, + focusColor: ColorsManager.secondaryColor, value: true, groupValue: isOn, onChanged: (val) => onChanged(true), ), - Text(categor == 'CUR_2' ? 'open' : 'On'), + Text(categor == 'CUR_2' || categor == 'GD' ? 'open' : 'On'), const SizedBox(width: 10), Radio( + activeColor: ColorsManager.secondaryColor, + focusColor: ColorsManager.secondaryColor, + value: false, groupValue: isOn, onChanged: (val) => onChanged(false), ), - Text(categor == 'CUR_2' ? 'close' : 'Off'), + Text(categor == 'CUR_2' || categor == 'GDCUR_2' ? 'close' : 'Off'), ], ); }