2025-05-16 18:09:14 +03:00
|
|
|
import 'package:cherrypick/cherrypick.dart';
|
2025-07-29 17:16:22 +03:00
|
|
|
import 'package:flutter/foundation.dart';
|
2025-05-16 17:56:57 +03:00
|
|
|
import 'package:flutter/material.dart';
|
2025-08-11 16:27:46 +03:00
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
2025-05-23 12:21:23 +03:00
|
|
|
import 'package:postly/app.dart';
|
2025-08-11 16:27:46 +03:00
|
|
|
import 'package:postly/di/core_module.dart';
|
|
|
|
|
import 'package:talker_bloc_logger/talker_bloc_logger_observer.dart';
|
|
|
|
|
import 'package:talker_flutter/talker_flutter.dart';
|
2025-05-16 18:09:14 +03:00
|
|
|
import 'di/app_module.dart';
|
2025-08-11 16:27:46 +03:00
|
|
|
import 'package:talker_cherrypick_logger/talker_cherrypick_logger.dart';
|
2025-05-16 17:56:57 +03:00
|
|
|
|
|
|
|
|
void main() {
|
2025-08-11 16:27:46 +03:00
|
|
|
final talker = Talker();
|
|
|
|
|
final talkerLogger = TalkerCherryPickLogger(talker);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bloc.observer = TalkerBlocObserver(talker: talker);
|
|
|
|
|
|
|
|
|
|
CherryPick.setGlobalLogger(talkerLogger);
|
2025-07-29 17:16:22 +03:00
|
|
|
// Включаем cycle-detection только в debug/test
|
|
|
|
|
if (kDebugMode) {
|
|
|
|
|
CherryPick.enableGlobalCycleDetection();
|
|
|
|
|
CherryPick.enableGlobalCrossScopeCycleDetection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Используем safe root scope для гарантии защиты
|
2025-08-11 16:27:46 +03:00
|
|
|
CherryPick.openRootScope().installModules([CoreModule(talker: talker), $AppModule()]);
|
|
|
|
|
|
|
|
|
|
runApp(MyApp(talker: talker,));
|
2025-05-16 17:56:57 +03:00
|
|
|
}
|