refactoring

This commit is contained in:
dahoud
2026-03-31 09:14:47 +00:00
parent 9bfffeeebe
commit 5383df6dcb
200 changed files with 11192 additions and 7063 deletions

View File

@@ -33,8 +33,10 @@ class NotificationsBloc extends Bloc<NotificationsEvent, NotificationsState> {
final nonLues = notifications.where((n) => !n.estLue).length;
emit(NotificationsLoaded(notifications: notifications, nonLuesCount: nonLues));
} on DioException catch (e) {
if (e.type == DioExceptionType.cancel) return;
emit(NotificationsError(_networkError(e)));
} catch (e) {
if (e is DioException && e.type == DioExceptionType.cancel) return;
emit(NotificationsError('Erreur lors du chargement : $e'));
}
}
@@ -70,6 +72,7 @@ class NotificationsBloc extends Bloc<NotificationsEvent, NotificationsState> {
emit(NotificationMarkedAsRead(notifications: updated, nonLuesCount: nonLues));
}
} catch (e, st) {
if (e is DioException && e.type == DioExceptionType.cancel) return;
AppLogger.error('NotificationsBloc: marquer comme lu échoué', error: e, stackTrace: st);
emit(NotificationsError('Impossible de marquer comme lu'));
}