Skip to content

Commit 16ab68d

Browse files
authored
Merge pull request #20 from abuanwar072/Episode-7
Episode 7
2 parents 48a19c6 + d3b4948 commit 16ab68d

File tree

12 files changed

+249
-21
lines changed

12 files changed

+249
-21
lines changed

ios/Flutter/.last_build_id

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
566e948a25ceebd6aee200c875535419
1+
0dabab35cceb7bbdf460606d9a5b02a1
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_svg/flutter_svg.dart';
3+
import 'package:shop_app/screens/home/home_screen.dart';
4+
import 'package:shop_app/screens/profile/profile_screen.dart';
5+
6+
import '../constants.dart';
7+
import '../enums.dart';
8+
9+
class CustomBottomNavBar extends StatelessWidget {
10+
const CustomBottomNavBar({
11+
Key key,
12+
@required this.selectedMenu,
13+
}) : super(key: key);
14+
15+
final MenuState selectedMenu;
16+
17+
@override
18+
Widget build(BuildContext context) {
19+
final Color inActiveIconColor = Color(0xFFB6B6B6);
20+
return Container(
21+
padding: EdgeInsets.symmetric(vertical: 14),
22+
decoration: BoxDecoration(
23+
color: Colors.white,
24+
boxShadow: [
25+
BoxShadow(
26+
offset: Offset(0, -15),
27+
blurRadius: 20,
28+
color: Color(0xFFDADADA).withOpacity(0.15),
29+
),
30+
],
31+
borderRadius: BorderRadius.only(
32+
topLeft: Radius.circular(40),
33+
topRight: Radius.circular(40),
34+
),
35+
),
36+
child: SafeArea(
37+
top: false,
38+
child: Row(
39+
mainAxisAlignment: MainAxisAlignment.spaceAround,
40+
children: [
41+
IconButton(
42+
icon: SvgPicture.asset(
43+
"assets/icons/Shop Icon.svg",
44+
color: MenuState.home == selectedMenu
45+
? kPrimaryColor
46+
: inActiveIconColor,
47+
),
48+
onPressed: () =>
49+
Navigator.pushNamed(context, HomeScreen.routeName),
50+
),
51+
IconButton(
52+
icon: SvgPicture.asset("assets/icons/Heart Icon.svg"),
53+
onPressed: () {},
54+
),
55+
IconButton(
56+
icon: SvgPicture.asset("assets/icons/Chat bubble Icon.svg"),
57+
onPressed: () {},
58+
),
59+
IconButton(
60+
icon: SvgPicture.asset(
61+
"assets/icons/User Icon.svg",
62+
color: MenuState.profile == selectedMenu
63+
? kPrimaryColor
64+
: inActiveIconColor,
65+
),
66+
onPressed: () =>
67+
Navigator.pushNamed(context, ProfileScreen.routeName),
68+
),
69+
],
70+
)),
71+
);
72+
}
73+
}

lib/enums.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enum MenuState { home, favourite, message, profile }

lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:shop_app/routes.dart';
3+
import 'package:shop_app/screens/profile/profile_screen.dart';
34
import 'package:shop_app/screens/splash/splash_screen.dart';
45
import 'package:shop_app/theme.dart';
56

lib/routes.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import 'package:shop_app/screens/forgot_password/forgot_password_screen.dart';
66
import 'package:shop_app/screens/home/home_screen.dart';
77
import 'package:shop_app/screens/login_success/login_success_screen.dart';
88
import 'package:shop_app/screens/otp/otp_screen.dart';
9+
import 'package:shop_app/screens/profile/my_account_screen.dart';
10+
import 'package:shop_app/screens/profile/profile_screen.dart';
911
import 'package:shop_app/screens/sign_in/sign_in_screen.dart';
1012
import 'package:shop_app/screens/splash/splash_screen.dart';
1113

@@ -24,4 +26,6 @@ final Map<String, WidgetBuilder> routes = {
2426
HomeScreen.routeName: (context) => HomeScreen(),
2527
DetailsScreen.routeName: (context) => DetailsScreen(),
2628
CartScreen.routeName: (context) => CartScreen(),
29+
ProfileScreen.routeName: (context) => ProfileScreen(),
30+
MyAccountScreen.routeName: (context) => MyAccountScreen(),
2731
};

lib/screens/home/home_screen.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import 'package:flutter/material.dart';
2+
import 'package:shop_app/components/coustom_bottom_nav_bar.dart';
3+
import 'package:shop_app/enums.dart';
24

