diff --git a/assets/icons/ac_schedule.svg b/assets/icons/ac_schedule.svg new file mode 100644 index 00000000..eb2394c9 --- /dev/null +++ b/assets/icons/ac_schedule.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/pages/device_managment/ac/view/ac_device_batch_control.dart b/lib/pages/device_managment/ac/view/ac_device_batch_control.dart index 94edf837..1930e9c4 100644 --- a/lib/pages/device_managment/ac/view/ac_device_batch_control.dart +++ b/lib/pages/device_managment/ac/view/ac_device_batch_control.dart @@ -10,7 +10,9 @@ import 'package:syncrow_web/pages/device_managment/all_devices/models/factory_re import 'package:syncrow_web/pages/device_managment/shared/batch_control/factory_reset.dart'; import 'package:syncrow_web/pages/device_managment/shared/batch_control/firmware_update.dart'; import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart'; +import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/constants/assets.dart'; +import 'package:syncrow_web/utils/extension/build_context_x.dart'; import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart'; class AcDeviceBatchControlView extends StatelessWidget @@ -75,6 +77,57 @@ class AcDeviceBatchControlView extends StatelessWidget code: 'level', devicesIds: devicesIds, ), + ToggleWidget( + label: '', + labelWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.remove, + size: 28, + color: ColorsManager.greyColor, + ), + ), + Text( + '06', + style: context.textTheme.titleLarge!.copyWith( + color: ColorsManager.dialogBlueTitle, + fontWeight: FontWeight.bold, + ), + ), + Text( + 'h', + style: context.textTheme.bodySmall! + .copyWith(color: ColorsManager.blackColor), + ), + Text( + '30', + style: context.textTheme.titleLarge!.copyWith( + color: ColorsManager.dialogBlueTitle, + fontWeight: FontWeight.bold, + ), + ), + Text('m', + style: context.textTheme.bodySmall! + .copyWith(color: ColorsManager.blackColor)), + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.add, + size: 28, + color: ColorsManager.greyColor, + ), + ), + ], + ), + value: false, + code: 'ac_schedule', + deviceId: devicesIds.first, + icon: Assets.acSchedule, + onChange: (value) {}, + ), ToggleWidget( deviceId: devicesIds.first, code: 'child_lock', diff --git a/lib/pages/device_managment/ac/view/ac_device_control.dart b/lib/pages/device_managment/ac/view/ac_device_control.dart index c78ce58d..3c383854 100644 --- a/lib/pages/device_managment/ac/view/ac_device_control.dart +++ b/lib/pages/device_managment/ac/view/ac_device_control.dart @@ -8,7 +8,9 @@ import 'package:syncrow_web/pages/device_managment/ac/view/control_list/current_ import 'package:syncrow_web/pages/device_managment/ac/view/control_list/fan_speed.dart'; import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart'; import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart'; +import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/constants/assets.dart'; +import 'package:syncrow_web/utils/extension/build_context_x.dart'; import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart'; class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout { @@ -74,6 +76,57 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout { code: 'level', deviceId: device.uuid!, ), + ToggleWidget( + label: '', + labelWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.remove, + size: 28, + color: ColorsManager.greyColor, + ), + ), + Text( + '06', + style: context.textTheme.titleLarge!.copyWith( + color: ColorsManager.dialogBlueTitle, + fontWeight: FontWeight.bold, + ), + ), + Text( + 'h', + style: context.textTheme.bodySmall! + .copyWith(color: ColorsManager.blackColor), + ), + Text( + '30', + style: context.textTheme.titleLarge!.copyWith( + color: ColorsManager.dialogBlueTitle, + fontWeight: FontWeight.bold, + ), + ), + Text('m', + style: context.textTheme.bodySmall! + .copyWith(color: ColorsManager.blackColor)), + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.add, + size: 28, + color: ColorsManager.greyColor, + ), + ), + ], + ), + value: false, + code: 'ac_schedule', + deviceId: device.uuid!, + icon: Assets.acSchedule, + onChange: (value) {}, + ), ToggleWidget( deviceId: device.uuid!, code: 'child_lock', diff --git a/lib/pages/device_managment/gateway/view/gateway_view.dart b/lib/pages/device_managment/gateway/view/gateway_view.dart index f6cc4682..ce9b06da 100644 --- a/lib/pages/device_managment/gateway/view/gateway_view.dart +++ b/lib/pages/device_managment/gateway/view/gateway_view.dart @@ -67,22 +67,19 @@ class _DeviceItem extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: 60, + ClipOval( + child: Container( height: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - color: ColorsManager.whiteColors, + width: 60, + padding: const EdgeInsets.all(8), + color: ColorsManager.whiteColors, + child: SvgPicture.asset( + device.icon, + width: 35, + height: 35, + fit: BoxFit.contain, ), - margin: const EdgeInsets.symmetric(horizontal: 4), - padding: const EdgeInsets.all(4), - child: ClipOval( - child: SvgPicture.asset( - device.icon, - fit: BoxFit.fill, - ), - ), - ), + )), const Spacer(), Text( device.name ?? 'Unknown Device', diff --git a/lib/pages/device_managment/shared/toggle_widget.dart b/lib/pages/device_managment/shared/toggle_widget.dart index 3115d609..052b04a3 100644 --- a/lib/pages/device_managment/shared/toggle_widget.dart +++ b/lib/pages/device_managment/shared/toggle_widget.dart @@ -11,6 +11,7 @@ class ToggleWidget extends StatelessWidget { final String deviceId; final String label; final String? icon; + final Widget? labelWidget; final Function(dynamic value) onChange; const ToggleWidget({ @@ -21,6 +22,7 @@ class ToggleWidget extends StatelessWidget { required this.label, required this.onChange, this.icon, + this.labelWidget, }); @override @@ -32,32 +34,48 @@ class ToggleWidget extends StatelessWidget { border: Border.all(color: ColorsManager.boxDivider), ), padding: const EdgeInsets.all(16), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - icon == '-1' - ? const SizedBox( - height: 60, - width: 60, - ) - : ClipOval( - child: Container( - height: 60, - width: 60, - padding: const EdgeInsets.all(8), - color: ColorsManager.whiteColors, - child: SvgPicture.asset( - icon ?? Assets.lightPulp, - width: 35, - height: 35, - fit: BoxFit.contain, - ), - )), + Padding( + padding: const EdgeInsets.only(right: 12), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + icon == '-1' + ? const SizedBox( + height: 60, + width: 60, + ) + : ClipOval( + child: Container( + height: 60, + width: 60, + padding: const EdgeInsets.all(8), + color: ColorsManager.whiteColors, + child: SvgPicture.asset( + icon ?? Assets.lightPulp, + width: 35, + height: 35, + fit: BoxFit.contain, + ), + )), + Container( + height: 20, + width: 35, + padding: const EdgeInsets.only(right: 16, top: 10), + child: CupertinoSwitch( + value: value, + activeColor: ColorsManager.dialogBlueTitle, + onChanged: onChange, + ), + ), + ], + ), + ), + labelWidget ?? Text( label, style: context.textTheme.titleMedium!.copyWith( @@ -65,18 +83,6 @@ class ToggleWidget extends StatelessWidget { color: ColorsManager.blackColor, ), ), - ], - ), - Container( - height: 20, - width: 35, - padding: const EdgeInsets.only(right: 16, top: 10), - child: CupertinoSwitch( - value: value, - activeColor: ColorsManager.dialogBlueTitle, - onChanged: onChange, - ), - ), ], ), ); diff --git a/lib/utils/constants/assets.dart b/lib/utils/constants/assets.dart index ee069c58..3a28a20c 100644 --- a/lib/utils/constants/assets.dart +++ b/lib/utils/constants/assets.dart @@ -169,4 +169,7 @@ class Assets { //assets/icons/ac_lock.svg static const String acLock = 'assets/icons/ac_lock.svg'; + + //assets/icons/ac_schedule.svg + static const String acSchedule = 'assets/icons/ac_schedule.svg'; }