Co-authored-by: eddgranados12 <eddgranados12@users.noreply.github.com>
Co-authored-by: MENDOZA BALLARDO GAEL RICARDO <gael-meb123@users.noreply.github.com> Co-authored-by: Azareth-Tr <Azareth-Tr@users.noreply.github.com> modificacion de vistas panel admin, login, animaciones y implementacion de mascota
This commit is contained in:
31
recolecta_app/lib/features/admin/models/admin_driver.dart
Normal file
31
recolecta_app/lib/features/admin/models/admin_driver.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
class AdminDriverModel {
|
||||
final String id;
|
||||
final String userId;
|
||||
final String? userName;
|
||||
final String? userEmail;
|
||||
final int? unitId;
|
||||
final String? plate;
|
||||
|
||||
const AdminDriverModel({
|
||||
required this.id,
|
||||
required this.userId,
|
||||
this.userName,
|
||||
this.userEmail,
|
||||
this.unitId,
|
||||
this.plate,
|
||||
});
|
||||
|
||||
factory AdminDriverModel.fromJson(Map<String, dynamic> json) =>
|
||||
AdminDriverModel(
|
||||
id: json['id'].toString(),
|
||||
userId: json['user_id'].toString(),
|
||||
userName: json['user_name'] as String?,
|
||||
userEmail: json['user_email'] as String?,
|
||||
unitId: (json['unit_id'] as num?)?.toInt(),
|
||||
plate: json['plate'] as String?,
|
||||
);
|
||||
|
||||
String get displayName => userName == null || userName!.trim().isEmpty
|
||||
? (userEmail ?? userId)
|
||||
: userName!;
|
||||
}
|
||||
Reference in New Issue
Block a user