From 5daf7228affb30622e9d43117a092a3a9bc207d8 Mon Sep 17 00:00:00 2001 From: ashrafzarkanisala Date: Tue, 27 Aug 2024 19:54:52 +0300 Subject: [PATCH] add sensor type icons, and help description icon --- assets/icons/bathroom.svg | 29 +++++++++++ assets/icons/bedroom.svg | 34 +++++++++++++ assets/icons/dyi.svg | 14 ++++++ assets/icons/office.svg | 40 +++++++++++++++ assets/icons/parlour.svg | 30 +++++++++++ devtools_options.yaml | 3 ++ .../view/ceiling_sensor_controls.dart | 17 +++++-- .../shared/device_controls_container.dart | 2 +- .../sensors_widgets/presence_space_type.dart | 50 +++++++++++++++++++ lib/utils/constants/assets.dart | 7 ++- 10 files changed, 221 insertions(+), 5 deletions(-) create mode 100644 assets/icons/bathroom.svg create mode 100644 assets/icons/bedroom.svg create mode 100644 assets/icons/dyi.svg create mode 100644 assets/icons/office.svg create mode 100644 assets/icons/parlour.svg create mode 100644 devtools_options.yaml create mode 100644 lib/pages/device_managment/shared/sensors_widgets/presence_space_type.dart diff --git a/assets/icons/bathroom.svg b/assets/icons/bathroom.svg new file mode 100644 index 00000000..51fc8b6a --- /dev/null +++ b/assets/icons/bathroom.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/bedroom.svg b/assets/icons/bedroom.svg new file mode 100644 index 00000000..d579b003 --- /dev/null +++ b/assets/icons/bedroom.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/dyi.svg b/assets/icons/dyi.svg new file mode 100644 index 00000000..7da61e8e --- /dev/null +++ b/assets/icons/dyi.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/icons/office.svg b/assets/icons/office.svg new file mode 100644 index 00000000..03a2badd --- /dev/null +++ b/assets/icons/office.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/parlour.svg b/assets/icons/parlour.svg new file mode 100644 index 00000000..3298393a --- /dev/null +++ b/assets/icons/parlour.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 00000000..fa0b357c --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/lib/pages/device_managment/ceiling_sensor/view/ceiling_sensor_controls.dart b/lib/pages/device_managment/ceiling_sensor/view/ceiling_sensor_controls.dart index 21ed7667..72ade530 100644 --- a/lib/pages/device_managment/ceiling_sensor/view/ceiling_sensor_controls.dart +++ b/lib/pages/device_managment/ceiling_sensor/view/ceiling_sensor_controls.dart @@ -6,6 +6,7 @@ import 'package:syncrow_web/pages/device_managment/ceiling_sensor/bloc/event.dar import 'package:syncrow_web/pages/device_managment/ceiling_sensor/bloc/state.dart'; import 'package:syncrow_web/pages/device_managment/ceiling_sensor/model/ceiling_sensor_model.dart'; import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_display_data.dart'; +import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_space_type.dart'; import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_static_widget.dart'; import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_status.dart'; import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_update_data.dart'; @@ -99,6 +100,16 @@ class CeilingSensorControls extends StatelessWidget postfix: 'm', description: 'Detection Range', ), + const PresenceSpaceType( + listOfIcons: [ + Assets.office, + Assets.parlour, + Assets.dyi, + Assets.bathroom, + Assets.bedroom, + ], + description: 'Space Type', + ), PresenceUpdateData( value: model.sensitivity.toDouble(), title: 'Sensitivity:', @@ -153,11 +164,11 @@ class CeilingSensorControls extends StatelessWidget GestureDetector( onTap: () { context.read().add(GetCeilingDeviceReportsEvent( - code: 'presence_record', deviceUuid: device.uuid!)); + code: '', deviceUuid: device.uuid!)); }, child: const PresenceStaticWidget( - icon: Assets.presenceRecordIcon, - description: 'Presence Record', + icon: Assets.helpDescriptionIcon, + description: 'Help Description', ), ), ], diff --git a/lib/pages/device_managment/shared/device_controls_container.dart b/lib/pages/device_managment/shared/device_controls_container.dart index bfd1d81c..b60a958f 100644 --- a/lib/pages/device_managment/shared/device_controls_container.dart +++ b/lib/pages/device_managment/shared/device_controls_container.dart @@ -13,7 +13,7 @@ class DeviceControlsContainer extends StatelessWidget { color: ColorsManager.greyColor.withOpacity(0.2), border: Border.all(color: ColorsManager.boxDivider), ), - padding: const EdgeInsets.all(16), + padding: const EdgeInsets.all(12), child: child, ); } diff --git a/lib/pages/device_managment/shared/sensors_widgets/presence_space_type.dart b/lib/pages/device_managment/shared/sensors_widgets/presence_space_type.dart new file mode 100644 index 00000000..185144e1 --- /dev/null +++ b/lib/pages/device_managment/shared/sensors_widgets/presence_space_type.dart @@ -0,0 +1,50 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:syncrow_web/core/extension/build_context_x.dart'; +import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart'; +import 'package:syncrow_web/utils/color_manager.dart'; + +class PresenceSpaceType extends StatelessWidget { + const PresenceSpaceType({ + super.key, + required this.listOfIcons, + required this.description, + }); + + final List listOfIcons; + final String description; + + @override + Widget build(BuildContext context) { + return DeviceControlsContainer( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + description, + style: context.textTheme.bodySmall!.copyWith( + color: ColorsManager.blackColor, + fontWeight: FontWeight.w400, + fontSize: 10, + ), + ), + const SizedBox( + height: 8, + ), + Wrap( + runSpacing: 8, + spacing: 16, + children: [ + ...listOfIcons.map((icon) => SvgPicture.asset( + icon, + width: 40, + height: 40, + )), + ], + ), + ], + ), + ); + } +} diff --git a/lib/utils/constants/assets.dart b/lib/utils/constants/assets.dart index 8d2133d3..5a4f97f8 100644 --- a/lib/utils/constants/assets.dart +++ b/lib/utils/constants/assets.dart @@ -135,6 +135,11 @@ class Assets { static const String doorUnlock = 'assets/icons/door_un_look_ic.svg'; //assets/icons/lockIcon.svg - static const String lockIcon = 'assets/icons/lockIcon.svg'; + + static const String bathroom = 'assets/icons/bathroom.svg'; + static const String bedroom = 'assets/icons/bedroom.svg'; + static const String dyi = 'assets/icons/dyi.svg'; + static const String office = 'assets/icons/office.svg'; + static const String parlour = 'assets/icons/parlour.svg'; }