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