Files
cherrypick/cherrypick/example/cycle_detection_example.dart

196 lines
6.2 KiB
Dart
Raw Normal View History

import 'package:cherrypick/cherrypick.dart';
// Пример сервисов с циклической зависимостью
class UserService {
final OrderService orderService;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
UserService(this.orderService);
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
void createUser(String name) {
print('Creating user: $name');
// Пытаемся получить заказы пользователя, что создает циклическую зависимость
orderService.getOrdersForUser(name);
}
}
class OrderService {
final UserService userService;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
OrderService(this.userService);
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
void getOrdersForUser(String userName) {
print('Getting orders for user: $userName');
// Пытаемся получить информацию о пользователе, что создает циклическую зависимость
userService.createUser(userName);
}
}
// Модули с циклическими зависимостями
class UserModule extends Module {
@override
void builder(Scope currentScope) {
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
bind<UserService>()
.toProvide(() => UserService(currentScope.resolve<OrderService>()));
}
}
class OrderModule extends Module {
@override
void builder(Scope currentScope) {
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
bind<OrderService>()
.toProvide(() => OrderService(currentScope.resolve<UserService>()));
}
}
// Правильная реализация без циклических зависимостей
class UserRepository {
void createUser(String name) {
print('Creating user in repository: $name');
}
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
String getUserInfo(String name) {
return 'User info for: $name';
}
}
class OrderRepository {
void createOrder(String orderId, String userName) {
print('Creating order $orderId for user: $userName');
}
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
List<String> getOrdersForUser(String userName) {
return ['order1', 'order2', 'order3'];
}
}
class ImprovedUserService {
final UserRepository userRepository;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
ImprovedUserService(this.userRepository);
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
void createUser(String name) {
userRepository.createUser(name);
}
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
String getUserInfo(String name) {
return userRepository.getUserInfo(name);
}
}
class ImprovedOrderService {
final OrderRepository orderRepository;
final ImprovedUserService userService;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
ImprovedOrderService(this.orderRepository, this.userService);
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
void createOrder(String orderId, String userName) {
// Проверяем, что пользователь существует
final userInfo = userService.getUserInfo(userName);
print('User exists: $userInfo');
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
orderRepository.createOrder(orderId, userName);
}
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
List<String> getOrdersForUser(String userName) {
return orderRepository.getOrdersForUser(userName);
}
}
// Правильные модули без циклических зависимостей
class ImprovedUserModule extends Module {
@override
void builder(Scope currentScope) {
bind<UserRepository>().singleton().toProvide(() => UserRepository());
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
bind<ImprovedUserService>().toProvide(
() => ImprovedUserService(currentScope.resolve<UserRepository>()));
}
}
class ImprovedOrderModule extends Module {
@override
void builder(Scope currentScope) {
bind<OrderRepository>().singleton().toProvide(() => OrderRepository());
bind<ImprovedOrderService>().toProvide(() => ImprovedOrderService(
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
currentScope.resolve<OrderRepository>(),
currentScope.resolve<ImprovedUserService>()));
}
}
void main() {
print('=== Circular Dependency Detection Example ===\n');
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
// Example 1: Demonstrate circular dependency
print('1. Attempt to create a scope with circular dependencies:');
try {
final scope = CherryPick.openRootScope();
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
scope
.enableCycleDetection(); // Включаем обнаружение циклических зависимостей
scope.installModules([
UserModule(),
OrderModule(),
]);
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
// Это должно выбросить CircularDependencyException
final userService = scope.resolve<UserService>();
print('UserService created: $userService');
} catch (e) {
print('❌ Circular dependency detected: $e\n');
}
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
// Example 2: Without circular dependency detection (dangerous!)
print('2. Same code without circular dependency detection:');
try {
2025-09-05 09:37:24 +03:00
CherryPick.disableGlobalCrossScopeCycleDetection();
CherryPick.disableGlobalCycleDetection();
final scope = CherryPick.openRootScope();
// НЕ включаем обнаружение циклических зависимостей
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
scope.installModules([
UserModule(),
OrderModule(),
]);
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
// Это приведет к StackOverflowError при попытке использования
final userService = scope.resolve<UserService>();
print('UserService создан: $userService');
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
// Попытка использовать сервис приведет к бесконечной рекурсии
// userService.createUser('John'); // Раскомментируйте для демонстрации StackOverflow
print('⚠️ UserService created, but using it will cause StackOverflow\n');
} catch (e) {
print('❌ Error: $e\n');
}
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
// Example 3: Correct architecture without circular dependencies
print('3. Correct architecture without circular dependencies:');
try {
final scope = CherryPick.openRootScope();
scope.enableCycleDetection(); // Включаем для безопасности
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
scope.installModules([
ImprovedUserModule(),
ImprovedOrderModule(),
]);
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
final userService = scope.resolve<ImprovedUserService>();
final orderService = scope.resolve<ImprovedOrderService>();
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
print('✅ Services created successfully');
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
// Демонстрация работы
userService.createUser('John');
orderService.createOrder('ORD-001', 'John');
final orders = orderService.getOrdersForUser('John');
print('✅ Orders for user John: $orders');
} catch (e) {
print('❌ Error: $e');
}
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
print('\n=== Recommendations ===');
print('1. Always enable circular dependency detection in development mode.');
print('2. Use repositories and services to separate concerns.');
print('3. Avoid mutual dependencies between services at the same level.');
print('4. Use events or mediators to decouple components.');
}