32 lines
722 B
Dart
32 lines
722 B
Dart
class AuthUser {
|
|
final String id;
|
|
final String email;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
|
|
AuthUser({
|
|
required this.id,
|
|
required this.email,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
});
|
|
|
|
factory AuthUser.fromJson(Map<String, dynamic> json) {
|
|
return AuthUser(
|
|
id: json['id'] as String,
|
|
email: json['email'] as String,
|
|
createdAt: DateTime.parse(json['created_at'] as String),
|
|
updatedAt: DateTime.parse(json['updated_at'] as String),
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'email': email,
|
|
'created_at': createdAt.toIso8601String(),
|
|
'updated_at': updatedAt.toIso8601String(),
|
|
};
|
|
}
|
|
}
|