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 }
0 commit comments