nhance_partner/lib/domain/entities/user.dart
2025-09-01 09:48:19 +05:30

30 lines
549 B
Dart

class User {
final String id;
final String name;
final String email;
const User({
required this.id,
required this.name,
required this.email,
});
// Optional: Factory constructor to create from JSON
factory User.fromJson(Map<String, dynamic> json) {
return User(
id: json['id'] ?? '',
name: json['name'] ?? '',
email: json['email'] ?? '',
);
}
// Optional: Convert to JSON
Map<String, dynamic> toJson() {
return {
'id': id,
'name': name,
'email': email,
};
}
}