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,6 +1,7 @@
/// BLoC pour la gestion des rapports (Clean Architecture)
library reports_bloc;
import 'package:dio/dio.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:injectable/injectable.dart';
@@ -52,6 +53,7 @@ class ReportsBloc extends Bloc<ReportsEvent, ReportsState> {
statsEvenements: results[3],
));
} catch (e) {
if (e is DioException && e.type == DioExceptionType.cancel) return;
emit(ReportsError('Erreur lors du chargement des rapports : $e'));
}
}
@@ -65,6 +67,7 @@ class ReportsBloc extends Bloc<ReportsEvent, ReportsState> {
await _scheduleReport(cronExpression: event.cronExpression);
emit(const ReportScheduled());
} catch (e) {
if (e is DioException && e.type == DioExceptionType.cancel) return;
emit(ReportsError('Impossible de programmer le rapport : $e'));
}
}
@@ -78,6 +81,7 @@ class ReportsBloc extends Bloc<ReportsEvent, ReportsState> {
await _generateReport(event.type, format: event.format);
emit(ReportGenerated(event.type));
} catch (e) {
if (e is DioException && e.type == DioExceptionType.cancel) return;
emit(ReportsError('Impossible de générer le rapport : $e'));
}
}