feat: enable CherryPick cycle detection in debug mode and use safe root scope

This commit is contained in:
Sergey Penkovsky
2025-07-29 17:16:22 +03:00
parent d63d52b817
commit 5630efccfe

View File

@@ -1,9 +1,17 @@
import 'package:cherrypick/cherrypick.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:postly/app.dart';
import 'di/app_module.dart';
void main() {
// Включаем cycle-detection только в debug/test
if (kDebugMode) {
CherryPick.enableGlobalCycleDetection();
CherryPick.enableGlobalCrossScopeCycleDetection();
}
// Используем safe root scope для гарантии защиты
CherryPick.openRootScope().installModules([$AppModule()]);
runApp(MyApp());
}