35
import 'components/body.dart';
46

@@ -8,6 +10,7 @@ class HomeScreen extends StatelessWidget {
810
Widget build(BuildContext context) {
911
return Scaffold(
1012
body: Body(),
13+
bottomNavigationBar: CustomBottomNavBar(selectedMenu: MenuState.home),
1114
);
1215
}
1316
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import 'package:flutter/material.dart';
2+
3+
import 'profile_menu.dart';
4+
import 'profile_pic.dart';
5+
6+
class Body extends StatelessWidget {
7+
@override
8+
Widget build(BuildContext context) {
9+
return SingleChildScrollView(
10+
padding: EdgeInsets.symmetric(vertical: 20),
11+
child: Column(
12+
children: [
13+
ProfilePic(),
14+
SizedBox(height: 20),
15+
ProfileMenu(
16+
text: "My Account",
17+
icon: "assets/icons/User Icon.svg",
18+
press: () => {},
19+
),
20+
ProfileMenu(
21+
text: "Notifications",
22+
icon: "assets/icons/Bell.svg",
23+
press: () {},
24+
),
25+
ProfileMenu(
26+
text: "Settings",
27+
icon: "assets/icons/Settings.svg",
28+
press: () {},
29+
),
30+
ProfileMenu(
31+
text: "Help Center",
32+
icon: "assets/icons/Question mark.svg",
33+
press: () {},
34+
),
35+
ProfileMenu(
36+
text: "Log Out",
37+
icon: "assets/icons/Log out.svg",
38+
press: () {},
39+
),
40+
],
41+
),
42+
);
43+
}
44+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_svg/flutter_svg.dart';
3+
4+
import '../../../constants.dart';
5+
6+
class ProfileMenu extends StatelessWidget {
7+
const ProfileMenu({
8+
Key key,
9+
@required this.text,
10+
@required this.icon,
11+
this.press,
12+
}) : super(key: key);
13+
14+
final String text, icon;
15+
final VoidCallback press;
16+
17+
@override
18+
Widget build(BuildContext context) {
19+
return Padding(
20+
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
21+
child: FlatButton(
22+
padding: EdgeInsets.all(20),
23+
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
24+
color: Color(0xFFF5F6F9),
25+
onPressed: press,
26+
child: Row(
27+
children: [
28+
SvgPicture.asset(
29+
icon,
30+
color: kPrimaryColor,
31+
width: 22,
32+
),
33+
SizedBox(width: 20),
34+
Expanded(child: Text(text)),
35+
Icon(Icons.arrow_forward_ios),
36+
],
37+
),
38+
),
39+
);
40+
}
41+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_svg/flutter_svg.dart';
3+
4+
class ProfilePic extends StatelessWidget {
5+
const ProfilePic({
6+
Key key,
7+
}) : super(key: key);
8+
9+
@override
10+
Widget build(BuildContext context) {
11+
return SizedBox(
12+
height: 115,
13+
width: 115,
14+
child: Stack(
15+
fit: StackFit.expand,
16+
overflow: Overflow.visible,
17+
children: [
18+
CircleAvatar(
19+
backgroundImage: AssetImage("assets/images/Profile Image.png"),
20+
),
21+
Positioned(
22+
right: -16,
23+
bottom: 0,
24+
child: SizedBox(
25+
height: 46,
26+
width: 46,
27+
child: FlatButton(
28+
shape: RoundedRectangleBorder(
29+
borderRadius: BorderRadius.circular(50),
30+
side: BorderSide(color: Colors.white),
31+
),
32+
color: Color(0xFFF5F6F9),
33+
onPressed: () {},
34+
child: SvgPicture.asset("assets/icons/Camera Icon.svg"),
35+
),
36+
),
37+
)
38+
],
39+
),
40+
);
41+
}
42+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:shop_app/components/coustom_bottom_nav_bar.dart';
3+
import 'package:shop_app/enums.dart';
4+
5+
import 'components/body.dart';
6+
7+
class ProfileScreen extends StatelessWidget {
8+
static String routeName = "/profile";
9+
@override
10+
Widget build(BuildContext context) {
11+
return Scaffold(
12+
appBar: AppBar(
13+
title: Text("Profile"),
14+
),
15+
body: Body(),
16+
bottomNavigationBar: CustomBottomNavBar(selectedMenu: MenuState.profile),
17+
);
18+
}
19+
}

0 commit comments

Comments
 (0)