puntos base de datos

This commit is contained in:
Juan Felipe Duarte
2023-04-25 17:47:18 -05:00
parent 77cfb5cd4a
commit 0a70d40d2d
2 changed files with 59 additions and 2 deletions
+20 -1
View File
@@ -42,7 +42,7 @@ Future<List<Event>> getByProId(String day) async {
for (var element in snapshot.docs) {
eventos.add(Event.fromJson(element.data()));
}
print('Error getByProId 1 $eventos');
print('eventos $eventos');
return eventos;
} catch (e) {
print('Error getByProId $e');
@@ -77,4 +77,23 @@ class Event {
profesionalId: json['profesional_id'],
);
}
static Future<List<Event>> getEventsAllById(String uid) async {
try {
var snapshot = await FirebaseFirestore.instance
.collection('services')
.where('profesional_id', isEqualTo: uid)
.get();
List<Event> eventos = [];
for (var element in snapshot.docs) {
eventos.add(Event.fromJson(element.data()));
}
print('eventos $eventos');
return eventos;
} catch (e) {
print('Error getByProId $e');
return [];
}
}
}