Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu tab #360

Open
wants to merge 23 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ada75b8
Finishing half of the UI of the menu tab
AbedrahmanYassen Feb 7, 2023
1b02c31
Finishing the Menu screen as a UI.
AbedrahmanYassen Feb 9, 2023
a176209
Finishing the menu tab, and removing the settings screen.
AbedrahmanYassen Feb 12, 2023
c0fd484
Merge branch 'development' of https://github.com/CollActionteam/colla…
AbedrahmanYassen Feb 12, 2023
b77f84c
Solving the the inconsistencies.
AbedrahmanYassen Feb 14, 2023
7ddabec
Solving the the inconsistencies.
AbedrahmanYassen Feb 14, 2023
cf9b0b0
fix: add manual logging to auth repo
Xazin Mar 4, 2023
8d903e3
Deleting settings folder at the testing part
AbedrahmanYassen Mar 4, 2023
fa2d650
Deleting settings folder at the testing part
AbedrahmanYassen Mar 4, 2023
649893f
Merge pull request #371 from CollActionteam/fix/manual-logging-auth-repo
Xazin Mar 4, 2023
023d67e
chore: upgrade gradle build tools and dependencies
Xazin Mar 4, 2023
2aa649c
Finishing half of the UI of the menu tab
AbedrahmanYassen Feb 7, 2023
2814954
Finishing the Menu screen as a UI.
AbedrahmanYassen Feb 9, 2023
51705a2
Finishing the menu tab, and removing the settings screen.
AbedrahmanYassen Feb 12, 2023
6e8121f
Solving the the inconsistencies.
AbedrahmanYassen Feb 14, 2023
88a9f1b
Solving the the inconsistencies.
AbedrahmanYassen Feb 14, 2023
061f6e8
Deleting settings folder at the testing part
AbedrahmanYassen Mar 4, 2023
f727c0c
refactor: amend according to design, fix connecitivty, remove redunda…
Xazin Mar 16, 2023
1309fa0
Update lib/presentation/menu/menu_screen.dart
AbedrahmanYassen Apr 14, 2023
a74ca0b
Update lib/presentation/menu/menu_screen.dart
AbedrahmanYassen Apr 14, 2023
8b9fe77
Merge branch 'development' into menu_tab
AbedrahmanYassen Apr 14, 2023
0575f6a
I have added the .env.example and edited the _subTitle function into …
AbedrahmanYassen Apr 14, 2023
5012b82
I have added the .env.example and edited the _subTitle function into …
AbedrahmanYassen Apr 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/collaction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'dart:async';
import 'dart:async';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why another space?


import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
Expand Down
7 changes: 6 additions & 1 deletion lib/presentation/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class HomePageState extends State<HomePage> {
if (!kReleaseMode) ...[
DemoScreenRouter(),
],
MenuScreenRouter()
],
bottomNavigationBuilder: (_, tabsRouter) => bottomNavbar(tabsRouter),
);
Expand All @@ -55,7 +56,7 @@ class HomePageState extends State<HomePage> {
unselectedItemColor: kDisabledButtonColor,
type: BottomNavigationBarType.fixed,
elevation: 0,
items: const [
items: [
BottomNavigationBarItem(
icon: Icon(CollactionIcons.collaction),
label: '',
Expand All @@ -72,6 +73,10 @@ class HomePageState extends State<HomePage> {
label: '',
),
],
BottomNavigationBarItem(
icon: Icon(Icons.grid_view,),
label: '',
),
],
currentIndex: tabsRouter.activeIndex,
onTap: tabsRouter.setActiveIndex,
Expand Down
305 changes: 305 additions & 0 deletions lib/presentation/menu/menu_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
import 'package:auto_route/auto_route.dart';
import 'widgets/build_information_tile.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

import '../../application/auth/auth_bloc.dart';
import '../../application/settings/build_information/build_information_bloc.dart';
import '../../application/user/profile/profile_bloc.dart';
import '../../infrastructure/core/injection.dart';
import '../routes/app_routes.gr.dart';
import '../utils/launch_url.dart';
import 'widgets/avatar_info.dart';
import 'widgets/legal_info_policy_widget.dart';
import 'package:flutter/material.dart';
import '../themes/constants.dart';
import '../core/collaction_icons.dart';

class MenuPage extends StatefulWidget {
const MenuPage({Key? key}) : super(key: key);

@override
State<MenuPage> createState() => _MenuTabState();
}

class _MenuTabState extends State<MenuPage> {
@override
Widget build(BuildContext context) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason for this being a Statefulwidget, can be stateless.

return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
child: BlocProvider<ProfileBloc>.value(
value: BlocProvider.of<ProfileBloc>(context),
child: BlocBuilder<ProfileBloc, ProfileState>(
builder: (context, state) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding:
const EdgeInsets.only(left: 20, top: 10, right: 22.5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"Menu",
style: TextStyle(
fontSize: 28,
fontFamily: "Rubik",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define fontFamily

fontWeight: FontWeight.w700,
),
),
IconButton(
onPressed: () {},
icon: Icon(
Icons.search,
color: kPrimaryColor600,
size: 21.08,
),
),
],
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should most likely be a common widget. Best to extract it.

SizedBox(
height: 30,
),
Container(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a Widget itself as well.

height: 85,
decoration: avatarInfoDecorationBox,
child: Padding(
padding: EdgeInsets.only(
left: 20,
top: 10,
bottom: 10,
right: 25.5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AvatarAndInfo(
pictureUrl: state.userProfile?.profile.avatar,
name: state.userProfile?.profile.firstName,
),
GestureDetector(
onTap: () {
},
child: Container(
child: Padding(
padding: const EdgeInsets.all(3.0),
child: Icon(
Icons.settings,
color: kPrimaryColor600,
size: 21,
),
),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma for Formatting

),
),
],
),
),
),
SizedBox(
height: 18,
),
GestureDetector(
onTap: () async {
BlocProvider.of<AuthBloc>(context)
.add(const AuthEvent.signedOut());
BlocProvider.of<ProfileBloc>(context)
.add(GetUserProfile());
await context.router.pop();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.logout,
color: kErrorColor,
),
SizedBox(
width: 2.5,
),
Text(
"Log out",
style: TextStyle(
color: kErrorColor,
fontFamily: "Rubik",
fontSize: 15,
fontWeight: FontWeight.w700,
),
)
],
),
),
],
),
),
_buildSubTitle(
subTitle: "Account", paddingTop: 38.5, paddingBottom: 20),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma for formatting

