16 lines
314 B
Dart
16 lines
314 B
Dart
class User {
|
|
final int id;
|
|
final String name;
|
|
final String email;
|
|
|
|
User({required this.id, required this.name, required this.email});
|
|
|
|
factory User.fromJson(Map<String, dynamic> json) {
|
|
return User(
|
|
id: json['id'],
|
|
name: json['name'] ?? '',
|
|
email: json['email'] ?? '',
|
|
);
|
|
}
|
|
}
|