Merge branch 'dev' into finishing_smart_door_pages

This commit is contained in:
Mohammad Salameh
2024-04-28 09:34:47 +03:00
committed by GitHub
40 changed files with 1281 additions and 225 deletions
+81 -83
View File
@@ -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<MenuState> {
static MenuCubit of(context) => BlocProvider.of<MenuCubit>(context);
List<MenuListModel> 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<MenuListModel> 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',
// ),
// ],
// ),
// ];
}
@@ -1,9 +0,0 @@
class ListItemModel {
final String? icon;
final String? label;
ListItemModel({
this.icon,
this.label,
});
}
@@ -1,11 +0,0 @@
import 'list_item_model.dart';
class MenuListModel {
final String? label;
final List<ListItemModel?>? listItems;
MenuListModel({
this.label,
this.listItems,
});
}
+132 -6
View File
@@ -2,12 +2,19 @@ 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/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_tab.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';
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 +40,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 +81,123 @@ class MenuView extends StatelessWidget {
);
}
}
List<Map<String, Object>> menuSections = [
//Home Management
{
'title': 'Home Management',
'color': ColorsManager.primaryColor,
'buttons': [
{
'title': 'Create a Home',
'Icon': Assets.homeManagementIconsCreateHome,
'page': const CreateHomeView()
},
{
'title': 'Join a Home',
'Icon': Assets.homeManagementIconsJoinAHome,
'page': const JoinHomeView()
},
{
'title': 'Manage Your Home',
'Icon': Assets.homeManagementIconsManageYourHome,
'page': const ManageHomeView()
},
],
},
//General Settings
{
'title': 'General Settings',
'color': const Color(0xFF023DFE),
'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': const SecurtyView()
},
{
'title': 'Privacy',
'Icon': Assets.securityAndPrivacyIconsPrivacy,
'page': const PrivacyView()
},
],
},
//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
},
],
},
];
@@ -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/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,
),
),
),
],
),
//Divider
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,
),
],
))
],
),
),
],
),
);
}
}
@@ -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,
),
),
],
),
),
],
),
);
}
}
@@ -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,
),
),
),
),
),
],
),
)
],
),
);
}
}
@@ -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,
),
],
),
);
},
),
),
),
],
));
}
}
@@ -1,5 +1,4 @@
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';
@@ -8,10 +7,10 @@ import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart
class MenuList extends StatelessWidget {
const MenuList({
super.key,
required this.listModel,
required this.section,
});
final MenuListModel listModel;
final Map<String, dynamic> section;
@override
Widget build(BuildContext context) {
@@ -20,7 +19,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 +27,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()),
@@ -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: () {
debugPrint('clicked $title page: $page');
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,
)
],
),
);
}
}
@@ -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,
)
],
),
),
],
),
),
],
),
);
}
}
@@ -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(),
),
),
),
],
),
),
);
}
}
@@ -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: ' [email protected]',
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,
),
),
),
],
),
],
)),
],
),
);
}
}
@@ -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(),
),
),
),
],
),
);
}
}
@@ -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,
)
],
),
),
],
),
),
],
),
);
}
}
@@ -1,7 +0,0 @@
import 'package:flutter_bloc/flutter_bloc.dart';
part 'profile_state.dart';
class ProfileCubit extends Cubit<ProfileState> {
ProfileCubit() : super(ProfileInitial());
}
@@ -1,5 +0,0 @@
part of 'profile_cubit.dart';
abstract class ProfileState {}
class ProfileInitial extends ProfileState {}
@@ -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<ProfileCubit, ProfileState>(
builder: (context, state) {
return const Center(
child: Text('Profile Page'),
);
},
),
);
}
}
@@ -1,3 +1,4 @@
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';
+36
View File
@@ -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 generalSettingsIconsClearCache =
'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';
@@ -162,6 +180,20 @@ class Assets {
'assets/icons/linkageIcons/doorLockAlarm.svg';
static const String linkageIconsFamilyHome =
'assets/icons/linkageIcons/familyHome.svg';
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 messagesCenterIconsHelpAndFeedbacks =
'assets/icons/MenuIcons/MessagesCenterIcons/HelpAndFeedback.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 =
@@ -192,4 +224,8 @@ class Assets {
'assets/icons/unlockingMethodsIcons/fingerprint.svg';
static const String unlockingMethodsIconsRemote =
'assets/icons/unlockingMethodsIcons/remote.svg';
static const String securityAndPrivacyIconsPrivacy =
'assets/icons/MenuIcons/SecurityAndPrivacyIcons/Privacy.svg';
static const String securityAndPrivacyIconsSecurty =
'assets/icons/MenuIcons/SecurityAndPrivacyIcons/Securty.svg';
}
+1 -1
View File
@@ -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';