numero de solicitudes

This commit is contained in:
Felipe
2024-04-25 23:52:16 -05:00
parent 171b3fd926
commit 8b34e7d12d
5 changed files with 215 additions and 81 deletions
+18
View File
@@ -37,6 +37,8 @@ class ServiceBloc extends Bloc<ServiceEvent, ServiceState> {
_onLoadPendingServicesForProfessional);
on<UpdateProfessionalScored>(_onUpdateProfessionalScored);
on<UpdateUserScored>(_onUpdateUserScored);
on<CountPendingServicesForProfessional>(
_onCountPendingServicesForProfessional);
}
void _onCreateService(CreateService event, Emitter<ServiceState> emit) async {
@@ -297,6 +299,22 @@ class ServiceBloc extends Bloc<ServiceEvent, ServiceState> {
emit(CreateServiceFailure());
}
}
void _onCountPendingServicesForProfessional(
CountPendingServicesForProfessional event,
Emitter<ServiceState> emit) async {
try {
final count = await _serviceRepository
.countPendingServicesForProfessional(event.professionalId);
emit(PendingServicesCountedLoaded(count));
} catch (e) {
log(e.toString());
emit(CreateServiceFailure());
}
}
}
class ServiceInfoUI {