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 b28a6a23..8fa1e290 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 @@ -29,7 +29,9 @@ class CountdownModeButtons extends StatelessWidget { children: [ Expanded( child: DefaultButton( + elevation: 2.5, height: 40, + borderRadius: 8, onPressed: () => Navigator.pop(context), backgroundColor: ColorsManager.boxColor, child: Text('Cancel', style: context.textTheme.bodyMedium), @@ -39,6 +41,8 @@ class CountdownModeButtons extends StatelessWidget { Expanded( child: isActive ? DefaultButton( + elevation: 2.5, + borderRadius: 8, height: 40, onPressed: () { context.read().add( @@ -49,10 +53,12 @@ class CountdownModeButtons extends StatelessWidget { ), ); }, - backgroundColor: Colors.red, + backgroundColor: ColorsManager.red100, child: const Text('Stop'), ) : DefaultButton( + elevation: 2.5, + borderRadius: 8, height: 40, onPressed: () { context.read().add( @@ -63,7 +69,7 @@ class CountdownModeButtons extends StatelessWidget { countDownCode: countDownCode), ); }, - backgroundColor: ColorsManager.primaryColor, + backgroundColor: ColorsManager.primaryColorWithOpacity, child: const Text('Save'), ), ), diff --git a/lib/pages/device_managment/schedule_device/schedule_widgets/count_down_inching_view.dart b/lib/pages/device_managment/schedule_device/schedule_widgets/count_down_inching_view.dart index e64b7cf7..c6a35bb6 100644 --- a/lib/pages/device_managment/schedule_device/schedule_widgets/count_down_inching_view.dart +++ b/lib/pages/device_managment/schedule_device/schedule_widgets/count_down_inching_view.dart @@ -226,6 +226,7 @@ class _CountdownInchingViewState extends State { index.toString().padLeft(2, '0'), style: TextStyle( fontSize: 24, + fontWeight: FontWeight.w400, color: isActive ? ColorsManager.grayColor : Colors.black, ), ), @@ -240,7 +241,8 @@ class _CountdownInchingViewState extends State { label, style: const TextStyle( color: ColorsManager.grayColor, - fontSize: 18, + fontSize: 24, + fontWeight: FontWeight.w400, ), ), ], 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 b654698d..d5194f35 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,12 +31,11 @@ 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), @@ -77,7 +76,8 @@ class BuildScheduleView extends StatelessWidget { category: category, time: '', function: Status( - code: code.toString(), value: null), + code: code.toString(), + value: true), days: [], ), isEdit: false, diff --git a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_header.dart b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_header.dart index 87afe430..06f785eb 100644 --- a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_header.dart +++ b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_header.dart @@ -13,9 +13,9 @@ class ScheduleHeader extends StatelessWidget { Text( 'Scheduling', style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 22, - color: ColorsManager.dialogBlueTitle, + color: ColorsManager.primaryColorWithOpacity, + fontWeight: FontWeight.w700, + fontSize: 30, ), ), Container( 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 1a89c1ee..39899fe5 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 @@ -27,7 +27,7 @@ class ScheduleManagementUI extends StatelessWidget { width: 170, height: 40, child: DefaultButton( - borderColor: ColorsManager.boxColor, + borderColor: ColorsManager.grayColor.withOpacity(0.5), padding: 2, backgroundColor: ColorsManager.graysColor, borderRadius: 15, 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 f1307d5f..f1df1f20 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 @@ -19,6 +19,8 @@ class ScheduleModeButtons extends StatelessWidget { children: [ Expanded( child: DefaultButton( + elevation: 2.5, + borderRadius: 8, height: 40, onPressed: () { Navigator.pop(context); @@ -33,9 +35,11 @@ class ScheduleModeButtons extends StatelessWidget { const SizedBox(width: 20), Expanded( child: DefaultButton( + elevation: 2.5, + borderRadius: 8, height: 40, onPressed: onSave, - backgroundColor: ColorsManager.primaryColor, + backgroundColor: ColorsManager.primaryColorWithOpacity, child: const Text('Save'), ), ), diff --git a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_selector.dart b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_selector.dart index 200d8c66..3b2f6502 100644 --- a/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_selector.dart +++ b/lib/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_selector.dart @@ -35,12 +35,12 @@ class ScheduleModeSelector extends StatelessWidget { ), const SizedBox(height: 4), Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ _buildRadioTile( context, 'Countdown', ScheduleModes.countdown, currentMode), _buildRadioTile( context, 'Schedule', ScheduleModes.schedule, currentMode), + const Spacer(flex: 1), // _buildRadioTile( // context, 'Circulate', ScheduleModes.circulate, currentMode), // _buildRadioTile( @@ -65,6 +65,7 @@ class ScheduleModeSelector extends StatelessWidget { style: context.textTheme.bodySmall!.copyWith( fontSize: 13, color: ColorsManager.blackColor, + fontWeight: FontWeight.w400, ), ), leading: Radio( 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 0a65595e..e5695b9e 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 @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:syncrow_web/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_buttons.dart'; import 'package:syncrow_web/pages/device_managment/water_heater/models/schedule_entry.dart'; import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart'; +import 'package:syncrow_web/utils/color_manager.dart'; class ScheduleDialogHelper { static const List allDays = [ @@ -56,8 +58,9 @@ class ScheduleDialogHelper { Text( isEdit ? 'Edit Schedule' : 'Add Schedule', style: Theme.of(context).textTheme.titleLarge!.copyWith( - color: Colors.blue, - fontWeight: FontWeight.bold, + color: ColorsManager.primaryColorWithOpacity, + fontWeight: FontWeight.w700, + fontSize: 30, ), ), const SizedBox(), @@ -69,9 +72,9 @@ class ScheduleDialogHelper { height: 40, child: ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: Colors.grey[200], + backgroundColor: ColorsManager.boxColor, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(15), + borderRadius: BorderRadius.circular(8), ), ), onPressed: () async { @@ -110,39 +113,27 @@ class ScheduleDialogHelper { ], ), actions: [ - SizedBox( - width: 100, - child: OutlinedButton( - onPressed: () { - Navigator.pop(ctx, null); - }, - child: const Text('Cancel'), - ), + ScheduleModeButtons( + onSave: () { + dynamic temp; + if (deviceType == 'CUR_2') { + temp = functionOn! ? 'open' : 'close'; + } else { + temp = functionOn; + } + final entry = ScheduleEntry( + category: schedule?.category ?? 'switch_1', + time: _formatTimeOfDayToISO(selectedTime), + function: Status( + code: code ?? 'switch_1', + value: temp, + ), + days: _convertSelectedDaysToStrings(selectedDays), + scheduleId: schedule.scheduleId, + ); + Navigator.pop(ctx, entry); + }, ), - SizedBox( - width: 100, - child: ElevatedButton( - onPressed: () { - dynamic temp; - if (deviceType == 'CUR_2') { - temp = functionOn! ? 'open' : 'close'; - } else { - temp = functionOn; - } - final entry = ScheduleEntry( - category: schedule?.category ?? 'switch_1', - time: _formatTimeOfDayToISO(selectedTime), - function: Status( - code: code ?? 'switch_1', - value: temp, - ), - days: _convertSelectedDaysToStrings(selectedDays), - scheduleId: schedule.scheduleId, - ); - Navigator.pop(ctx, entry); - }, - child: const Text('Save'), - )), ], ); }, diff --git a/lib/utils/color_manager.dart b/lib/utils/color_manager.dart index 55bfef1d..c1d791c8 100644 --- a/lib/utils/color_manager.dart +++ b/lib/utils/color_manager.dart @@ -84,5 +84,6 @@ abstract class ColorsManager { static const Color minBlueDot = Color(0xFF023DFE); static const Color grey25 = Color(0xFFF9F9F9); static const Color grey50 = Color(0xFF718096); + static const Color red100 = Color(0xFFFE0202); static const Color grey800 = Color(0xffF8F8F8); }