Skip to content

Commit 5e5515f

Browse files
authored
Merge pull request #18 from kavi-kv/local-branch
Done user profile and update profile page
2 parents 625f9c5 + ecdbf43 commit 5e5515f

File tree

14 files changed

+695
-12
lines changed

14 files changed

+695
-12
lines changed

assets/abdirahman_cj.jpeg

12 KB
Loading

assets/mo_ali.jpeg

19.6 KB
Loading

lib/consts/menus_list.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
1+
import 'package:flutter/material.dart';
2+
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
3+
import 'package:job_finder/views/components/user_profile.dart';
24

35
///Creates list of menus that routes different pages or different screens
46
final List<Map<String,dynamic>> menus=[
@@ -26,6 +28,12 @@ final List<Map<String,dynamic>> menus=[
2628
{
2729
"menuIcon": FaIcon(FontAwesomeIcons.user),
2830
"menuTitle": "Profile",
29-
"trailing": FaIcon(FontAwesomeIcons.angleRight)
31+
"trailing": FaIcon(FontAwesomeIcons.angleRight),
32+
"onClick" : (BuildContext context) {
33+
Navigator.push(
34+
context ,
35+
MaterialPageRoute(builder: (context) => const UserProfile()), // Navigate to ProfilePage
36+
);
37+
}
3038
}
3139
];

lib/consts/texts.dart

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,25 @@ const fullTime = "Full-time-job";
99
const jobLevel = "Senior Level";
1010
const softSkillsTxt = "Soft Skills";
1111
//? -> Job Card Page
12-
const applyBtnTxt = "Details";
12+
const applyBtnTxt = "Details";
13+
14+
//? -> Profile
15+
const tLogOut = "Logout";
16+
const tManagement = "User Management";
17+
const tSetting = "Settings";
18+
const tPrivacy = "Privacy";
19+
const tInfo = "Information";
20+
const tBookmark = "Bookmark";
21+
22+
//? -> Profile Update
23+
const tFullname = "Full Name";
24+
const tEmail = "Email";
25+
const tPhone = "Phone No";
26+
const tCity = "City";
27+
const tProfession = "Profession";
28+
const tDOP = "Date Of Birth";
29+
const tLanguages = "Languages";
30+
const tOtherSkills= "Other Skills";
31+
const tBio= "bio";
32+
33+
const tSaveBtn= "Save";

lib/data/user_profile_data.dart

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import 'dart:convert';
2+
import 'package:job_finder/modals/Profile/profile_modal.dart';
3+
4+
class UserProfileData {
5+
static Profile mohamed = Profile(
6+
userName: "Mohamed Ali Abdi",
7+
userEmail: "dudu921@gmail.com",
8+
phone: "+252613625352",
9+
DOB: DateTime(1997, 7, 21),
10+
professional: "Software Engineer",
11+
bio: getBioById(1),
12+
// imageUrl: "assets/mo_ali.jpeg"
13+
);
14+
static Profile abdirahman = Profile(
15+
userName: "Abdirahman Haji ",
16+
userEmail: "abdirah24@gmail.com",
17+
phone: "613625352",
18+
DOB: DateTime(2002, 1, 21),
19+
professional: "Software Engineer",
20+
languages: ['Somali','English'],
21+
bio: getBioById(2),
22+
// imageUrl: "assets/abdirahman_cj.jpeg",
23+
);
24+
25+
26+
27+
static String getBioById(int id) {
28+
// Read the JSON data from the file.
29+
String jsonData = '''
30+
{
31+
"bio": [
32+
{
33+
"id": 1,
34+
"bio": "Enthusiastic Tech Gig Learning Android and IOS Dev | Java Geek😎 | Dart⭐| C#(Winforms), Html&Css Javascrip(Reactjs🤩 and Nodejs) and last but not the when I'm not immersed in lines of code you'll find me outdoors, indulging in my love for Chess♟"
35+
},
36+
{
37+
"id": 2,
38+
"bio": "A passionate and innovative software engineer with a relentless curiosity for crafting efficient and elegant solutions to complex technical challenges."
39+
},
40+
{
41+
"id": 3,
42+
"bio": "..."
43+
}
44+
]
45+
}
46+
''';
47+
48+
49+
Map<String, dynamic> data = json.decode(jsonData);
50+
51+
Map<String, dynamic> bioObject = data['bio'].firstWhere((bio) => bio['id'] == id, orElse: () => null);
52+
53+
if (bioObject != null) {
54+
return bioObject['bio'];
55+
} else {
56+
return '';
57+
}
58+
}
59+
}

lib/modals/Profile/profile_modal.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
class Profile{
3+
String userName,userEmail,phone;
4+
String? bio,city,professional,sex,imageUrl;
5+
List<String>? otherSkills,languages;
6+
DateTime? DOB;
7+
// ui.Image? profileImage;
8+
9+
Profile({
10+
required this.userName,
11+
required this.userEmail,
12+
required this.phone,
13+
this.city,
14+
this.professional,
15+
this.sex,
16+
this.bio,
17+
this.DOB,
18+
this.otherSkills,
19+
this.languages,
20+
this.imageUrl,
21+
// this.profileImage
22+
});
23+
24+
}

lib/util/profile.dart

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ class ProfileImage extends StatelessWidget {
55
final Color? color;
66
final String imagePath;
77
final double? paddingAll;
8+
9+
10+
const ProfileImage(
11+
{super.key,
12+
required this.imagePath,
13+
this.color,
14+
this.paddingAll,
15+
});
16+
17+
@override
18+
Widget build(BuildContext context) {
19+
return CircleAvatar(
20+
radius: 60,
21+
backgroundColor: color ?? Colors.white,
22+
823
final bool asBackgroundImage;
924
final double radius;
1025
const ProfileImage({
@@ -21,9 +36,12 @@ class ProfileImage extends StatelessWidget {
2136
return !asBackgroundImage? CircleAvatar(
2237
radius: radius,
2338
backgroundColor: color??Colors.white,
39+
2440
child: Padding(
25-
padding: EdgeInsets.all(paddingAll??8.0),
26-
child: Image.asset(imagePath),
41+
padding: EdgeInsets.all(paddingAll ?? 8.0),
42+
child: Image.asset(
43+
imagePath, height: 120,width: 120,
44+
),
2745
),
2846
)
2947
:
@@ -34,4 +52,4 @@ class ProfileImage extends StatelessWidget {
3452
)
3553
;
3654
}
37-
}
55+
}

lib/views/Widgets/Profile_Tile.dart

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
3+
import 'package:job_finder/util/helpers/text_helper.dart';
4+
import 'package:job_finder/util/text.dart';
5+
6+
import '../../consts/colors.dart';
7+
8+
class ProfileTile extends StatelessWidget {
9+
const ProfileTile({
10+
super.key,
11+
required this.title,
12+
required this.icon,
13+
required this.onPress,
14+
this.endIcon = true,
15+
this.color,
16+
required this.leadingIconColor,
17+
});
18+
19+
final String title;
20+
final IconData icon;
21+
final VoidCallback onPress;
22+
final bool endIcon;
23+
final Color? color;
24+
final Color? leadingIconColor;
25+
26+
@override
27+
Widget build(BuildContext context) {
28+
var isDark = MediaQuery.of(context).platformBrightness == Brightness.dark;
29+
var iconColor = isDark ? colors['primary'] : colors['secondary'];
30+
return ListTile(
31+
shape: const StadiumBorder(),
32+
onTap: onPress,
33+
leading: Container(
34+
width: 40,
35+
height: 40,
36+
decoration: BoxDecoration(
37+
borderRadius: BorderRadius.circular(100),
38+
color: colors['primary']?.withOpacity(0.1)),
39+
child: Icon(icon,color: leadingIconColor,),
40+
),
41+
title: CText(
42+
text: title,
43+
decorations: TextDecorations(
44+
color: color != null ? color!.withOpacity(0.8) : iconColor!, fontSize: 18, weight: FontWeight.w400),
45+
),
46+
trailing: endIcon
47+
? Container(
48+
width: 30,
49+
height: 30,
50+
decoration: BoxDecoration(
51+
borderRadius: BorderRadius.circular(100),
52+
color: Colors.grey.withOpacity(0.1)),
53+
child: Icon(
54+
FontAwesomeIcons.angleRight,
55+
size: 18.0,
56+
color: colors['primary'],
57+
),
58+
)
59+
: null,
60+
);
61+
}
62+
}

lib/views/components/login_mode_profile.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class LoginModeProfile extends StatelessWidget {
1919

2020
children: [
2121
Padding(
22-
padding: const EdgeInsets.only(top: 20),
23-
child: ProfileImage(imagePath: "assets/google.png"),
22+
padding: const EdgeInsets.only(top: 10),
23+
child: ProfileImage(imagePath: "assets/google.png",imgHeight: 20,imgWidth: 20),
2424
),
2525

2626
SizedBox(height: 4,),

0 commit comments

Comments
 (0)