update
This commit is contained in:
@@ -219,6 +219,24 @@ class Event {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<List<Event>> getEventsAllByIdAndStatus(String uid) async {
|
||||
try {
|
||||
var snapshot = await FirebaseFirestore.instance
|
||||
.collection('services')
|
||||
.where('professional_id', isEqualTo: uid)
|
||||
.where('status', whereIn: ['aprobado', 'pendiente']).get();
|
||||
|
||||
List<Event> eventos = [];
|
||||
for (var element in snapshot.docs) {
|
||||
eventos.add(Event.fromJson(element.data()));
|
||||
}
|
||||
return eventos;
|
||||
} catch (e) {
|
||||
print('Error getByProId $e');
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
static Future<List<Event>> getEventsAllByIdStatus(
|
||||
String uid, String state) async {
|
||||
try {
|
||||
|
||||
@@ -49,7 +49,8 @@ class _CalendarProScreenState extends State<CalendarProScreen> {
|
||||
}
|
||||
|
||||
if (_events == null) {
|
||||
Event.getEventsAllById(widget.professional.id.toString()).then((value) {
|
||||
Event.getEventsAllByIdAndStatus(widget.professional.id.toString())
|
||||
.then((value) {
|
||||
setState(() {
|
||||
_events = value;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user