mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 05:25:19 +00:00
feat: enable CherryPick cycle detection in debug mode and use safe root scope
This commit is contained in:
@@ -1,9 +1,17 @@
|
|||||||
import 'package:cherrypick/cherrypick.dart';
|
import 'package:cherrypick/cherrypick.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:postly/app.dart';
|
import 'package:postly/app.dart';
|
||||||
import 'di/app_module.dart';
|
import 'di/app_module.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
// Включаем cycle-detection только в debug/test
|
||||||
|
if (kDebugMode) {
|
||||||
|
CherryPick.enableGlobalCycleDetection();
|
||||||
|
CherryPick.enableGlobalCrossScopeCycleDetection();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Используем safe root scope для гарантии защиты
|
||||||
CherryPick.openRootScope().installModules([$AppModule()]);
|
CherryPick.openRootScope().installModules([$AppModule()]);
|
||||||
runApp(MyApp());
|
runApp(MyApp());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user