notificaciones

This commit is contained in:
Juan Felipe Duarte
2023-06-23 10:39:10 -05:00
parent fa1b373d5e
commit 90ec1293ea
12 changed files with 116 additions and 39 deletions
+6 -4
View File
@@ -10,14 +10,15 @@ 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.tarifa, this.phoneNumber, this.token);
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(
@@ -28,10 +29,11 @@ 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, '', '');
}
}
@@ -43,7 +45,7 @@ class UserModel {
return fromJson(data, uid);
} catch (e) {
print('Error getting user: $e');
return UserModel('', '', '', null, null, 0, '');
return UserModel('', '', '', null, null, 0, '', '');
}
}
}