## Tests BLoC (Task P2.4 Mobile) - 25 nouveaux fichiers *_bloc_test.dart + mocks générés (build_runner) - Features couvertes : authentication, admin_users, adhesions, backup, communication/messaging, contributions, dashboard, finance (approval/budget), events, explore/network, feed, logs_monitoring, notifications, onboarding, organizations (switcher/types/CRUD), profile, reports, settings, solidarity - ~380 tests, > 80% coverage BLoCs ## Sécurité Production (Task P2.2) - lib/core/security/app_integrity_service.dart (freerasp 7.5.1) - Migration API breaking changes freerasp 7.5.1 : - onRootDetected → onPrivilegedAccess - onDebuggerDetected → onDebug - onSignatureDetected → onAppIntegrity - onHookDetected → onHooks - onEmulatorDetected → onSimulator - onUntrustedInstallationSourceDetected → onUnofficialStore - onDeviceBindingDetected → onDeviceBinding - onObfuscationIssuesDetected → onObfuscationIssues - Talsec.start() split → start() + attachListener() - const AndroidConfig/IOSConfig → final (constructors call ConfigVerifier) - supportedAlternativeStores → supportedStores ## Pubspec - bloc_test: ^9.1.7 → ^10.0.0 (compat flutter_bloc ^9.0.0) - freerasp 7.5.1 ## Config - android/app/build.gradle : ajustements release - lib/core/config/environment.dart : URLs API actualisées - lib/main.dart + app_router : intégrations sécurité/BLoC ## Cleanup - Suppression docs intermédiaires (TACHES_*.md, TASK_*_COMPLETION_REPORT.md, TESTS_UNITAIRES_PROGRESS.md) - .g.dart régénérés (json_serializable) - .mocks.dart régénérés (mockito) ## Résultat - 142 fichiers, +27 596 insertions - Toutes les tâches P2 mobile complétées Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
83 lines
2.8 KiB
Dart
83 lines
2.8 KiB
Dart
/// UnionFlow - Application Mobile Révolutionnaire
|
|
///
|
|
/// Point d'entrée principal avec système d'authentification adaptatif
|
|
/// Architecture ultra-sophistiquée avec dashboard morphique basé sur les rôles
|
|
library main;
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
|
import 'app/app.dart';
|
|
import 'core/config/environment.dart';
|
|
import 'core/l10n/locale_provider.dart';
|
|
import 'core/theme/theme_provider.dart';
|
|
import 'core/di/injection.dart';
|
|
import 'core/security/app_integrity_service.dart';
|
|
import 'core/utils/logger.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
AppConfig.initialize();
|
|
GoogleFonts.config.allowRuntimeFetching = !AppConfig.isProd;
|
|
|
|
// Initialisation unique et automatique (DRY)
|
|
await configureDependencies();
|
|
|
|
// Surveillance intégrité applicative MASVS v2 RESILIENCE
|
|
await AppIntegrityService.instance.initialize(
|
|
onThreatDetected: (threat) =>
|
|
AppLogger.warning('Threat detected: $threat', tag: 'Security'),
|
|
);
|
|
|
|
// Mode immersif et config système
|
|
await _configureApp();
|
|
|
|
final localeProvider = LocaleProvider();
|
|
await localeProvider.initialize();
|
|
|
|
final themeProvider = await ThemeProvider.load();
|
|
|
|
if (AppConfig.enableCrashReporting && AppConfig.sentryDsn.isNotEmpty) {
|
|
await SentryFlutter.init(
|
|
(options) {
|
|
options.dsn = AppConfig.sentryDsn;
|
|
options.environment = AppConfig.environment.name;
|
|
options.tracesSampleRate = AppConfig.isProd ? 0.2 : 1.0;
|
|
options.debug = AppConfig.enableDebugMode;
|
|
options.sendDefaultPii = false;
|
|
},
|
|
appRunner: () => runApp(
|
|
DefaultAssetBundle(
|
|
bundle: SentryAssetBundle(),
|
|
child: UnionFlowApp(localeProvider: localeProvider, themeProvider: themeProvider),
|
|
),
|
|
),
|
|
);
|
|
} else {
|
|
runApp(UnionFlowApp(localeProvider: localeProvider, themeProvider: themeProvider));
|
|
}
|
|
}
|
|
|
|
/// Configure les paramètres globaux de l'application
|
|
Future<void> _configureApp() async {
|
|
// Configuration de l'orientation
|
|
await SystemChrome.setPreferredOrientations([
|
|
DeviceOrientation.portraitUp,
|
|
]);
|
|
|
|
// Configuration de la barre de statut - Mode immersif edge-to-edge
|
|
// Les icônes s'adaptent automatiquement via AppBarTheme.systemOverlayStyle dans chaque thème
|
|
SystemChrome.setSystemUIOverlayStyle(
|
|
const SystemUiOverlayStyle(
|
|
statusBarColor: Colors.transparent,
|
|
systemNavigationBarColor: Colors.transparent, // Transparent pour edge-to-edge
|
|
systemNavigationBarDividerColor: Colors.transparent,
|
|
),
|
|
);
|
|
|
|
// Activer le mode edge-to-edge (immersif)
|
|
SystemChrome.setEnabledSystemUIMode(
|
|
SystemUiMode.edgeToEdge,
|
|
);
|
|
} |