From 5f402d02ea3fdcbb06049ae4f77aa418cbbdae6b Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 14:28:21 +0300 Subject: [PATCH 01/11] Added Menu Screen Icons --- .../GeneralSettingsIcons/clearCach.svg | 3 + .../GeneralSettingsIcons/language.svg | 3 + .../GeneralSettingsIcons/networkDiagnosis.svg | 3 + .../GeneralSettingsIcons/temperatureUnit.svg | 10 ++++ .../GeneralSettingsIcons/touchTone.svg | 5 ++ .../GeneralSettingsIcons/voiceAssistant.svg | 9 +++ .../HomeManagementIcons/CreateHome.svg | 8 +++ .../HomeManagementIcons/ManageYourHome.svg | 6 ++ .../HomeManagementIcons/joinAHome.svg | 3 + .../icons/MenuIcons/LeagalInfoIcons/About.svg | 5 ++ .../LeagalInfoIcons/PrivacyPolicy.svg | 3 + .../LeagalInfoIcons/UserAgreement.svg | 3 + .../MenuIcons/MessagesCenterIcons/Alerts.svg | 5 ++ .../MenuIcons/MessagesCenterIcons/FAQs.svg | 5 ++ .../HelpAndFeedbacksvg.svg | 3 + .../MessagesCenterIcons/Messages.svg | 3 + .../SecurityAndPrivacyIcons/Privacy.svg | 4 ++ .../SecurityAndPrivacyIcons/Securty.svg | 3 + lib/generated/assets.dart | 55 +++++++++++++++---- pubspec.yaml | 5 ++ 20 files changed, 133 insertions(+), 11 deletions(-) create mode 100644 assets/icons/MenuIcons/GeneralSettingsIcons/clearCach.svg create mode 100644 assets/icons/MenuIcons/GeneralSettingsIcons/language.svg create mode 100644 assets/icons/MenuIcons/GeneralSettingsIcons/networkDiagnosis.svg create mode 100644 assets/icons/MenuIcons/GeneralSettingsIcons/temperatureUnit.svg create mode 100644 assets/icons/MenuIcons/GeneralSettingsIcons/touchTone.svg create mode 100644 assets/icons/MenuIcons/GeneralSettingsIcons/voiceAssistant.svg create mode 100644 assets/icons/MenuIcons/HomeManagementIcons/CreateHome.svg create mode 100644 assets/icons/MenuIcons/HomeManagementIcons/ManageYourHome.svg create mode 100644 assets/icons/MenuIcons/HomeManagementIcons/joinAHome.svg create mode 100644 assets/icons/MenuIcons/LeagalInfoIcons/About.svg create mode 100644 assets/icons/MenuIcons/LeagalInfoIcons/PrivacyPolicy.svg create mode 100644 assets/icons/MenuIcons/LeagalInfoIcons/UserAgreement.svg create mode 100644 assets/icons/MenuIcons/MessagesCenterIcons/Alerts.svg create mode 100644 assets/icons/MenuIcons/MessagesCenterIcons/FAQs.svg create mode 100644 assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedbacksvg.svg create mode 100644 assets/icons/MenuIcons/MessagesCenterIcons/Messages.svg create mode 100644 assets/icons/MenuIcons/SecurityAndPrivacyIcons/Privacy.svg create mode 100644 assets/icons/MenuIcons/SecurityAndPrivacyIcons/Securty.svg diff --git a/assets/icons/MenuIcons/GeneralSettingsIcons/clearCach.svg b/assets/icons/MenuIcons/GeneralSettingsIcons/clearCach.svg new file mode 100644 index 0000000..20ec573 --- /dev/null +++ b/assets/icons/MenuIcons/GeneralSettingsIcons/clearCach.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/MenuIcons/GeneralSettingsIcons/language.svg b/assets/icons/MenuIcons/GeneralSettingsIcons/language.svg new file mode 100644 index 0000000..15bd55d --- /dev/null +++ b/assets/icons/MenuIcons/GeneralSettingsIcons/language.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/MenuIcons/GeneralSettingsIcons/networkDiagnosis.svg b/assets/icons/MenuIcons/GeneralSettingsIcons/networkDiagnosis.svg new file mode 100644 index 0000000..89edd09 --- /dev/null +++ b/assets/icons/MenuIcons/GeneralSettingsIcons/networkDiagnosis.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/MenuIcons/GeneralSettingsIcons/temperatureUnit.svg b/assets/icons/MenuIcons/GeneralSettingsIcons/temperatureUnit.svg new file mode 100644 index 0000000..ff1291a --- /dev/null +++ b/assets/icons/MenuIcons/GeneralSettingsIcons/temperatureUnit.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/icons/MenuIcons/GeneralSettingsIcons/touchTone.svg b/assets/icons/MenuIcons/GeneralSettingsIcons/touchTone.svg new file mode 100644 index 0000000..2d1b5eb --- /dev/null +++ b/assets/icons/MenuIcons/GeneralSettingsIcons/touchTone.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/MenuIcons/GeneralSettingsIcons/voiceAssistant.svg b/assets/icons/MenuIcons/GeneralSettingsIcons/voiceAssistant.svg new file mode 100644 index 0000000..053b9ae --- /dev/null +++ b/assets/icons/MenuIcons/GeneralSettingsIcons/voiceAssistant.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/icons/MenuIcons/HomeManagementIcons/CreateHome.svg b/assets/icons/MenuIcons/HomeManagementIcons/CreateHome.svg new file mode 100644 index 0000000..5d7d222 --- /dev/null +++ b/assets/icons/MenuIcons/HomeManagementIcons/CreateHome.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/MenuIcons/HomeManagementIcons/ManageYourHome.svg b/assets/icons/MenuIcons/HomeManagementIcons/ManageYourHome.svg new file mode 100644 index 0000000..6e729d7 --- /dev/null +++ b/assets/icons/MenuIcons/HomeManagementIcons/ManageYourHome.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/MenuIcons/HomeManagementIcons/joinAHome.svg b/assets/icons/MenuIcons/HomeManagementIcons/joinAHome.svg new file mode 100644 index 0000000..1ad882a --- /dev/null +++ b/assets/icons/MenuIcons/HomeManagementIcons/joinAHome.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/MenuIcons/LeagalInfoIcons/About.svg b/assets/icons/MenuIcons/LeagalInfoIcons/About.svg new file mode 100644 index 0000000..47e30f5 --- /dev/null +++ b/assets/icons/MenuIcons/LeagalInfoIcons/About.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/MenuIcons/LeagalInfoIcons/PrivacyPolicy.svg b/assets/icons/MenuIcons/LeagalInfoIcons/PrivacyPolicy.svg new file mode 100644 index 0000000..c5d1e3d --- /dev/null +++ b/assets/icons/MenuIcons/LeagalInfoIcons/PrivacyPolicy.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/MenuIcons/LeagalInfoIcons/UserAgreement.svg b/assets/icons/MenuIcons/LeagalInfoIcons/UserAgreement.svg new file mode 100644 index 0000000..6cabfad --- /dev/null +++ b/assets/icons/MenuIcons/LeagalInfoIcons/UserAgreement.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/MenuIcons/MessagesCenterIcons/Alerts.svg b/assets/icons/MenuIcons/MessagesCenterIcons/Alerts.svg new file mode 100644 index 0000000..7762dd4 --- /dev/null +++ b/assets/icons/MenuIcons/MessagesCenterIcons/Alerts.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/MenuIcons/MessagesCenterIcons/FAQs.svg b/assets/icons/MenuIcons/MessagesCenterIcons/FAQs.svg new file mode 100644 index 0000000..ab3dc9f --- /dev/null +++ b/assets/icons/MenuIcons/MessagesCenterIcons/FAQs.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedbacksvg.svg b/assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedbacksvg.svg new file mode 100644 index 0000000..fb53dd0 --- /dev/null +++ b/assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedbacksvg.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/MenuIcons/MessagesCenterIcons/Messages.svg b/assets/icons/MenuIcons/MessagesCenterIcons/Messages.svg new file mode 100644 index 0000000..c9a7e35 --- /dev/null +++ b/assets/icons/MenuIcons/MessagesCenterIcons/Messages.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/MenuIcons/SecurityAndPrivacyIcons/Privacy.svg b/assets/icons/MenuIcons/SecurityAndPrivacyIcons/Privacy.svg new file mode 100644 index 0000000..69ea2cd --- /dev/null +++ b/assets/icons/MenuIcons/SecurityAndPrivacyIcons/Privacy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/MenuIcons/SecurityAndPrivacyIcons/Securty.svg b/assets/icons/MenuIcons/SecurityAndPrivacyIcons/Securty.svg new file mode 100644 index 0000000..beecb3e --- /dev/null +++ b/assets/icons/MenuIcons/SecurityAndPrivacyIcons/Securty.svg @@ -0,0 +1,3 @@ + + + diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index f272133..4fc2ad9 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -84,6 +84,24 @@ class Assets { static const String doorlockAssetsUnlockingRecords = 'assets/icons/doorlock-assets/unlocking-records.svg'; static const String fontsAftikaRegular = 'assets/fonts/AftikaRegular.ttf'; + static const String generalSettingsIconsClearCach = + 'assets/icons/MenuIcons/GeneralSettingsIcons/clearCach.svg'; + static const String generalSettingsIconsLanguage = + 'assets/icons/MenuIcons/GeneralSettingsIcons/language.svg'; + static const String generalSettingsIconsNetworkDiagnosis = + 'assets/icons/MenuIcons/GeneralSettingsIcons/networkDiagnosis.svg'; + static const String generalSettingsIconsTemperatureUnit = + 'assets/icons/MenuIcons/GeneralSettingsIcons/temperatureUnit.svg'; + static const String generalSettingsIconsTouchTone = + 'assets/icons/MenuIcons/GeneralSettingsIcons/touchTone.svg'; + static const String generalSettingsIconsVoiceAssistant = + 'assets/icons/MenuIcons/GeneralSettingsIcons/voiceAssistant.svg'; + static const String homeManagementIconsCreateHome = + 'assets/icons/MenuIcons/HomeManagementIcons/CreateHome.svg'; + static const String homeManagementIconsJoinAHome = + 'assets/icons/MenuIcons/HomeManagementIcons/joinAHome.svg'; + static const String homeManagementIconsManageYourHome = + 'assets/icons/MenuIcons/HomeManagementIcons/ManageYourHome.svg'; static const String icons3GangSwitch = 'assets/icons/3GangSwitch.svg'; static const String iconsAC = 'assets/icons/AC.svg'; static const String iconsActive = 'assets/icons/active.svg'; @@ -158,31 +176,46 @@ class Assets { static const String imagesTestDash2 = 'assets/images/test_dash2.png'; static const String imagesVector = 'assets/images/Vector.png'; static const String imagesWhiteLogo = 'assets/images/white-logo.png'; - + static const String leagalInfoIconsAbout = + 'assets/icons/MenuIcons/LeagalInfoIcons/About.svg'; + static const String leagalInfoIconsPrivacyPolicy = + 'assets/icons/MenuIcons/LeagalInfoIcons/PrivacyPolicy.svg'; + static const String leagalInfoIconsUserAgreement = + 'assets/icons/MenuIcons/LeagalInfoIcons/UserAgreement.svg'; + static const String messagesCenterIconsAlerts = + 'assets/icons/MenuIcons/MessagesCenterIcons/Alerts.svg'; + static const String messagesCenterIconsFAQs = + 'assets/icons/MenuIcons/MessagesCenterIcons/FAQs.svg'; + static const String messagesCenterIconsHelpAndFeedbacksvg = + 'assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedbacksvg.svg'; + static const String messagesCenterIconsMessages = + 'assets/icons/MenuIcons/MessagesCenterIcons/Messages.svg'; static const String presenceSensorAssetsDistance = 'assets/icons/presence-sensor-assets/Distance.svg'; static const String presenceSensorAssetsEmpty = 'assets/icons/presence-sensor-assets/Empty.svg'; + static const String presenceSensorAssetsHelpDescription = + 'assets/icons/presence-sensor-assets/help-description.svg'; static const String presenceSensorAssetsIlluminanceRecord = 'assets/icons/presence-sensor-assets/Illuminance-Record.svg'; static const String presenceSensorAssetsIlluminanceValue = 'assets/icons/presence-sensor-assets/Illuminance-Value.svg'; static const String presenceSensorAssetsIndicator = 'assets/icons/presence-sensor-assets/Indicator.svg'; - static const String presenceSensorAssetsPresence = - 'assets/icons/presence-sensor-assets/Presence.svg'; - static const String presenceSensorAssetsRecord = - 'assets/icons/presence-sensor-assets/Record.svg'; - static const String presenceSensorAssetsTime = - 'assets/icons/presence-sensor-assets/Time.svg'; - - static const String presenceSensorAssetsHelpDescription = - 'assets/icons/presence-sensor-assets/help-description.svg'; static const String presenceSensorAssetsInductionRecording = 'assets/icons/presence-sensor-assets/induction-recording.svg'; static const String presenceSensorAssetsParameterSettings = 'assets/icons/presence-sensor-assets/parameter-settings.svg'; + static const String presenceSensorAssetsPresence = + 'assets/icons/presence-sensor-assets/Presence.svg'; static const String presenceSensorAssetsPresenceSensorMotion = 'assets/icons/presence-sensor-assets/presence-sensor-motion.svg'; - + static const String presenceSensorAssetsRecord = + 'assets/icons/presence-sensor-assets/Record.svg'; + static const String presenceSensorAssetsTime = + 'assets/icons/presence-sensor-assets/Time.svg'; + static const String securityAndPrivacyIconsPrivacy = + 'assets/icons/MenuIcons/SecurityAndPrivacyIcons/Privacy.svg'; + static const String securityAndPrivacyIconsSecurty = + 'assets/icons/MenuIcons/SecurityAndPrivacyIcons/Securty.svg'; } diff --git a/pubspec.yaml b/pubspec.yaml index f2a02a4..472e4bc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -54,6 +54,11 @@ flutter: - assets/icons/presence-sensor-assets/ - assets/icons/battery/dmOff/ - assets/icons/battery/dmOn/ + - assets/icons/MenuIcons/GeneralSettingsIcons/ + - assets/icons/MenuIcons/HomeManagementIcons/ + - assets/icons/MenuIcons/LeagalInfoIcons/ + - assets/icons/MenuIcons/MessagesCenterIcons/ + - assets/icons/MenuIcons/SecurityAndPrivacyIcons/ fonts: - family: Aftika From 88588d9fa83d8294da47b262825b8bfda8cb6f14 Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 15:11:01 +0300 Subject: [PATCH 02/11] Refactor menu view to use sections and buttons Extracted menu sections and buttons into separate data structures for better organization and readability in the menu view. Updated MenuList widget to dynamically render buttons based on the new data structure. --- lib/features/menu/view/menu_view.dart | 131 +++++++++++++++++- lib/features/menu/view/widgets/menu_list.dart | 14 +- .../menu/view/widgets/menu_list_item.dart | 58 +++++--- 3 files changed, 171 insertions(+), 32 deletions(-) diff --git a/lib/features/menu/view/menu_view.dart b/lib/features/menu/view/menu_view.dart index 1c55a36..cb05a94 100644 --- a/lib/features/menu/view/menu_view.dart +++ b/lib/features/menu/view/menu_view.dart @@ -6,8 +6,10 @@ import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart'; import 'package:syncrow_app/features/menu/view/widgets/profile_tab.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; +import 'package:syncrow_app/generated/assets.dart'; import 'package:syncrow_app/navigation/routing_constants.dart'; import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; import 'package:syncrow_app/utils/resource_manager/constants.dart'; class MenuView extends StatelessWidget { @@ -33,11 +35,10 @@ class MenuView extends StatelessWidget { child: Column( children: [ const ProfileTab(), - ...MenuCubit.of(context).menuLists.map( - (list) => MenuList( - listModel: list, - ), - ), + for (var section in menuSections) + MenuList( + section: section, + ), const SizedBox( height: 15, ), @@ -75,3 +76,123 @@ class MenuView extends StatelessWidget { ); } } + +List> menuSections = [ + //Home Management + { + 'title': 'Home Management', + 'color': ColorsManager.primaryColor, + 'buttons': [ + { + 'title': 'Create a Home', + 'Icon': Assets.homeManagementIconsCreateHome, + 'page': null + }, + { + 'title': 'Join a Home', + 'Icon': Assets.homeManagementIconsJoinAHome, + 'page': null + }, + { + 'title': 'Manage Your Home', + 'Icon': Assets.homeManagementIconsManageYourHome, + 'page': null + }, + ], + }, + //General Settings + { + 'title': 'General Settings', + 'color': const Color(0xFF0030CB), + 'buttons': [ + { + 'title': 'Voice Assistant', + 'Icon': Assets.generalSettingsIconsVoiceAssistant, + 'page': null + }, + { + 'title': 'Temperature unit', + 'Icon': Assets.generalSettingsIconsTemperatureUnit, + 'page': null + }, + { + 'title': 'Touch tone on panel', + 'Icon': Assets.generalSettingsIconsTouchTone, + 'page': null + }, + { + 'title': 'Language', + 'Icon': Assets.generalSettingsIconsLanguage, + 'page': null + }, + { + 'title': 'Network Diagnosis', + 'Icon': Assets.generalSettingsIconsNetworkDiagnosis, + 'page': null + }, + { + 'title': 'Clear Cache', + 'Icon': Assets.generalSettingsIconsClearCache, + 'page': null + }, + ], + }, + //Messages Center + { + 'title': 'Messages Center', + 'color': const Color(0xFF0088FF), + 'buttons': [ + { + 'title': 'Alerts', + 'Icon': Assets.messagesCenterIconsAlerts, + 'page': null + }, + { + 'title': 'Messages', + 'Icon': Assets.messagesCenterIconsMessages, + 'page': null + }, + {'title': 'FAQs', 'Icon': Assets.messagesCenterIconsFAQs, 'page': null}, + { + 'title': 'Help & Feedback', + 'Icon': Assets.messagesCenterIconsHelpAndFeedbacks, + 'page': null + }, + ], + }, + //Security And Privacy + { + 'title': 'Security And Privacy', + 'color': const Color(0xFF8AB9FF), + 'buttons': [ + { + 'title': 'Security', + 'Icon': Assets.securityAndPrivacyIconsSecurty, + 'page': null + }, + { + 'title': 'Privacy', + 'Icon': Assets.securityAndPrivacyIconsPrivacy, + 'page': null + }, + ], + }, + //Legal Information + { + 'title': 'Legal Information', + 'color': const Color(0xFF001B72), + 'buttons': [ + {'title': 'About', 'Icon': Assets.leagalInfoIconsAbout, 'page': null}, + { + 'title': 'Privacy Policy', + 'Icon': Assets.leagalInfoIconsPrivacyPolicy, + 'page': null + }, + { + 'title': 'User Agreement', + 'Icon': Assets.leagalInfoIconsUserAgreement, + 'page': null + }, + ], + }, +]; diff --git a/lib/features/menu/view/widgets/menu_list.dart b/lib/features/menu/view/widgets/menu_list.dart index 88410c2..74391c5 100644 --- a/lib/features/menu/view/widgets/menu_list.dart +++ b/lib/features/menu/view/widgets/menu_list.dart @@ -4,14 +4,15 @@ import 'package:syncrow_app/features/menu/view/widgets/menu_list_divider.dart'; import 'package:syncrow_app/features/menu/view/widgets/menu_list_item.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; +import 'package:syncrow_app/generated/assets.dart'; class MenuList extends StatelessWidget { const MenuList({ super.key, - required this.listModel, + required this.section, }); - final MenuListModel listModel; + final Map section; @override Widget build(BuildContext context) { @@ -20,7 +21,7 @@ class MenuList extends StatelessWidget { children: [ const SizedBox(height: 5), BodySmall( - text: listModel.label!, + text: section['title'] as String, ), const SizedBox(height: 5), DefaultContainer( @@ -28,10 +29,13 @@ class MenuList extends StatelessWidget { shrinkWrap: true, padding: const EdgeInsets.all(0), physics: const NeverScrollableScrollPhysics(), - itemCount: listModel.listItems!.length, + itemCount: section['buttons'].length, itemBuilder: (context, index) { return MenuListItem( - listItem: listModel.listItems![index]!, + title: section['buttons'][index]['title'] as String, + icon: section['buttons'][index]['Icon'] as String, + page: section['buttons'][index]['page'] as Widget?, + color: section['color'], ); }, separatorBuilder: (context, index) => const MenuListDivider()), diff --git a/lib/features/menu/view/widgets/menu_list_item.dart b/lib/features/menu/view/widgets/menu_list_item.dart index 9facec9..fdb64ea 100644 --- a/lib/features/menu/view/widgets/menu_list_item.dart +++ b/lib/features/menu/view/widgets/menu_list_item.dart @@ -1,43 +1,57 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:syncrow_app/features/menu/model/list_item_model.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; class MenuListItem extends StatelessWidget { const MenuListItem({ super.key, - required this.listItem, + required this.title, + required this.icon, + required this.page, + required this.color, }); - final ListItemModel listItem; - + final String title; + final String icon; + final Widget? page; + final Color color; @override Widget build(BuildContext context) { - return Column( - children: [ - Row( - children: [ - Container( + return InkWell( + onTap: () { + if (page == null) { + return; + } + Navigator.of(context) + .push(MaterialPageRoute(builder: (context) => page!)); + }, + child: Row( + children: [ + Container( margin: const EdgeInsets.only(right: 10), height: 33, width: 33, decoration: BoxDecoration( - color: ColorsManager.primaryColor, + color: color, borderRadius: BorderRadius.circular(15), ), - child: listItem.icon != null - ? SvgPicture.asset( - listItem.icon!, - ) - : null, - ), - BodyMedium( - text: listItem.label!, - ) - ], - ), - ], + child: Center( + child: SizedBox.square( + dimension: 15, + child: SvgPicture.asset( + icon, + width: 15, + height: 15, + fit: BoxFit.contain, + ), + ), + )), + BodyMedium( + text: title, + ) + ], + ), ); } } From 1da61e767316f9dd96331d178c6324f4d40522aa Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 15:11:10 +0300 Subject: [PATCH 03/11] quick fixes --- ...AndFeedbacksvg.svg => HelpAndFeedback.svg} | 0 lib/features/menu/bloc/menu_cubit.dart | 164 +++++++++--------- lib/generated/assets.dart | 6 +- 3 files changed, 84 insertions(+), 86 deletions(-) rename assets/icons/MenuIcons/MessagesCenterIcons/{HelpAndFeedbacksvg.svg => HelpAndFeedback.svg} (100%) diff --git a/assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedbacksvg.svg b/assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedback.svg similarity index 100% rename from assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedbacksvg.svg rename to assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedback.svg diff --git a/lib/features/menu/bloc/menu_cubit.dart b/lib/features/menu/bloc/menu_cubit.dart index 89ece3f..a51a41e 100644 --- a/lib/features/menu/bloc/menu_cubit.dart +++ b/lib/features/menu/bloc/menu_cubit.dart @@ -1,6 +1,4 @@ import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_app/features/menu/model/list_item_model.dart'; -import 'package:syncrow_app/features/menu/model/menu_list_model.dart'; part 'menu_state.dart'; @@ -9,85 +7,85 @@ class MenuCubit extends Cubit { static MenuCubit of(context) => BlocProvider.of(context); - List menuLists = [ - MenuListModel( - label: 'Home Management', - listItems: [ - ListItemModel( - label: 'Create a Home', - ), - ListItemModel( - label: 'Join a Home', - ), - ListItemModel( - label: 'Manage Your Home', - ), - ], - ), - MenuListModel( - label: 'General Settings', - listItems: [ - ListItemModel( - label: 'Voice Assistant', - ), - ListItemModel( - label: 'Temperature unit', - ), - ListItemModel( - label: 'Touch tone on panel', - ), - ListItemModel( - label: 'Language', - ), - ListItemModel( - label: 'Network diagnosis', - ), - ListItemModel( - label: 'Clear cache', - ), - ], - ), - MenuListModel( - label: 'Messages Center', - listItems: [ - ListItemModel( - label: 'Alerts', - ), - ListItemModel( - label: 'Messages', - ), - ListItemModel( - label: 'FAQs', - ), - ListItemModel( - label: 'Help & Feedback', - ), - ], - ), - MenuListModel( - label: 'Security and Privacy', - listItems: [ - ListItemModel( - label: 'Security', - ), - ListItemModel( - label: 'privacy', - ), - ], - ), - MenuListModel( - label: 'Legal Information', - listItems: [ - ListItemModel( - label: 'About', - ), - ListItemModel( - label: 'Privacy Policy', - ), - ListItemModel( - label: 'User Agreement', - ), - ], - ), - ]; + // List menuLists = [ + // MenuListModel( + // label: 'Home Management', + // listItems: [ + // ListItemModel( + // label: 'Create a Home', + // ), + // ListItemModel( + // label: 'Join a Home', + // ), + // ListItemModel( + // label: 'Manage Your Home', + // ), + // ], + // ), + // MenuListModel( + // label: 'General Settings', + // listItems: [ + // ListItemModel( + // label: 'Voice Assistant', + // ), + // ListItemModel( + // label: 'Temperature unit', + // ), + // ListItemModel( + // label: 'Touch tone on panel', + // ), + // ListItemModel( + // label: 'Language', + // ), + // ListItemModel( + // label: 'Network diagnosis', + // ), + // ListItemModel( + // label: 'Clear cache', + // ), + // ], + // ), + // MenuListModel( + // label: 'Messages Center', + // listItems: [ + // ListItemModel( + // label: 'Alerts', + // ), + // ListItemModel( + // label: 'Messages', + // ), + // ListItemModel( + // label: 'FAQs', + // ), + // ListItemModel( + // label: 'Help & Feedback', + // ), + // ], + // ), + // MenuListModel( + // label: 'Security and Privacy', + // listItems: [ + // ListItemModel( + // label: 'Security', + // ), + // ListItemModel( + // label: 'privacy', + // ), + // ], + // ), + // MenuListModel( + // label: 'Legal Information', + // listItems: [ + // ListItemModel( + // label: 'About', + // ), + // ListItemModel( + // label: 'Privacy Policy', + // ), + // ListItemModel( + // label: 'User Agreement', + // ), + // ], + // ), + // ]; } diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index 4fc2ad9..5d12d79 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -84,7 +84,7 @@ class Assets { static const String doorlockAssetsUnlockingRecords = 'assets/icons/doorlock-assets/unlocking-records.svg'; static const String fontsAftikaRegular = 'assets/fonts/AftikaRegular.ttf'; - static const String generalSettingsIconsClearCach = + static const String generalSettingsIconsClearCache = 'assets/icons/MenuIcons/GeneralSettingsIcons/clearCach.svg'; static const String generalSettingsIconsLanguage = 'assets/icons/MenuIcons/GeneralSettingsIcons/language.svg'; @@ -186,8 +186,8 @@ class Assets { 'assets/icons/MenuIcons/MessagesCenterIcons/Alerts.svg'; static const String messagesCenterIconsFAQs = 'assets/icons/MenuIcons/MessagesCenterIcons/FAQs.svg'; - static const String messagesCenterIconsHelpAndFeedbacksvg = - 'assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedbacksvg.svg'; + static const String messagesCenterIconsHelpAndFeedbacks = + 'assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedback.svg'; static const String messagesCenterIconsMessages = 'assets/icons/MenuIcons/MessagesCenterIcons/Messages.svg'; static const String presenceSensorAssetsDistance = From 6771785a4b175c5af1426eb11e58f1976b24b4e7 Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 15:12:38 +0300 Subject: [PATCH 04/11] removed old menu List and menu List Item models --- lib/features/menu/model/list_item_model.dart | 9 --------- lib/features/menu/model/menu_list_model.dart | 11 ----------- 2 files changed, 20 deletions(-) delete mode 100644 lib/features/menu/model/list_item_model.dart delete mode 100644 lib/features/menu/model/menu_list_model.dart diff --git a/lib/features/menu/model/list_item_model.dart b/lib/features/menu/model/list_item_model.dart deleted file mode 100644 index 70a812a..0000000 --- a/lib/features/menu/model/list_item_model.dart +++ /dev/null @@ -1,9 +0,0 @@ -class ListItemModel { - final String? icon; - final String? label; - - ListItemModel({ - this.icon, - this.label, - }); -} diff --git a/lib/features/menu/model/menu_list_model.dart b/lib/features/menu/model/menu_list_model.dart deleted file mode 100644 index 64aaa14..0000000 --- a/lib/features/menu/model/menu_list_model.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'list_item_model.dart'; - -class MenuListModel { - final String? label; - final List? listItems; - - MenuListModel({ - this.label, - this.listItems, - }); -} From e47e42878581a76f3057d2a200e24abb34d7c8d9 Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 16:28:02 +0300 Subject: [PATCH 05/11] created Default Scaffold --- .../shared_widgets/default_scaffold.dart | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 lib/features/shared_widgets/default_scaffold.dart diff --git a/lib/features/shared_widgets/default_scaffold.dart b/lib/features/shared_widgets/default_scaffold.dart new file mode 100644 index 0000000..c673dd3 --- /dev/null +++ b/lib/features/shared_widgets/default_scaffold.dart @@ -0,0 +1,54 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; +import 'package:syncrow_app/generated/assets.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/constants.dart'; +import 'package:syncrow_app/utils/resource_manager/font_manager.dart'; + +class DefaultScaffold extends StatelessWidget { + const DefaultScaffold({super.key, required this.child, this.title}); + + final Widget child; + final String? title; + @override + Widget build(BuildContext context) { + return AnnotatedRegion( + value: SystemUiOverlayStyle( + statusBarColor: ColorsManager.primaryColor.withOpacity(0.5), + statusBarIconBrightness: Brightness.dark, // For Android (dark icons) + statusBarBrightness: Brightness.dark, // For iOS (dark icons) + ), + child: Scaffold( + backgroundColor: ColorsManager.backgroundColor, + extendBodyBehindAppBar: true, + extendBody: true, + appBar: AppBar( + backgroundColor: Colors.transparent, + centerTitle: true, + title: BodyLarge( + text: title ?? "", + fontColor: ColorsManager.primaryColor, + fontWeight: FontsManager.bold, + ), + ), + body: Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height, + padding: const EdgeInsets.all(Constants.defaultPadding), + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + Assets.imagesBackground, + ), + fit: BoxFit.cover, + opacity: 0.4, + ), + ), + child: SafeArea(child: child), + ), + ), + ); + } +} From 6050fa745f8dc4fa1fcac78bb7328f99a904f2be Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 16:38:26 +0300 Subject: [PATCH 06/11] Add ProfileTab and ProfileView widgets for user profile display - Added ProfileTab widget for displaying user profile information in a tab. - Added ProfileView widget for displaying user profile details in a separate view. --- lib/features/menu/view/menu_view.dart | 2 +- lib/features/menu/view/widgets/menu_list.dart | 2 - .../menu/view/widgets/menu_list_item.dart | 1 - .../view/widgets/profile/profile_tab.dart | 63 +++++++++ .../view/widgets/profile/profile_view.dart | 129 ++++++++++++++++++ .../menu/view/widgets/profile_tab.dart | 53 ------- lib/features/profile/bloc/profile_cubit.dart | 7 - lib/features/profile/bloc/profile_state.dart | 5 - lib/features/profile/view/profile_view.dart | 21 --- 9 files changed, 193 insertions(+), 90 deletions(-) create mode 100644 lib/features/menu/view/widgets/profile/profile_tab.dart create mode 100644 lib/features/menu/view/widgets/profile/profile_view.dart delete mode 100644 lib/features/menu/view/widgets/profile_tab.dart delete mode 100644 lib/features/profile/bloc/profile_cubit.dart delete mode 100644 lib/features/profile/bloc/profile_state.dart delete mode 100644 lib/features/profile/view/profile_view.dart diff --git a/lib/features/menu/view/menu_view.dart b/lib/features/menu/view/menu_view.dart index cb05a94..97af28e 100644 --- a/lib/features/menu/view/menu_view.dart +++ b/lib/features/menu/view/menu_view.dart @@ -3,7 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart'; import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart'; import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart'; -import 'package:syncrow_app/features/menu/view/widgets/profile_tab.dart'; +import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; import 'package:syncrow_app/generated/assets.dart'; diff --git a/lib/features/menu/view/widgets/menu_list.dart b/lib/features/menu/view/widgets/menu_list.dart index 74391c5..511f476 100644 --- a/lib/features/menu/view/widgets/menu_list.dart +++ b/lib/features/menu/view/widgets/menu_list.dart @@ -1,10 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:syncrow_app/features/menu/model/menu_list_model.dart'; import 'package:syncrow_app/features/menu/view/widgets/menu_list_divider.dart'; import 'package:syncrow_app/features/menu/view/widgets/menu_list_item.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; -import 'package:syncrow_app/generated/assets.dart'; class MenuList extends StatelessWidget { const MenuList({ diff --git a/lib/features/menu/view/widgets/menu_list_item.dart b/lib/features/menu/view/widgets/menu_list_item.dart index fdb64ea..264e2b8 100644 --- a/lib/features/menu/view/widgets/menu_list_item.dart +++ b/lib/features/menu/view/widgets/menu_list_item.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; -import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; class MenuListItem extends StatelessWidget { const MenuListItem({ diff --git a/lib/features/menu/view/widgets/profile/profile_tab.dart b/lib/features/menu/view/widgets/profile/profile_tab.dart new file mode 100644 index 0000000..2d86229 --- /dev/null +++ b/lib/features/menu/view/widgets/profile/profile_tab.dart @@ -0,0 +1,63 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/menu/view/widgets/profile/profile_view.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/syncrow_logo.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; + +class ProfileTab extends StatelessWidget { + const ProfileTab({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: InkWell( + onTap: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const ProfileView(), + ), + ); + }, + child: const Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + SizedBox(height: 20), + DefaultContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BodyMedium( + text: "Karim", + fontWeight: FontWeight.bold, + ), + BodySmall(text: "Syncrow Account") + ], + ), + ), + ], + ), + Positioned( + right: 20, + top: 0, + child: CircleAvatar( + radius: 38, + backgroundColor: Colors.white, + child: CircleAvatar( + radius: 37, + backgroundColor: Colors.grey, + child: SyncrowLogo(), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/features/menu/view/widgets/profile/profile_view.dart b/lib/features/menu/view/widgets/profile/profile_view.dart new file mode 100644 index 0000000..91a346e --- /dev/null +++ b/lib/features/menu/view/widgets/profile/profile_view.dart @@ -0,0 +1,129 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; + +class ProfileView extends StatelessWidget { + const ProfileView({super.key}); + + @override + Widget build(BuildContext context) { + return DefaultScaffold( + title: 'Profile Page', + child: Column( + children: [ + //profile pic + const SizedBox.square( + dimension: 120, + child: CircleAvatar( + backgroundColor: Colors.white, + child: SizedBox.square( + dimension: 115, + child: CircleAvatar( + backgroundColor: Colors.grey, + child: FlutterLogo(), + ), + ), + ), + ), + const SizedBox(height: 20), + //name + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const TitleMedium(text: 'Karim'), + const SizedBox( + width: 5, + ), + InkWell( + onTap: () { + //TODO: Implement edit name + }, + child: const Icon( + Icons.edit_outlined, + size: 20, + color: ColorsManager.textPrimaryColor, + ), + ), + ], + ), + const SizedBox(height: 10), + //Info + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 25, + vertical: 5, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Email '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: ' Test@test.com', + hintStyle: + context.bodyMedium.copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + Container( + height: 1, + color: ColorsManager.greyColor, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Region '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'United Arab Emirates', + hintStyle: + context.bodyMedium.copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + Container( + height: 1, + color: ColorsManager.greyColor, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Time Zone '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'GMT +4', + hintStyle: + context.bodyMedium.copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + ], + )), + ], + ), + ); + } +} diff --git a/lib/features/menu/view/widgets/profile_tab.dart b/lib/features/menu/view/widgets/profile_tab.dart deleted file mode 100644 index bfc7a16..0000000 --- a/lib/features/menu/view/widgets/profile_tab.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:syncrow_app/features/shared_widgets/default_container.dart'; -import 'package:syncrow_app/features/shared_widgets/syncrow_logo.dart'; -import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; -import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; - -class ProfileTab extends StatelessWidget { - const ProfileTab({ - super.key, - }); - - @override - Widget build(BuildContext context) { - return const Padding( - padding: EdgeInsets.symmetric(vertical: 10), - child: Stack( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - SizedBox(height: 20), - DefaultContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BodyMedium( - text: "Karim", - fontWeight: FontWeight.bold, - ), - BodySmall(text: "Syncrow Account") - ], - ), - ), - ], - ), - Positioned( - right: 20, - top: 0, - child: CircleAvatar( - radius: 38, - backgroundColor: Colors.white, - child: CircleAvatar( - radius: 37, - backgroundColor: Colors.grey, - child: SyncrowLogo(), - ), - ), - ), - ], - ), - ); - } -} diff --git a/lib/features/profile/bloc/profile_cubit.dart b/lib/features/profile/bloc/profile_cubit.dart deleted file mode 100644 index 015ab62..0000000 --- a/lib/features/profile/bloc/profile_cubit.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:flutter_bloc/flutter_bloc.dart'; - -part 'profile_state.dart'; - -class ProfileCubit extends Cubit { - ProfileCubit() : super(ProfileInitial()); -} diff --git a/lib/features/profile/bloc/profile_state.dart b/lib/features/profile/bloc/profile_state.dart deleted file mode 100644 index 1c91759..0000000 --- a/lib/features/profile/bloc/profile_state.dart +++ /dev/null @@ -1,5 +0,0 @@ -part of 'profile_cubit.dart'; - -abstract class ProfileState {} - -class ProfileInitial extends ProfileState {} diff --git a/lib/features/profile/view/profile_view.dart b/lib/features/profile/view/profile_view.dart deleted file mode 100644 index cde2cd5..0000000 --- a/lib/features/profile/view/profile_view.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_app/features/profile/bloc/profile_cubit.dart'; - -class ProfileView extends StatelessWidget { - const ProfileView({super.key}); - - @override - Widget build(BuildContext context) { - return BlocProvider( - create: (context) => ProfileCubit(), - child: BlocBuilder( - builder: (context, state) { - return const Center( - child: Text('Profile Page'), - ); - }, - ), - ); - } -} From 3a41a7118d1bd651933bbaffa8e897b29849658f Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 16:53:41 +0300 Subject: [PATCH 07/11] Added Create Home Page --- lib/features/menu/view/menu_view.dart | 3 +- .../home management/create_home_view.dart | 124 ++++++++++++++++++ .../menu/view/widgets/menu_list_item.dart | 1 + .../shared_widgets/default_scaffold.dart | 5 +- lib/navigation/router.dart | 2 +- 5 files changed, 132 insertions(+), 3 deletions(-) create mode 100644 lib/features/menu/view/widgets/home management/create_home_view.dart diff --git a/lib/features/menu/view/menu_view.dart b/lib/features/menu/view/menu_view.dart index 97af28e..9850f05 100644 --- a/lib/features/menu/view/menu_view.dart +++ b/lib/features/menu/view/menu_view.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart'; import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart'; +import 'package:syncrow_app/features/menu/view/widgets/home%20management/create_home_view.dart'; import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart'; import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; @@ -86,7 +87,7 @@ List> menuSections = [ { 'title': 'Create a Home', 'Icon': Assets.homeManagementIconsCreateHome, - 'page': null + 'page': const CreateHomeView() }, { 'title': 'Join a Home', diff --git a/lib/features/menu/view/widgets/home management/create_home_view.dart b/lib/features/menu/view/widgets/home management/create_home_view.dart new file mode 100644 index 0000000..d1f978f --- /dev/null +++ b/lib/features/menu/view/widgets/home management/create_home_view.dart @@ -0,0 +1,124 @@ +// ignore_for_file: unnecessary_const +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; + +class CreateHomeView extends StatelessWidget { + const CreateHomeView({super.key}); + + @override + Widget build(BuildContext context) { + return DefaultScaffold( + actions: [ + TextButton( + onPressed: () {}, + child: const BodyLarge( + text: 'Save', + fontWeight: FontWeight.bold, + ), + ), + ], + title: 'Create Home', + child: Column( + children: [ + //Home Info + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 25, + vertical: 5, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Home Name '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'Enter Name', + hintStyle: + context.bodyMedium.copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + Container( + height: 1, + color: ColorsManager.greyColor, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Location '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'Set', + hintStyle: + context.bodyMedium.copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + ], + ), + ), + + //Rooms Info + const SizedBox(height: 10), + const Row( + children: [ + SizedBox( + width: 25, + ), + BodySmall( + text: 'Rooms', + fontWeight: FontWeight.bold, + ), + ], + ), + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 25, + vertical: 5, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + TextButton( + onPressed: () { + //TODO add room + }, + child: const Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + BodyMedium( + text: 'Add Room', + fontColor: ColorsManager.primaryColor, + ), + ], + )) + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/features/menu/view/widgets/menu_list_item.dart b/lib/features/menu/view/widgets/menu_list_item.dart index 264e2b8..8f8d94b 100644 --- a/lib/features/menu/view/widgets/menu_list_item.dart +++ b/lib/features/menu/view/widgets/menu_list_item.dart @@ -19,6 +19,7 @@ class MenuListItem extends StatelessWidget { Widget build(BuildContext context) { return InkWell( onTap: () { + debugPrint('clicked $title page: $page'); if (page == null) { return; } diff --git a/lib/features/shared_widgets/default_scaffold.dart b/lib/features/shared_widgets/default_scaffold.dart index c673dd3..1a1f0df 100644 --- a/lib/features/shared_widgets/default_scaffold.dart +++ b/lib/features/shared_widgets/default_scaffold.dart @@ -8,10 +8,12 @@ import 'package:syncrow_app/utils/resource_manager/constants.dart'; import 'package:syncrow_app/utils/resource_manager/font_manager.dart'; class DefaultScaffold extends StatelessWidget { - const DefaultScaffold({super.key, required this.child, this.title}); + const DefaultScaffold( + {super.key, required this.child, this.title, this.actions}); final Widget child; final String? title; + final List? actions; @override Widget build(BuildContext context) { return AnnotatedRegion( @@ -32,6 +34,7 @@ class DefaultScaffold extends StatelessWidget { fontColor: ColorsManager.primaryColor, fontWeight: FontsManager.bold, ), + actions: actions, ), body: Container( width: MediaQuery.sizeOf(context).width, diff --git a/lib/navigation/router.dart b/lib/navigation/router.dart index 4b84208..c2b1382 100644 --- a/lib/navigation/router.dart +++ b/lib/navigation/router.dart @@ -9,7 +9,7 @@ import 'package:syncrow_app/features/auth/view/widgets/user_agreement/user_agree import 'package:syncrow_app/features/dashboard/view/dashboard_view.dart'; import 'package:syncrow_app/features/layout/view/layout_view.dart'; import 'package:syncrow_app/features/menu/view/menu_view.dart'; -import 'package:syncrow_app/features/profile/view/profile_view.dart'; +import 'package:syncrow_app/features/menu/view/widgets/profile/profile_view.dart'; import 'package:syncrow_app/features/scene/view/scene_view.dart'; import 'package:syncrow_app/features/splash/view/splash_view.dart'; From 8550e81b4e722b7d4648489ceb76f92ba7efcf96 Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 20:19:43 +0300 Subject: [PATCH 08/11] Added join home page --- lib/features/menu/view/menu_view.dart | 3 +- .../widgets/join_home/join_home_view.dart | 63 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 lib/features/menu/view/widgets/join_home/join_home_view.dart diff --git a/lib/features/menu/view/menu_view.dart b/lib/features/menu/view/menu_view.dart index 9850f05..008f099 100644 --- a/lib/features/menu/view/menu_view.dart +++ b/lib/features/menu/view/menu_view.dart @@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart'; import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart'; import 'package:syncrow_app/features/menu/view/widgets/home%20management/create_home_view.dart'; +import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view.dart'; import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart'; import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; @@ -92,7 +93,7 @@ List> menuSections = [ { 'title': 'Join a Home', 'Icon': Assets.homeManagementIconsJoinAHome, - 'page': null + 'page': const JoinHomeView() }, { 'title': 'Manage Your Home', diff --git a/lib/features/menu/view/widgets/join_home/join_home_view.dart b/lib/features/menu/view/widgets/join_home/join_home_view.dart new file mode 100644 index 0000000..25b6e14 --- /dev/null +++ b/lib/features/menu/view/widgets/join_home/join_home_view.dart @@ -0,0 +1,63 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/generated/assets.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; + +class JoinHomeView extends StatelessWidget { + const JoinHomeView({super.key}); + + @override + Widget build(BuildContext context) { + return DefaultScaffold( + title: "Join a Home", + child: Column( + children: [ + SvgPicture.asset( + Assets.homeManagementIconsJoinAHome, + width: 70, + height: 70, + ), + const Padding( + padding: EdgeInsets.symmetric( + vertical: 30, + ), + child: BodyMedium( + textAlign: TextAlign.center, + text: + 'Please contact with the\nadministration to get an invitation\n(Menu → Manage your Home → Add Member)'), + ), + DefaultContainer( + padding: const EdgeInsets.symmetric( + vertical: 5, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: TextField( + decoration: InputDecoration( + hintText: 'Invitatoin code', + hintStyle: + context.bodyMedium.copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.arrow_right_alt, + ), + ), + ], + ), + ), + ], + ), + ); + } +} From 7e3f68b65f336462971ca2bae836e2bc429fd8e5 Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 21:58:11 +0300 Subject: [PATCH 09/11] Added Manage Home Page And Home Settings Page --- lib/features/menu/view/menu_view.dart | 5 +- .../home management/create_home_view.dart | 2 +- .../widgets/manage_home/home_settings.dart | 174 ++++++++++++++++++ .../widgets/manage_home/manage_home_view.dart | 110 +++++++++++ 4 files changed, 288 insertions(+), 3 deletions(-) create mode 100644 lib/features/menu/view/widgets/manage_home/home_settings.dart create mode 100644 lib/features/menu/view/widgets/manage_home/manage_home_view.dart diff --git a/lib/features/menu/view/menu_view.dart b/lib/features/menu/view/menu_view.dart index 008f099..51eb9d7 100644 --- a/lib/features/menu/view/menu_view.dart +++ b/lib/features/menu/view/menu_view.dart @@ -4,6 +4,7 @@ import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart'; import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart'; import 'package:syncrow_app/features/menu/view/widgets/home%20management/create_home_view.dart'; import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view.dart'; +import 'package:syncrow_app/features/menu/view/widgets/manage_home/manage_home_view.dart'; import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart'; import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; @@ -98,14 +99,14 @@ List> menuSections = [ { 'title': 'Manage Your Home', 'Icon': Assets.homeManagementIconsManageYourHome, - 'page': null + 'page': const ManageHomeView() }, ], }, //General Settings { 'title': 'General Settings', - 'color': const Color(0xFF0030CB), + 'color': const Color(0xFF023DFE), 'buttons': [ { 'title': 'Voice Assistant', diff --git a/lib/features/menu/view/widgets/home management/create_home_view.dart b/lib/features/menu/view/widgets/home management/create_home_view.dart index d1f978f..4d3ee08 100644 --- a/lib/features/menu/view/widgets/home management/create_home_view.dart +++ b/lib/features/menu/view/widgets/home management/create_home_view.dart @@ -5,7 +5,6 @@ import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; -import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart'; import 'package:syncrow_app/utils/context_extension.dart'; import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; @@ -54,6 +53,7 @@ class CreateHomeView extends StatelessWidget { ), ], ), + //Divider Container( height: 1, color: ColorsManager.greyColor, diff --git a/lib/features/menu/view/widgets/manage_home/home_settings.dart b/lib/features/menu/view/widgets/manage_home/home_settings.dart new file mode 100644 index 0000000..ea9aa46 --- /dev/null +++ b/lib/features/menu/view/widgets/manage_home/home_settings.dart @@ -0,0 +1,174 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/app_layout/model/space_model.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; + +class HomeSettingsView extends StatelessWidget { + const HomeSettingsView({super.key, this.space}); + + final SpaceModel? space; + @override + Widget build(BuildContext context) { + return DefaultScaffold( + title: 'Home Settings', + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + //Home Info + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 25, + vertical: 10, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Name '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'Enter Name', + hintStyle: + context.bodyMedium.copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + //Divider + Container( + margin: const EdgeInsets.only(bottom: 10), + height: 1, + color: ColorsManager.greyColor, + ), + const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + BodyMedium(text: 'Rooms'), + Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + //Divider + Container( + height: 1, + margin: const EdgeInsets.only(top: 10), + color: ColorsManager.greyColor, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Location'), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'Set', + hintStyle: + context.bodyMedium.copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + ], + ), + ), + //Members Info + const SizedBox( + height: 10, + ), + //TODO connect the members to this GridView + const BodySmall( + text: "Members", + fontWeight: FontWeight.bold, + ), + GridView.builder( + shrinkWrap: true, + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 10, + ), + itemCount: 4, + itemBuilder: (context, index) => Stack( + alignment: Alignment.topCenter, + children: [ + DefaultContainer( + margin: const EdgeInsets.only(top: 20), + padding: + const EdgeInsets.symmetric(vertical: 15, horizontal: 40), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const SizedBox( + height: 50, + ), + BodyMedium( + text: 'Member ${index + 1}', + fontWeight: FontWeight.bold, + ), + const SizedBox(height: 3), + const BodySmall( + text: 'Syncrow Account', + textAlign: TextAlign.center, + ), + ], + ), + ), + const SizedBox.square( + dimension: 80, + child: CircleAvatar( + backgroundColor: Colors.white, + child: SizedBox.square( + dimension: 77, + child: CircleAvatar( + backgroundColor: ColorsManager.greyColor, + child: Icon(Icons.person), + ), + ), + ), + ) + ], + ), + ), + const Spacer(), + InkWell( + onTap: () {}, + child: Row( + children: [ + Expanded( + child: DefaultContainer( + child: Center( + child: BodyLarge( + text: 'Leave Home', + style: context.bodyLarge.copyWith( + color: Colors.red, + ), + ), + ), + ), + ), + ], + ), + ) + ], + ), + ); + } +} diff --git a/lib/features/menu/view/widgets/manage_home/manage_home_view.dart b/lib/features/menu/view/widgets/manage_home/manage_home_view.dart new file mode 100644 index 0000000..d6eab2a --- /dev/null +++ b/lib/features/menu/view/widgets/manage_home/manage_home_view.dart @@ -0,0 +1,110 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart'; +import 'package:syncrow_app/features/menu/view/widgets/manage_home/home_settings.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/utils/helpers/custom_page_route.dart'; +import 'package:syncrow_app/utils/helpers/misc_string_helpers.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; + +class ManageHomeView extends StatelessWidget { + const ManageHomeView({super.key}); + + @override + Widget build(BuildContext context) { + var spaces = HomeCubit.getInstance().spaces; + return DefaultScaffold( + title: 'Manage Your Home', + child: spaces == null + ? const Center( + child: CircularProgressIndicator(), + ) + : Column( + children: [ + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 25, + vertical: 20, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: List.generate( + spaces.length, + (index) { + if (index == spaces.length - 1) { + return InkWell( + onTap: () { + Navigator.of(context).push(CustomPageRoute( + builder: (context) => HomeSettingsView( + space: spaces[index], + ))); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + BodyMedium( + text: StringHelpers.toTitleCase( + spaces[index].name ?? "")), + const Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + ); + } + return InkWell( + onTap: () { + //TODO refactor the routing to use named routes + // Navigator.of(context).pushNamed( + // '/home_settings', + // arguments: spaces[index], + // ); + + Navigator.of(context).push(CustomPageRoute( + builder: (context) => HomeSettingsView( + space: spaces[index], + ))); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + BodyMedium( + text: HomeCubit.getInstance() + .spaces![index] + .name ?? + ""), + const Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + Container( + margin: + const EdgeInsets.symmetric(vertical: 15), + height: 1, + color: ColorsManager.greyColor, + ), + ], + ), + ); + }, + ), + ), + ), + ], + )); + } +} From 48e6ae2bd39ac4bab54c721d5a181f170402bda1 Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 22:09:32 +0300 Subject: [PATCH 10/11] Added Securty Page --- lib/features/menu/view/menu_view.dart | 3 +- .../view/widgets/securty/securty_view.dart | 157 ++++++++++++++++++ 2 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 lib/features/menu/view/widgets/securty/securty_view.dart diff --git a/lib/features/menu/view/menu_view.dart b/lib/features/menu/view/menu_view.dart index 51eb9d7..2d9ed1d 100644 --- a/lib/features/menu/view/menu_view.dart +++ b/lib/features/menu/view/menu_view.dart @@ -7,6 +7,7 @@ import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view. import 'package:syncrow_app/features/menu/view/widgets/manage_home/manage_home_view.dart'; import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart'; import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart'; +import 'package:syncrow_app/features/menu/view/widgets/securty/securty_view.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; import 'package:syncrow_app/generated/assets.dart'; @@ -171,7 +172,7 @@ List> menuSections = [ { 'title': 'Security', 'Icon': Assets.securityAndPrivacyIconsSecurty, - 'page': null + 'page': const SecurtyView() }, { 'title': 'Privacy', diff --git a/lib/features/menu/view/widgets/securty/securty_view.dart b/lib/features/menu/view/widgets/securty/securty_view.dart new file mode 100644 index 0000000..65e1d94 --- /dev/null +++ b/lib/features/menu/view/widgets/securty/securty_view.dart @@ -0,0 +1,157 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; + +class SecurtyView extends StatelessWidget { + const SecurtyView({super.key}); + + @override + Widget build(BuildContext context) { + return DefaultScaffold( + title: 'Securty', + child: Column( + children: [ + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 25, + vertical: 20, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + InkWell( + onTap: () {}, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + BodyMedium( + text: 'Change Password', + ), + Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + Container( + margin: const EdgeInsets.symmetric(vertical: 15), + height: 1, + color: ColorsManager.greyColor, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + BodyMedium( + text: 'App Lock', + ), + Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + Container( + margin: const EdgeInsets.symmetric(vertical: 15), + height: 1, + color: ColorsManager.greyColor, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + BodyMedium( + text: 'User Code', + ), + Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + Container( + margin: const EdgeInsets.symmetric(vertical: 15), + height: 1, + color: ColorsManager.greyColor, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + BodyMedium( + text: 'Delete Account', + ), + Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + Container( + margin: const EdgeInsets.symmetric(vertical: 15), + height: 1, + color: ColorsManager.greyColor, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + BodyMedium( + text: 'Device Update', + ), + Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + ), + ], + ), + ), + ], + ), + ); + } +} From 8127c1978c76f86d0be9f65dcf12d60cc9ebb284 Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Tue, 23 Apr 2024 22:13:32 +0300 Subject: [PATCH 11/11] Added Privacy View --- lib/features/menu/view/menu_view.dart | 3 +- .../view/widgets/privacy/privacy_view.dart | 76 +++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 lib/features/menu/view/widgets/privacy/privacy_view.dart diff --git a/lib/features/menu/view/menu_view.dart b/lib/features/menu/view/menu_view.dart index 2d9ed1d..ff7e9ca 100644 --- a/lib/features/menu/view/menu_view.dart +++ b/lib/features/menu/view/menu_view.dart @@ -6,6 +6,7 @@ import 'package:syncrow_app/features/menu/view/widgets/home%20management/create_ import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view.dart'; import 'package:syncrow_app/features/menu/view/widgets/manage_home/manage_home_view.dart'; import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart'; +import 'package:syncrow_app/features/menu/view/widgets/privacy/privacy_view.dart'; import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart'; import 'package:syncrow_app/features/menu/view/widgets/securty/securty_view.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; @@ -177,7 +178,7 @@ List> menuSections = [ { 'title': 'Privacy', 'Icon': Assets.securityAndPrivacyIconsPrivacy, - 'page': null + 'page': const PrivacyView() }, ], }, diff --git a/lib/features/menu/view/widgets/privacy/privacy_view.dart b/lib/features/menu/view/widgets/privacy/privacy_view.dart new file mode 100644 index 0000000..4dd9340 --- /dev/null +++ b/lib/features/menu/view/widgets/privacy/privacy_view.dart @@ -0,0 +1,76 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; + +class PrivacyView extends StatelessWidget { + const PrivacyView({super.key}); + + @override + Widget build(BuildContext context) { + return DefaultScaffold( + title: 'Privacy', + child: Column( + children: [ + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 25, + vertical: 20, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + InkWell( + onTap: () {}, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + BodyMedium( + text: 'Notification Settings', + ), + Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + Container( + margin: const EdgeInsets.symmetric(vertical: 15), + height: 1, + color: ColorsManager.greyColor, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + BodyMedium( + text: 'Permissions Settings', + ), + Icon( + Icons.arrow_forward_ios, + color: ColorsManager.greyColor, + size: 15, + ) + ], + ), + ), + ], + ), + ), + ], + ), + ); + } +}