Files
YungR1otz/lib/features/profile/domain/models/profile_model.dart
Lucas Saburido cabf2025cd first commit
2026-05-13 16:26:45 +01:00

36 lines
824 B
Dart

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,
);
}
}