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

@@ -1,3 +1,4 @@
import 'package:dio/dio.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:injectable/injectable.dart';
@@ -21,6 +22,7 @@ class NotificationBloc extends Bloc<NotificationEvent, NotificationState> {
final items = await _repository.getNotifications();
emit(NotificationLoaded(items: items));
} catch (e, st) {
if (e is DioException && e.type == DioExceptionType.cancel) return;
AppLogger.error('NotificationBloc: chargement notifications échoué', error: e, stackTrace: st);
emit(NotificationError('Erreur de chargement: $e'));
}
@@ -46,6 +48,7 @@ class NotificationBloc extends Bloc<NotificationEvent, NotificationState> {
}).toList();
emit(NotificationLoaded(items: updatedItems));
} catch (e, st) {
if (e is DioException && e.type == DioExceptionType.cancel) return;
AppLogger.error('NotificationBloc: marquer comme lu échoué', error: e, stackTrace: st);
emit(NotificationError('Impossible de marquer comme lu'));
}