Padding(
padding: const EdgeInsets.only(left: 22.25),
child: GestureDetector(
onTap: () {},
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.account_circle,
color: kPrimaryColor300,
size: 19.5,
),
SizedBox(
width: 12.25,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Account Information",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: kPrimaryColor300),
),
SizedBox(
height: 5,
),
SizedBox(
width: 306,
child: Text(
"View and update your account and contact information that is associated with your CollAction account.",
style: TextStyle(
fontSize: 12,
color: kPrimaryColor300,
fontWeight: FontWeight.w400),
),
),
Comment on lines +115 to +124
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using a fixed width here (why even a sizedbox?)? This won't make it look well on devices.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix it soon, sorry I got exams 😥.

],
)
],
),
),
),
_buildSubTitle(
subTitle: "Feedback", paddingTop: 30, paddingBottom: 20),
Padding(
padding: const EdgeInsets.only(
left: 22.5,
),
child: GestureDetector(
onTap: () {},
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
CollactionIcons.message,
color: kPrimaryColor300,
size: 15,
),
SizedBox(
width: 16.25,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Contact us",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: kPrimaryColor300),
),
SizedBox(
height: 5,
),
SizedBox(
width: 305,
child: Text(
"Have a general enquiry, business proposal, or simply want us to send your feedback or regards? Get in contact with us through our form.",
style: TextStyle(
fontSize: 12,
color: kPrimaryColor300,
fontWeight: FontWeight.w400),
),
),
],
),
],
),
),
),
_buildSubTitle(
subTitle: "Legal information and policies",
paddingBottom: 24,
paddingTop: 30),
LegalInfoAndPoliciesWidget(
onTap: () async {
launchUrl(
'https://www.collaction.org/privacy',
useWebView: true,
context: context,
);
},
iconWidget: CollactionIcons.lock,
label: "Privacy Policy"),
LegalInfoAndPoliciesWidget(
onTap: () => launchUrl(
'https://www.collaction.org/terms',
useWebView: true,
context: context,
),
iconWidget: CollactionIcons.file,
label: "Terms & conditions"),
LegalInfoAndPoliciesWidget(
onTap: () => context.router.push(const LicensesRoute()),
iconWidget: CollactionIcons.opensource,
label: "Open-source libraries"),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
BlocBuilder<BuildInformationBloc,
BuildInformationState>(
bloc: getIt<BuildInformationBloc>()
..add(const BuildInformationEvent.fetch()),
builder: (context, state) {
return state.when(
loading: () => const SizedBox(),
fetched: (buildInfo) =>
BuildInformationTile(information: buildInfo),
);
},
),

],
)
],
),
),
),
),
),
);
}

Widget _buildSubTitle(
{required String subTitle,
double paddingTop = 0.0,
double paddingBottom = 0.0}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma for formatting

return Padding(
padding:
EdgeInsets.only(left: 20, top: paddingTop, bottom: paddingBottom),
child: Text(
subTitle,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w700,
color: kPrimaryColor300,
),
),
);
}
}
Loading