From 5630efccfe8a7349f962e2c636e44dc4ff20925c Mon Sep 17 00:00:00 2001 From: Sergey Penkovsky Date: Tue, 29 Jul 2025 17:16:22 +0300 Subject: [PATCH] feat: enable CherryPick cycle detection in debug mode and use safe root scope --- examples/postly/lib/main.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/postly/lib/main.dart b/examples/postly/lib/main.dart index 5a63c72..968bfeb 100644 --- a/examples/postly/lib/main.dart +++ b/examples/postly/lib/main.dart @@ -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()); }