first commit
This commit is contained in:
35
lib/features/profile/domain/models/profile_model.dart
Normal file
35
lib/features/profile/domain/models/profile_model.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
class ProfileModel {
|
||||
const ProfileModel({
|
||||
required this.userId,
|
||||
required this.username,
|
||||
required this.bio,
|
||||
required this.avatarUrl,
|
||||
});
|
||||
|
||||
final String userId;
|
||||
final String username;
|
||||
final String bio;
|
||||
final String avatarUrl;
|
||||
|
||||
factory ProfileModel.fromJson(Map<String, dynamic> json) {
|
||||
return ProfileModel(
|
||||
userId: (json['user_id'] as String?) ?? '',
|
||||
username: (json['username'] as String?) ?? '',
|
||||
bio: (json['bio'] as String?) ?? '',
|
||||
avatarUrl: (json['avatar_url'] as String?) ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
ProfileModel copyWith({
|
||||
String? username,
|
||||
String? bio,
|
||||
String? avatarUrl,
|
||||
}) {
|
||||
return ProfileModel(
|
||||
userId: userId,
|
||||
username: username ?? this.username,
|
||||
bio: bio ?? this.bio,
|
||||
avatarUrl: avatarUrl ?? this.avatarUrl,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user