Eliminar creche_app/lib/models/profile.dart
This commit is contained in:
parent
1bb983a7d1
commit
c47e27ddfd
|
|
@ -1,46 +0,0 @@
|
||||||
class Profile {
|
|
||||||
final String id;
|
|
||||||
final String userId;
|
|
||||||
final String fullName;
|
|
||||||
final String? avatarUrl;
|
|
||||||
final String? phone;
|
|
||||||
final String role;
|
|
||||||
final String? position;
|
|
||||||
final DateTime createdAt;
|
|
||||||
|
|
||||||
Profile({
|
|
||||||
required this.id,
|
|
||||||
required this.userId,
|
|
||||||
required this.fullName,
|
|
||||||
this.avatarUrl,
|
|
||||||
this.phone,
|
|
||||||
required this.role,
|
|
||||||
this.position,
|
|
||||||
required this.createdAt,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory Profile.fromMap(Map<String, dynamic> map) {
|
|
||||||
return Profile(
|
|
||||||
id: map['id'] ?? '',
|
|
||||||
userId: map['user_id'] ?? '',
|
|
||||||
fullName: map['full_name'] ?? '',
|
|
||||||
avatarUrl: map['avatar_url'],
|
|
||||||
phone: map['phone'],
|
|
||||||
role: map['role'] ?? 'parent',
|
|
||||||
position: map['position'],
|
|
||||||
createdAt: DateTime.tryParse(map['created_at'] ?? '') ?? DateTime.now(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
|
||||||
return {
|
|
||||||
'id': id,
|
|
||||||
'user_id': userId,
|
|
||||||
'full_name': fullName,
|
|
||||||
'avatar_url': avatarUrl,
|
|
||||||
'phone': phone,
|
|
||||||
'role': role,
|
|
||||||
'position': position,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue