fix
This commit is contained in:
@@ -10,15 +10,14 @@ class UserModel {
|
||||
final Reference? photo;
|
||||
final int? tarifa;
|
||||
final String? phoneNumber;
|
||||
final String? token;
|
||||
|
||||
UserModel(this.name, this.city, this.profession, this.state, this.photo,
|
||||
this.tarifa, this.phoneNumber, this.token);
|
||||
this.tarifa, this.phoneNumber);
|
||||
|
||||
static Future<UserModel> fromJson(
|
||||
Map<String, dynamic>? json, String uid) async {
|
||||
try {
|
||||
if (json == null) return UserModel('', '', '', null, null, 0, '', '');
|
||||
if (json == null) return UserModel('', '', '', null, null, 0, '');
|
||||
|
||||
String? avatar = json['photo'];
|
||||
return UserModel(
|
||||
@@ -29,11 +28,10 @@ class UserModel {
|
||||
avatar != null ? storage.ref().child(avatar) : null,
|
||||
json['tarifa'] ?? 0,
|
||||
json['phoneNumber'],
|
||||
json['token'],
|
||||
);
|
||||
} catch (e) {
|
||||
print('XD user $e');
|
||||
return UserModel('', '', '', null, null, 0, '', '');
|
||||
return UserModel('', '', '', null, null, 0, '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +43,7 @@ class UserModel {
|
||||
return fromJson(data, uid);
|
||||
} catch (e) {
|
||||
print('Error getting user: $e');
|
||||
return UserModel('', '', '', null, null, 0, '', '');
|
||||
return UserModel('', '', '', null, null, 0, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user