Skip to content

Commit a69a753

Browse files
Hossam mohamed create profile summary widget layout (#147)
Co-authored-by: HossamMo123 <mah24719782471978@gmail.com>
1 parent da6be8e commit a69a753

24 files changed

Lines changed: 1255 additions & 411 deletions

lam7a/.metadata

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "ac4e799d237041cf905519190471f657b657155a"
7+
revision: "9f455d2486bcb28cad87b062475f42edc959f636"
88
channel: "stable"
99

1010
project_type: app
@@ -13,26 +13,11 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: ac4e799d237041cf905519190471f657b657155a
17-
base_revision: ac4e799d237041cf905519190471f657b657155a
18-
- platform: android
19-
create_revision: ac4e799d237041cf905519190471f657b657155a
20-
base_revision: ac4e799d237041cf905519190471f657b657155a
21-
- platform: ios
22-
create_revision: ac4e799d237041cf905519190471f657b657155a
23-
base_revision: ac4e799d237041cf905519190471f657b657155a
24-
- platform: linux
25-
create_revision: ac4e799d237041cf905519190471f657b657155a
26-
base_revision: ac4e799d237041cf905519190471f657b657155a
27-
- platform: macos
28-
create_revision: ac4e799d237041cf905519190471f657b657155a
29-
base_revision: ac4e799d237041cf905519190471f657b657155a
16+
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
17+
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
3018
- platform: web
31-
create_revision: ac4e799d237041cf905519190471f657b657155a
32-
base_revision: ac4e799d237041cf905519190471f657b657155a
33-
- platform: windows
34-
create_revision: ac4e799d237041cf905519190471f657b657155a
35-
base_revision: ac4e799d237041cf905519190471f657b657155a
19+
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
20+
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
3621

3722
# User provided section
3823

lam7a/lib/core/services/mock_api_service.dart

Lines changed: 0 additions & 142 deletions
This file was deleted.

lam7a/lib/core/widgets/app_outlined_button.dart

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,42 @@ class AppOutlinedButton extends StatelessWidget {
88
final Color textColor;
99
final double borderRadius;
1010
final EdgeInsetsGeometry padding;
11+
final double fontSize;
12+
final FontWeight fontWeight;
1113

1214
const AppOutlinedButton({
1315
super.key,
1416
required this.text,
1517
required this.onPressed,
1618
this.backgroundColor = Colors.white,
17-
this.borderColor = const Color.fromRGBO(197, 200, 202, 1),
19+
this.borderColor = const Color.fromRGBO(207, 217, 222, 1),
1820
this.textColor = Colors.black,
1921
this.borderRadius = 20,
2022
this.padding = const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
23+
this.fontSize = 14,
24+
this.fontWeight = FontWeight.w600,
2125
});
2226

2327
@override
2428
Widget build(BuildContext context) {
25-
return ElevatedButton(
29+
return OutlinedButton(
2630
onPressed: onPressed,
27-
style: ElevatedButton.styleFrom(
31+
style: OutlinedButton.styleFrom(
2832
backgroundColor: backgroundColor,
29-
foregroundColor: textColor,
30-
elevation: 0,
31-
padding: padding,
33+
side: BorderSide(color: borderColor, width: 1),
3234
shape: RoundedRectangleBorder(
3335
borderRadius: BorderRadius.circular(borderRadius),
34-
side: BorderSide(color: borderColor, width: 1),
36+
),
37+
padding: padding,
38+
),
39+
child: Text(
40+
text,
41+
style: TextStyle(
42+
color: textColor,
43+
fontSize: fontSize,
44+
fontWeight: fontWeight,
3545
),
3646
),
37-
child: Text(text, style: TextStyle(color: textColor)),
3847
);
3948
}
4049
}

lam7a/lib/features/navigation/ui/view/navigation_home_screen.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import 'package:lam7a/features/navigation/utils/models/user_main_data.dart';
1414
import 'package:lam7a/features/notifications/ui/views/notifications_screen.dart';
1515
import 'package:lam7a/features/settings/ui/view/main_settings_page.dart';
1616
import 'package:lam7a/features/tweet/ui/view/pages/tweet_home_screen.dart';
17+
import 'package:lam7a/features/profile/ui/widgets/profile_header_widget.dart';
1718
class NavigationHomeScreen extends StatefulWidget {
1819
static const String routeName = "navigation";
1920

@@ -40,7 +41,17 @@ class _NavigationHomeScreenState extends State<NavigationHomeScreen> {
4041
Center(child: ConversationsScreen()),
4142
];
4243
List<Widget> drawerItems = [
43-
ListMember("Profile", () {}, iconPath: AppAssets.ProfileIcon),
44+
ListMember("Profile",
45+
() {
46+
Navigator.push(
47+
context,
48+
MaterialPageRoute(
49+
builder: (context) => ProfileHeaderWidget(
50+
userId: 'hossam_dev',
51+
),
52+
),
53+
);
54+
}, iconPath: AppAssets.ProfileIcon),
4455
ListMember("Chat", () {}, iconPath: AppAssets.chatIcon),
4556
ListMember(
4657
"Logout",

lam7a/lib/features/notifications/models/notification_model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:lam7a/features/common/models/tweet_model.dart';
2-
import 'package:lam7a/features/profile_summary/model/profile_model.dart';
2+
import 'package:lam7a/features/profile/model2/profile_model.dart';
33

44
enum NotificationType { like, repost, follow, mention, reply }
55

lam7a/lib/features/notifications/services/notifications_service_mock.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:lam7a/features/common/models/tweet_model.dart';
22
import 'package:lam7a/features/notifications/models/notification_model.dart';
33
import 'package:lam7a/features/notifications/services/notifications_service.dart';
4-
import 'package:lam7a/features/profile_summary/model/profile_model.dart';
4+
import 'package:lam7a/features/profile/model2/profile_model.dart';
55

66
class NotificationsAPIServiceMock implements NotificationsAPIService {
77

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// lib/features/profile/model/profile_model.dart
2+
import 'package:freezed_annotation/freezed_annotation.dart';
3+
4+
part 'profile_model.freezed.dart';
5+
part 'profile_model.g.dart';
6+
7+
/// Unified Profile Model that combines ProfileHeaderModel and ProfileModel
8+
@freezed
9+
abstract class ProfileModel with _$ProfileModel {
10+
const factory ProfileModel({
11+
// Basic Info
12+
required String displayName,
13+
required String handle,
14+
required String bio,
15+
required String avatarImage,
16+
required String bannerImage,
17+
@Default(false) bool isVerified,
18+
19+
// Additional Info
20+
@Default('') String location,
21+
@Default('') String birthday,
22+
required String joinedDate,
23+
24+
// Counts
25+
required int followersCount,
26+
required int followingCount,
27+
28+
// States (for viewing other profiles)
29+
@Default(ProfileStateOfFollow.notfollowing) ProfileStateOfFollow stateFollow,
30+
@Default(ProfileStateOfMute.notmuted) ProfileStateOfMute stateMute,
31+
@Default(ProfileStateBlocked.notblocked) ProfileStateBlocked stateBlocked,
32+
}) = _ProfileModel;
33+
34+
factory ProfileModel.fromJson(Map<String, dynamic> json) =>
35+
_$ProfileModelFromJson(json);
36+
}
37+
38+
enum ProfileStateOfFollow { following, notfollowing }
39+
enum ProfileStateOfMute { muted, notmuted }
40+
enum ProfileStateBlocked { blocked, notblocked }
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// lib/main.dart
2+
import 'package:flutter/material.dart';
3+
import 'package:flutter_riverpod/flutter_riverpod.dart';
4+
import 'ui/widgets/profile_header_widget.dart';
5+
6+
/// Entry point widget to test the profile header UI
7+
class ProfileHeaderMain extends StatelessWidget {
8+
const ProfileHeaderMain({super.key});
9+
10+
@override
11+
Widget build(BuildContext context) {
12+
return Scaffold(
13+
appBar: AppBar(
14+
title: const Text('Profile Header Demo'),
15+
centerTitle: true,
16+
),
17+
18+
body: const ProfileHeaderWidget(
19+
userId: 'hossam_dev',
20+
isOwnProfile: true, // Change to false to see other user's profile
21+
),
22+
);
23+
}
24+
}
25+
26+
/// App entry point
27+
void main() {
28+
runApp(
29+
const ProviderScope(
30+
child: MaterialApp(
31+
debugShowCheckedModeBanner: false,
32+
home: ProfileHeaderMain(),
33+
),
34+
),
35+
);
36+
}

0 commit comments

Comments
 (0)