mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-23 21:13:35 +00:00
fix: fix examples
This commit is contained in:
@@ -47,7 +47,7 @@ packages:
|
||||
path: "../cherrypick"
|
||||
relative: true
|
||||
source: path
|
||||
version: "3.0.0-dev.10"
|
||||
version: "3.0.0-dev.12"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -141,6 +141,8 @@ void main() {
|
||||
// Example 2: Without circular dependency detection (dangerous!)
|
||||
print('2. Same code without circular dependency detection:');
|
||||
try {
|
||||
CherryPick.disableGlobalCrossScopeCycleDetection();
|
||||
CherryPick.disableGlobalCycleDetection();
|
||||
final scope = CherryPick.openRootScope();
|
||||
// НЕ включаем обнаружение циклических зависимостей
|
||||
|
||||
|
||||
@@ -14,6 +14,14 @@ class MyService implements Disposable {
|
||||
void doSomething() => print('Doing something...');
|
||||
}
|
||||
|
||||
/// Пример модуля CherryPick
|
||||
class ModuleImpl extends Module {
|
||||
@override
|
||||
void builder(Scope scope) {
|
||||
bind<MyService>().toProvide(() => MyService()).singleton();
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
final scope = CherryPick.openRootScope();
|
||||
|
||||
@@ -29,12 +37,4 @@ void main() {
|
||||
// Освобождаем все ресурсы
|
||||
scope.dispose();
|
||||
print('Service wasDisposed = ${service.wasDisposed}'); // true
|
||||
}
|
||||
|
||||
/// Пример модуля CherryPick
|
||||
class ModuleImpl extends Module {
|
||||
@override
|
||||
void builder(Scope scope) {
|
||||
bind<MyService>().toProvide(() => MyService()).singleton();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,28 +127,28 @@ packages:
|
||||
path: "../../cherrypick"
|
||||
relative: true
|
||||
source: path
|
||||
version: "3.0.0-dev.9"
|
||||
version: "3.0.0-dev.12"
|
||||
cherrypick_annotations:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "../../cherrypick_annotations"
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.1.2-dev.0"
|
||||
version: "1.1.2-dev.2"
|
||||
cherrypick_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "../../cherrypick_flutter"
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.1.3-dev.9"
|
||||
version: "1.1.3-dev.12"
|
||||
cherrypick_generator:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
path: "../../cherrypick_generator"
|
||||
relative: true
|
||||
source: path
|
||||
version: "2.0.0-dev.0"
|
||||
version: "2.0.0-dev.2"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -175,21 +175,21 @@ packages:
|
||||
path: "../../cherrypick"
|
||||
relative: true
|
||||
source: path
|
||||
version: "3.0.0-dev.9"
|
||||
version: "3.0.0-dev.12"
|
||||
cherrypick_annotations:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "../../cherrypick_annotations"
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.1.2-dev.0"
|
||||
version: "1.1.2-dev.2"
|
||||
cherrypick_generator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "../../cherrypick_generator"
|
||||
relative: true
|
||||
source: path
|
||||
version: "2.0.0-dev.0"
|
||||
version: "2.0.0-dev.2"
|
||||
cli_launcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -864,7 +864,7 @@ packages:
|
||||
path: "../../talker_cherrypick_logger"
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.1.0-dev.3"
|
||||
version: "1.1.0-dev.7"
|
||||
talker_dio_logger:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user