Compare commits

...

27 Commits

Author SHA1 Message Date
Sergey Penkovsky
4953e917c9 Merge branch 'master' into develop 2026-01-15 09:00:10 +03:00
Sergey Penkovsky
1997110d92 chore(release): publish packages
- cherrypick@3.0.2
 - cherrypick_flutter@3.0.2
 - talker_cherrypick_logger@3.0.2
2025-10-20 17:31:40 +03:00
Sergey Penkovsky
0e600ca3a2 Merge pull request #25 from pese-git/issues/24
Issues/24
2025-10-20 17:28:01 +03:00
Sergey Penkovsky
25ae208ea1 fix(test): fix warning 2025-10-20 16:20:20 +03:00
Sergey Penkovsky
685c0ae49c fix(scope): properly clear binding and module references on dispose
Add memory leak/finalizer test to ensure no strong references remain after closing and disposing a scope.
2025-10-13 17:32:10 +03:00
Sergey Penkovsky
98d81b13a8 freeze deps 2025-10-13 17:26:39 +03:00
Sergey Penkovsky
cccf460f01 chore(release): publish packages
- cherrypick_annotations@3.0.2-dev.0
 - cherrypick_generator@3.0.2-dev.0
2025-09-09 18:15:03 +03:00
Sergey Penkovsky
0c1ef70b73 feat(examples): update client_app and postly implementation details
- Refactored and updated pages, router, DI modules, and feature implementations in both example projects:
  - client_app: main.dart and my_home_page.dart updated for improved navigation and structure.
  - postly: updated DI wiring, presentation pages, repository implementation, and routing logic.
- Applied small improvements and code consistency changes in the examples.

docs: add new documentation assets and benchmarking script

BREAKING CHANGE:
Examples now reflect the latest changes in the DI framework and are ready for Dart 3.8+ and cherrypick_generator element2 API compatibility.
2025-09-09 18:08:39 +03:00
Sergey Penkovsky
eb6d786600 refactor(generator): migrate cherrypick_generator to analyzer element2 API
- Fully migrated core cherrypick_generator and submodules to new analyzer element2 system:
  - Updated all GeneratorForAnnotation overrides to use Element2, ClassElement2, MethodElement2, FieldElement2 and new annotation/metadata access patterns.
  - Migrated signature and bodies for helpers, parsers, annotation validators, meta utils, and type parsers.
  - Fixed tests to use readerWriter instead of deprecated reader argument.
  - Refactored usage of now-absent 'metadata', 'parameters', 'fields', 'methods', 'source', and similar members to use correct *.firstFragment.* or API alternatives.
  - Cleaned up old imports and unused code.

test(generator): update generator integration tests

- Updated test calls to use correct TestReaderWriter type and bring test infra in line with current build_runner/testing API.

build: update dependencies and pubspec to support latest analyzer/build ecosystem

- Raised Dart SDK and package constraints as required for generated code and codegen plugins.
- Updated pubspecs in root/examples as needed by build warnings.

docs: add plots and assets (new files)

BREAKING CHANGE:
- Requires Dart 3.8+ and analyzer that supports element2.
- All downstream codegen/tests depending on Element API must migrate to Element2 signatures and data model.
2025-09-09 18:08:39 +03:00
Sergey Penkovsky
c483d8c9e2 chore(release): publish packages
- cherrypick@3.0.1
 - cherrypick_annotations@3.0.1
 - cherrypick_flutter@3.0.1
 - cherrypick_generator@3.0.1
 - talker_cherrypick_logger@3.0.1
2025-09-09 13:47:11 +03:00
Sergey Penkovsky
a74cec645e Merge pull request #23 from pese-git/develop
Modified Files Summary

Configuration Files
- `.fvmrc` - FVM configuration
- `melos.yaml` - Melos workspace configuration
- Multiple `pubspec.yaml` files across packages

Documentation
- `README.md` (root and all packages) - Added Netlify badges
- Standardized CI/CD badge formatting

Dependency Management
- `pubspec.lock` files in example projects
- Dependency version adjustments

Code Quality
- `cherrypick_generator/analysis_options.yaml` - Updated analysis rules

Change Categories

📚 Documentation Improvements
- Added Netlify deployment status badges
- Enhanced project visibility
- Standardized badge formatting

⚙️ Maintenance Updates
- Development dependency version adjustments
- Environment constraint updates
- Improved cross-version compatibility

🛠️ Configuration Changes
- FVM configuration updates
- Melos workspace adjustments
- Analysis rules refinement

Impact Assessment

  Non-Breaking Changes
All modifications are backward compatible and include:
- Documentation enhancements
- Development environment improvements
- Dependency version updates
- Configuration refinements

🚀 Ready for Merge
The `develop` branch contains maintenance improvements that are:
-  Tested and stable
-  Non-breaking
-  Documentation-focused
-  Environment compatibility improvements
2025-09-09 13:46:23 +03:00
Sergey Penkovsky
082b5a6fb6 docs: add Netlify deployment status badge to README files
- Added Netlify deployment status badge to all package README files
- Standardized CI/CD badge formatting across the project
- Improves visibility of deployment status for documentation and examples
- Maintains consistent badge styling with existing Melos + FVM CI badge
2025-09-09 13:22:39 +03:00
Sergey Penkovsky
6c1ba523c6 chore(deps): adjust dev dependencies versions for broad compatibility
- Downgraded lints and test dependencies in multiple packages to ensure consistent analyzer and test ecosystem for Dart 3.2+.
- cherrypick_generator: Bump analyzer to ^7.7.1 and mockito to ^5.4.5 for patch updates and compatibility.
- cherrypick_flutter: Lowered flutter_lints and test to versions compatible with current stable toolchain.
- talker_cherrypick_logger: Lowered lints and test for alignment with mono-repo versions.
- melos.yaml: Added clean_all script for removing generated files and build artifacts repo-wide.

No functional code changes, only dependency and tooling improvements.
2025-09-09 12:45:12 +03:00
Sergey Penkovsky
651b2a26d6 chore(env): update Flutter and SDK constraints for compatibility
- Downgraded Flutter version in .fvmrc from 3.29.3 to 3.27.0 for compatibility with current dependencies
- Raised Dart SDK constraint in benchmark_di/pubspec.yaml from >=3.0.0 <4.0.0 to >=3.2.0 <4.0.0 to align with required package minimums

This change ensures environment compatibility for dependency resolution and build tools. No functional code changes.
2025-09-09 08:53:50 +03:00
Sergey Penkovsky
ec6e9aefd3 add banner 2025-09-09 00:47:00 +03:00
Sergey Penkovsky
751cb08064 Update approach descriptions in release notes
- Enhanced description of development approaches in both Russian and English versions
- Clarified distinction between programmatic (imperative) and declarative approaches
- Improved terminology consistency across both language versions
2025-09-09 00:46:09 +03:00
Sergey Penkovsky
b2fbce74b3 Code formatting fixes and dependency updates
- Fixed code formatting in benchmark_di CLI and adapter files
- Updated pubspec.lock files for benchmark_di, client_app, and postly examples
- Minor formatting improvements in disposable example
2025-09-08 17:22:49 +03:00
Sergey Penkovsky
81f14f5231 chore(release): publish packages
- cherrypick@3.0.0
 - cherrypick_annotations@3.0.0
 - cherrypick_flutter@3.0.0
 - cherrypick_generator@3.0.0
 - talker_cherrypick_logger@3.0.0
2025-09-08 17:17:50 +03:00
Sergey Penkovsky
a9101513e1 Add CI/CD badges to package README files
- Added Melos + FVM CI badges to all package README.md files
- Standardized badge formatting across all packages
- Improved project visibility with build status indicators
2025-09-08 17:16:51 +03:00
Sergey Penkovsky
f1cf1d054f Merge pull request #22 from pese-git/develop
# Release - CherryPick 3.x

> **CherryPick** — a lightweight and modular DI framework for Dart and Flutter that solves dependency injection through strong typing, code generation, and dependency control.

Version **3.x** was recently released with significant improvements.

## Main Changes in 3.x

* **O(1) dependency resolution** — thanks to Map indexing of bindings, performance does not depend on the size of the scope in the DI graph. This provides noticeable speedup in large projects.
* **Protection against circular dependencies** — checking works both within a single scope and across the entire hierarchy. When a cycle is detected, an informative exception with the dependency chain is thrown.
* **Integration with Talker** — all DI events (registration, creation, deletion, errors) are logged and can be displayed in the console or UI.
* **Automatic resource cleanup** — objects implementing `Disposable` are properly released when the scope is closed.
* **Stabilized declarative approach support** — annotations and code generation now work more reliably and are more convenient for use in projects.

## Resource Cleanup Example

```dart
class MyServiceWithSocket implements Disposable {
  @override
  Future<void> dispose() async {
    await socket.close();
    print('Socket closed!');
  }
}

class AppModule extends Module {
  @override
  void builder(Scope currentScope) {
    // singleton Api
    bind<MyServiceWithSocket>()
      .toProvide(() => MyServiceWithSocket())
      .singleton();
  }
}

scope.installModules([AppModule()]);

await CherryPick.closeRootScope(); // will wait for async dispose to complete
```

## Circular Dependency Checking

One of the new features in CherryPick 3.x is built-in cycle protection.
This helps catch situations early where services start depending on each other recursively.

### How to Enable Checking

For checking within a single scope:

```dart
final scope = CherryPick.openRootScope();
scope.enableCycleDetection();
```

For global checking across the entire hierarchy:

```dart
CherryPick.enableGlobalCycleDetection();
CherryPick.enableGlobalCrossScopeCycleDetection();
final rootScope = CherryPick.openRootScope();
```

### How a Cycle Can Occur

Suppose we have two services that depend on each other:

```dart
class UserService {
  final OrderService orderService;
  UserService(this.orderService);
}

class OrderService {
  final UserService userService;
  OrderService(this.userService);
}
```

If we register them in the same scope:

```dart
class AppModule extends Module {
  @override
  void builder(Scope currentScope) {
    bind<UserService>().toProvide(() => UserService(scope.resolve()));
    bind<OrderService>().toProvide(() => OrderService(scope.resolve()));
  }
}

final scope = CherryPick.openRootScope()
  ..enableCycleDetection()
  ..installModules([AppModule()]);

scope.resolve<UserService>();
```

Then when trying to resolve the dependency, an exception will be thrown:

```bash
 Circular dependency detected for UserService
Dependency chain: UserService -> OrderService -> UserService
```

This way, the error is detected immediately, not "somewhere in runtime".

## Integration with Talker

CherryPick 3.x allows logging all DI events through [Talker](https://pub.dev/packages/talker): registration, object creation, deletion, and errors. This is convenient for debugging and diagnosing the dependency graph.

Connection example:

```dart
final talker = Talker();
final observer = TalkerCherryPickObserver(talker);
CherryPick.setGlobalObserver(observer);
```

After this, DI events will be displayed in the console or UI:

```bash
┌───────────────────────────────────────────────────────────────
│ [info]    9:41:33  | [scope opened][CherryPick] scope_1757054493089_7072
└───────────────────────────────────────────────────────────────
┌───────────────────────────────────────────────────────────────
│ [verbose] 9:41:33  | [diagnostic][CherryPick] Scope created: scope_1757054493089_7072 {type: Scope, name: scope_1757054493089_7072, description: scope created}
└───────────────────────────────────────────────────────────────
```

In the log, you can see when scopes are created, which objects are registered and deleted, and catch errors and cycles in real time.


## Declarative Approach with Annotations

In addition to fully programmatic module descriptions, CherryPick supports **declarative DI style through annotations**.  
This allows minimizing manual code and automatically generating modules and mixins for automatic dependency injection.

Example of a declarative module:

```dart
@module()
abstract class AppModule extends Module {
  @provide()
  @singleton()
  Api api() => Api();

  @provide()
  Repo repo(Api api) => Repo(api);
}
````

After code generation, you can automatically inject dependencies into widgets or services:

```dart
@injectable()
class MyScreen extends StatelessWidget with _$MyScreen {
  @inject()
  late final Repo repo;

  MyScreen() {
    _inject(this);
  }
}
```

This way you can choose a convenient style: either **purely programmatic** or **declarative with annotations**.


## Who Might Find CherryPick Useful?

* Projects where it's important to guarantee **no cycles in the dependency graph**;
* Teams that want to **minimize manual DI code** and use a declarative style with annotations;
* Applications that require **automatic resource cleanup** (sockets, controllers, streams).

## Useful Links

* 📦 Package: [pub.dev/packages/cherrypick](https://pub.dev/packages/cherrypick)
* 💻 Code: [github.com/pese-git/cherrypick](https://github.com/pese-git/cherrypick)
* 📖 Documentation: [cherrypick-di.netlify.app](https://cherrypick-di.netlify.app/)
2025-09-08 17:04:48 +03:00
Sergey Penkovsky
f1ad1c42b5 Add ignore comment for deprecated member warning in binding.dart
- Added // ignore: deprecated_member_use_from_same_package comment
- This suppresses the warning about deprecated toProvideAsync method
- The comment is needed to maintain code quality while keeping backward compatibility
2025-09-08 16:50:45 +03:00
Sergey Penkovsky
be7f3e0392 Add release notes for CherryPick 3.x in both Russian and English
- Added comprehensive release notes for CherryPick 3.x
- Includes new features: O(1) dependency resolution, circular dependency protection
- Added Talker integration and automatic resource cleanup examples
- Added declarative approach with annotations section
- Both Russian and English versions included
2025-09-08 16:48:12 +03:00
Sergey Penkovsky
1b0615810d add presentation 2025-09-08 15:48:58 +03:00
Sergey Penkovsky
ef04f464da Update README.md 2025-09-08 15:40:09 +03:00
Sergey Penkovsky
6826f0f62c chore: synchronize package versions to 3.0.0-dev.X across all packages
- Unified MAJOR.MINOR versioning across all cherrypick ecosystem packages
- Updated cherrypick_annotations from 1.1.2-dev.2 to 3.0.0-dev.0
- Updated cherrypick_generator from 2.0.0-dev.2 to 3.0.0-dev.0
- Updated cherrypick_flutter from 1.1.3-dev.12 to 3.0.0-dev.1
- Updated documentation URLs from .dev to .netlify.app domain
- Maintained semantic versioning consistency for mono-repository management

This change ensures:
- Clear compatibility signaling between interdependent packages
- Simplified dependency management for consumers
- Consistent release versioning across the ecosystem
2025-09-08 15:06:19 +03:00
Sergey Penkovsky
9e517d047f chore(release): publish packages
- cherrypick@3.0.0-dev.13
 - cherrypick_flutter@3.0.0-dev.1
 - talker_cherrypick_logger@3.0.0-dev.1
2025-09-08 14:58:37 +03:00
Sergey Penkovsky
68a16aaa0c chore(release): publish packages
- talker_cherrypick_logger@3.0.0-dev.0
2025-09-08 14:57:29 +03:00
60 changed files with 1681 additions and 898 deletions

2
.fvmrc
View File

@@ -1,3 +1,3 @@
{
"flutter": "3.29.3"
"flutter": "3.32.0"
}

View File

@@ -3,6 +3,199 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 2025-10-20
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`cherrypick` - `v3.0.2`](#cherrypick---v302)
- [`cherrypick_flutter` - `v3.0.2`](#cherrypick_flutter---v302)
- [`talker_cherrypick_logger` - `v3.0.2`](#talker_cherrypick_logger---v302)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `cherrypick_flutter` - `v3.0.2`
- `talker_cherrypick_logger` - `v3.0.2`
---
#### `cherrypick` - `v3.0.2`
- **FIX**(test): fix warning.
- **FIX**(scope): properly clear binding and module references on dispose.
## 2025-09-09
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`cherrypick_annotations` - `v3.0.2-dev.0`](#cherrypick_annotations---v302-dev0)
- [`cherrypick_generator` - `v3.0.2-dev.0`](#cherrypick_generator---v302-dev0)
---
#### `cherrypick_annotations` - `v3.0.2-dev.0`
- **REFACTOR**(generator): migrate cherrypick_generator to analyzer element2 API.
#### `cherrypick_generator` - `v3.0.2-dev.0`
- **REFACTOR**(generator): migrate cherrypick_generator to analyzer element2 API.
## 2025-09-09
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`cherrypick` - `v3.0.1`](#cherrypick---v301)
- [`cherrypick_annotations` - `v3.0.1`](#cherrypick_annotations---v301)
- [`cherrypick_flutter` - `v3.0.1`](#cherrypick_flutter---v301)
- [`cherrypick_generator` - `v3.0.1`](#cherrypick_generator---v301)
- [`talker_cherrypick_logger` - `v3.0.1`](#talker_cherrypick_logger---v301)
---
#### `cherrypick` - `v3.0.1`
- **DOCS**: add Netlify deployment status badge to README files.
#### `cherrypick_annotations` - `v3.0.1`
- **DOCS**: add Netlify deployment status badge to README files.
#### `cherrypick_flutter` - `v3.0.1`
- **DOCS**: add Netlify deployment status badge to README files.
#### `cherrypick_generator` - `v3.0.1`
- **DOCS**: add Netlify deployment status badge to README files.
#### `talker_cherrypick_logger` - `v3.0.1`
- **DOCS**: add Netlify deployment status badge to README files.
## 2025-09-08
### Changes
---
Packages with breaking changes:
- [`cherrypick` - `v3.0.0`](#cherrypick---v300)
- [`cherrypick_annotations` - `v3.0.0`](#cherrypick_annotations---v300)
- [`cherrypick_flutter` - `v3.0.0`](#cherrypick_flutter---v300)
- [`cherrypick_generator` - `v3.0.0`](#cherrypick_generator---v300)
- [`talker_cherrypick_logger` - `v3.0.0`](#talker_cherrypick_logger---v300)
Packages with other changes:
- There are no other changes in this release.
Packages graduated to a stable release (see pre-releases prior to the stable version for changelog entries):
- `cherrypick` - `v3.0.0`
- `cherrypick_annotations` - `v3.0.0`
- `cherrypick_flutter` - `v3.0.0`
- `cherrypick_generator` - `v3.0.0`
- `talker_cherrypick_logger` - `v3.0.0`
---
#### `cherrypick` - `v3.0.0`
#### `cherrypick_annotations` - `v3.0.0`
#### `cherrypick_flutter` - `v3.0.0`
#### `cherrypick_generator` - `v3.0.0`
#### `talker_cherrypick_logger` - `v3.0.0`
## 2025-09-08
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`cherrypick` - `v3.0.0-dev.13`](#cherrypick---v300-dev13)
- [`cherrypick_flutter` - `v3.0.0-dev.1`](#cherrypick_flutter---v300-dev1)
- [`talker_cherrypick_logger` - `v3.0.0-dev.1`](#talker_cherrypick_logger---v300-dev1)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `cherrypick_flutter` - `v3.0.0-dev.1`
- `talker_cherrypick_logger` - `v3.0.0-dev.1`
---
#### `cherrypick` - `v3.0.0-dev.13`
- **FIX**: fix examples.
- **DOCS**: update contributors list with GitHub links and add new contributor.
- **DOCS**(binding,docs): clarify `.singleton()` with `.toInstance()` behavior in docs and API.
- **DOCS**(binding,docs): explain .singleton() + parametric provider behavior.
- **DOCS**(binding): clarify registration limitation in API doc.
- **DOCS**(di): clarify 'toInstance' binding limitations in builder.
## 2025-09-08
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`talker_cherrypick_logger` - `v3.0.0-dev.0`](#talker_cherrypick_logger---v300-dev0)
---
#### `talker_cherrypick_logger` - `v3.0.0-dev.0`
- chore(talker_cherrypick_logger): sync version with cherrypick 3.0.0-dev.12
## 2025-09-08
### Changes

View File

@@ -1,3 +1,8 @@
[![Melos + FVM CI](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
[![Netlify Status](https://api.netlify.com/api/v1/badges/3c3e0f98-27a9-4dd4-9eab-4be0b96798b8/deploy-status)](https://app.netlify.com/projects/cherrypick-di/deploys)
---
# CherryPick Workspace
CherryPick Workspace is a modular, open-source dependency injection ecosystem for Dart and Flutter, designed to offer lightweight, flexible, and scalable DI suitable for both backend and frontend (Flutter) development. This monorepo contains the main DI runtime library, annotation helpers, code generation for modular bindings, and seamless Flutter integration.

View File

@@ -98,7 +98,7 @@ class BenchmarkCliRunner {
final di = RiverpodAdapter();
if (scenario == UniversalScenario.asyncChain) {
final benchAsync = UniversalChainAsyncBenchmark<
Map<String, rp.ProviderBase<Object?>>> (
Map<String, rp.ProviderBase<Object?>>>(
di,
chainCount: c,
nestingDepth: d,
@@ -111,7 +111,7 @@ class BenchmarkCliRunner {
);
} else {
final benchSync = UniversalChainBenchmark<
Map<String, rp.ProviderBase<Object?>>> (
Map<String, rp.ProviderBase<Object?>>>(
di,
chainCount: c,
nestingDepth: d,
@@ -127,7 +127,8 @@ class BenchmarkCliRunner {
} else if (config.di == 'yx_scope') {
final di = YxScopeAdapter();
if (scenario == UniversalScenario.asyncChain) {
final benchAsync = UniversalChainAsyncBenchmark<UniversalYxScopeContainer>(
final benchAsync =
UniversalChainAsyncBenchmark<UniversalYxScopeContainer>(
di,
chainCount: c,
nestingDepth: d,
@@ -139,7 +140,8 @@ class BenchmarkCliRunner {
repeats: config.repeats,
);
} else {
final benchSync = UniversalChainBenchmark<UniversalYxScopeContainer>(
final benchSync =
UniversalChainBenchmark<UniversalYxScopeContainer>(
di,
chainCount: c,
nestingDepth: d,

View File

@@ -20,77 +20,80 @@ class KiwiAdapter extends DIAdapter<KiwiContainer> {
registration(_container);
}
@override
Registration<KiwiContainer> universalRegistration<S extends Enum>({
required S scenario,
required int chainCount,
required int nestingDepth,
required UniversalBindingMode bindingMode,
}) {
if (scenario is UniversalScenario) {
if (scenario == UniversalScenario.asyncChain ||
bindingMode == UniversalBindingMode.asyncStrategy) {
throw UnsupportedError('Kiwi does not support async dependencies or async binding scenarios.');
}
return (container) {
switch (scenario) {
case UniversalScenario.asyncChain:
break;
case UniversalScenario.register:
container.registerSingleton<UniversalService>(
(c) => UniversalServiceImpl(value: 'reg', dependency: null),
);
break;
case UniversalScenario.named:
container.registerFactory<UniversalService>(
(c) => UniversalServiceImpl(value: 'impl1'), name: 'impl1');
container.registerFactory<UniversalService>(
(c) => UniversalServiceImpl(value: 'impl2'), name: 'impl2');
break;
case UniversalScenario.chain:
for (int chain = 1; chain <= chainCount; chain++) {
for (int level = 1; level <= nestingDepth; level++) {
final prevDepName = '${chain}_${level - 1}';
final depName = '${chain}_$level';
switch (bindingMode) {
case UniversalBindingMode.singletonStrategy:
container.registerSingleton<UniversalService>(
(c) => UniversalServiceImpl(
value: depName,
dependency: level > 1
? c.resolve<UniversalService>(prevDepName)
: null),
name: depName);
break;
case UniversalBindingMode.factoryStrategy:
container.registerFactory<UniversalService>(
(c) => UniversalServiceImpl(
value: depName,
dependency: level > 1
? c.resolve<UniversalService>(prevDepName)
: null),
name: depName);
break;
case UniversalBindingMode.asyncStrategy:
// Не поддерживается
break;
@override
Registration<KiwiContainer> universalRegistration<S extends Enum>({
required S scenario,
required int chainCount,
required int nestingDepth,
required UniversalBindingMode bindingMode,
}) {
if (scenario is UniversalScenario) {
if (scenario == UniversalScenario.asyncChain ||
bindingMode == UniversalBindingMode.asyncStrategy) {
throw UnsupportedError(
'Kiwi does not support async dependencies or async binding scenarios.');
}
return (container) {
switch (scenario) {
case UniversalScenario.asyncChain:
break;
case UniversalScenario.register:
container.registerSingleton<UniversalService>(
(c) => UniversalServiceImpl(value: 'reg', dependency: null),
);
break;
case UniversalScenario.named:
container.registerFactory<UniversalService>(
(c) => UniversalServiceImpl(value: 'impl1'),
name: 'impl1');
container.registerFactory<UniversalService>(
(c) => UniversalServiceImpl(value: 'impl2'),
name: 'impl2');
break;
case UniversalScenario.chain:
for (int chain = 1; chain <= chainCount; chain++) {
for (int level = 1; level <= nestingDepth; level++) {
final prevDepName = '${chain}_${level - 1}';
final depName = '${chain}_$level';
switch (bindingMode) {
case UniversalBindingMode.singletonStrategy:
container.registerSingleton<UniversalService>(
(c) => UniversalServiceImpl(
value: depName,
dependency: level > 1
? c.resolve<UniversalService>(prevDepName)
: null),
name: depName);
break;
case UniversalBindingMode.factoryStrategy:
container.registerFactory<UniversalService>(
(c) => UniversalServiceImpl(
value: depName,
dependency: level > 1
? c.resolve<UniversalService>(prevDepName)
: null),
name: depName);
break;
case UniversalBindingMode.asyncStrategy:
// Не поддерживается
break;
}
}
}
}
final depName = '${chainCount}_$nestingDepth';
container.registerSingleton<UniversalService>(
(c) => c.resolve<UniversalService>(depName));
break;
case UniversalScenario.override:
final depName = '${chainCount}_$nestingDepth';
container.registerSingleton<UniversalService>(
(c) => c.resolve<UniversalService>(depName));
break;
}
};
final depName = '${chainCount}_$nestingDepth';
container.registerSingleton<UniversalService>(
(c) => c.resolve<UniversalService>(depName));
break;
case UniversalScenario.override:
final depName = '${chainCount}_$nestingDepth';
container.registerSingleton<UniversalService>(
(c) => c.resolve<UniversalService>(depName));
break;
}
};
}
throw UnsupportedError('Scenario $scenario not supported by KiwiAdapter');
}
throw UnsupportedError('Scenario $scenario not supported by KiwiAdapter');
}
@override
T resolve<T extends Object>({String? named}) {

View File

@@ -11,7 +11,8 @@ class YxScopeAdapter extends DIAdapter<UniversalYxScopeContainer> {
late UniversalYxScopeContainer _scope;
@override
void setupDependencies(void Function(UniversalYxScopeContainer container) registration) {
void setupDependencies(
void Function(UniversalYxScopeContainer container) registration) {
_scope = UniversalYxScopeContainer();
registration(_scope);
}
@@ -45,7 +46,8 @@ class YxScopeAdapter extends DIAdapter<UniversalYxScopeContainer> {
}
@override
Registration<UniversalYxScopeContainer> universalRegistration<S extends Enum>({
Registration<UniversalYxScopeContainer>
universalRegistration<S extends Enum>({
required S scenario,
required int chainCount,
required int nestingDepth,
@@ -112,7 +114,8 @@ class YxScopeAdapter extends DIAdapter<UniversalYxScopeContainer> {
// handled at benchmark level
break;
}
if (scenario == UniversalScenario.chain || scenario == UniversalScenario.override) {
if (scenario == UniversalScenario.chain ||
scenario == UniversalScenario.override) {
final depName = '${chainCount}_$nestingDepth';
final lastDep = scope.dep<UniversalService>(
() => scope.depFor<UniversalService>(name: depName).get,
@@ -121,6 +124,7 @@ class YxScopeAdapter extends DIAdapter<UniversalYxScopeContainer> {
}
};
}
throw UnsupportedError('Scenario $scenario not supported by YxScopeAdapter');
throw UnsupportedError(
'Scenario $scenario not supported by YxScopeAdapter');
}
}

View File

@@ -47,7 +47,7 @@ packages:
path: "../cherrypick"
relative: true
source: path
version: "3.0.0-dev.12"
version: "3.0.1"
collection:
dependency: transitive
description:

View File

@@ -4,7 +4,7 @@ publish_to: none
description: Universal benchmark for any DI library (cherrypick, get_it, and others)
environment:
sdk: '>=3.0.0 <4.0.0'
sdk: '>=3.2.0 <4.0.0'
dependencies:
cherrypick:

View File

@@ -1,3 +1,25 @@
## 3.0.2
- **FIX**(test): fix warning.
- **FIX**(scope): properly clear binding and module references on dispose.
## 3.0.1
- **DOCS**: add Netlify deployment status badge to README files.
## 3.0.0
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 3.0.0-dev.13
- **FIX**: fix examples.
- **DOCS**: update contributors list with GitHub links and add new contributor.
- **DOCS**(binding,docs): clarify `.singleton()` with `.toInstance()` behavior in docs and API.
- **DOCS**(binding,docs): explain .singleton() + parametric provider behavior.
- **DOCS**(binding): clarify registration limitation in API doc.
- **DOCS**(di): clarify 'toInstance' binding limitations in builder.
## 3.0.0-dev.12
- **FIX**(scope): prevent concurrent modification in dispose().

View File

@@ -1,3 +1,8 @@
[![Melos + FVM CI](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
[![Netlify Status](https://api.netlify.com/api/v1/badges/3c3e0f98-27a9-4dd4-9eab-4be0b96798b8/deploy-status)](https://app.netlify.com/projects/cherrypick-di/deploys)
---
# CherryPick
`cherrypick` is a flexible and lightweight dependency injection library for Dart and Flutter.

View File

@@ -191,6 +191,7 @@ class Binding<T> {
/// }
/// ```
/// This restriction only applies to [toInstance] bindings.
// ignore: deprecated_member_use_from_same_package
/// With [toProvide]/[toProvideAsync] you may freely use `scope.resolve<T>()` in the builder or provider function.
Binding<T> toInstance(Instance<T> value) {
_resolver = InstanceResolver<T>(value);

View File

@@ -498,5 +498,10 @@ class Scope with CycleDetectionMixin, GlobalCycleDetectionMixin {
await d.dispose();
}
_disposables.clear();
// Clear modules
_modulesList.clear();
// Clear binding-index
_bindingResolvers.clear();
}
}

View File

@@ -1,8 +1,8 @@
name: cherrypick
description: Cherrypick is a small dependency injection (DI) library for dart/flutter projects.
version: 3.0.0-dev.12
homepage: https://cherrypick-di.dev/
documentation: https://cherrypick-di.dev/docs/intro
version: 3.0.2
homepage: https://cherrypick-di.netlify.app
documentation: https://cherrypick-di.netlify.app/docs/intro
repository: https://github.com/pese-git/cherrypick
issue_tracker: https://github.com/pese-git/cherrypick/issues
topics:
@@ -13,14 +13,14 @@ topics:
- inversion-of-control
environment:
sdk: ">=3.5.2 <4.0.0"
sdk: '>=3.2.0 <4.0.0'
dependencies:
meta: ^1.3.0
dev_dependencies:
lints: ^5.0.0
test: ^1.25.15
lints: ^4.0.0
test: ^1.25.6
mockito: ^5.0.6
mockito: ^5.4.4
melos: ^6.3.2

View File

@@ -0,0 +1,65 @@
import 'dart:async';
import 'package:cherrypick/cherrypick.dart';
import 'package:test/test.dart';
class HeavyService implements Disposable {
static int instanceCount = 0;
HeavyService() {
instanceCount++;
print('HeavyService created. Instance count: '
'\u001b[32m$instanceCount\u001b[0m');
}
@override
void dispose() {
instanceCount--;
print('HeavyService disposed. Instance count: '
'\u001b[31m$instanceCount\u001b[0m');
}
static final Finalizer<String> _finalizer = Finalizer((msg) {
print('GC FINALIZED HeavyService: $msg');
});
void registerFinalizer() => _finalizer.attach(this, toString(), detach: this);
}
class HeavyModule extends Module {
@override
void builder(Scope scope) {
bind<HeavyService>().toProvide(() => HeavyService());
}
}
void main() {
test('Binding memory is cleared after closing and reopening scope', () async {
final root = CherryPick.openRootScope();
for (int i = 0; i < 10; i++) {
print('\nIteration $i -------------------------------');
final subScope = root.openSubScope('leak-test-scope');
subScope.installModules([HeavyModule()]);
final service = subScope.resolve<HeavyService>();
expect(service, isNotNull);
await root.closeSubScope('leak-test-scope');
// Dart GC не сразу удаляет освобождённые объекты, добавляем паузу и вызываем GC.
await Future.delayed(const Duration(milliseconds: 200));
}
// Если dispose не вызвался, instanceCount > 0 => утечка.
expect(HeavyService.instanceCount, equals(0));
});
test('Service is finalized after scope is closed/cleaned', () async {
final root = CherryPick.openRootScope();
HeavyService? ref;
{
final sub = root.openSubScope('s');
sub.installModules([HeavyModule()]);
ref = sub.resolve<HeavyService>();
ref.registerFinalizer();
expect(HeavyService.instanceCount, 1);
await root.closeSubScope('s');
}
await Future.delayed(const Duration(seconds: 2));
expect(HeavyService.instanceCount, 0);
});
}

View File

@@ -1,3 +1,15 @@
## 3.0.2-dev.0
- **REFACTOR**(generator): migrate cherrypick_generator to analyzer element2 API.
## 3.0.1
- **DOCS**: add Netlify deployment status badge to README files.
## 3.0.0
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 3.0.0-dev.0
- chore(cherrypick_annotations): sync version with cherrypick 3.0.0-dev.0

View File

@@ -1,3 +1,8 @@
[![Melos + FVM CI](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
[![Netlify Status](https://api.netlify.com/api/v1/badges/3c3e0f98-27a9-4dd4-9eab-4be0b96798b8/deploy-status)](https://app.netlify.com/projects/cherrypick-di/deploys)
---
# cherrypick_annotations
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)

View File

@@ -1,9 +1,9 @@
name: cherrypick_annotations
description: |
Set of annotations for CherryPick dependency injection library. Enables code generation and declarative DI for Dart & Flutter projects.
version: 3.0.0-dev.0
homepage: https://cherrypick-di.dev/
documentation: https://cherrypick-di.dev/docs/intro
version: 3.0.2-dev.0
homepage: https://cherrypick-di.netlify.app
documentation: https://cherrypick-di.netlify.app/docs/intro
repository: https://github.com/pese-git/cherrypick/cherrypick_annotations
issue_tracker: https://github.com/pese-git/cherrypick/issues
topics:
@@ -14,7 +14,7 @@ topics:
- inversion-of-control
environment:
sdk: ">=3.5.2 <4.0.0"
sdk: ">=3.8.0 <4.0.0"
# Add regular dependencies here.
dependencies:
@@ -22,5 +22,5 @@ dependencies:
# path: ^1.8.0
dev_dependencies:
lints: ^5.0.0
lints: ^6.0.0
test: ^1.25.8

View File

@@ -1,3 +1,19 @@
## 3.0.2
- Update a dependency to the latest release.
## 3.0.1
- **DOCS**: add Netlify deployment status badge to README files.
## 3.0.0
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 3.0.0-dev.1
- Update a dependency to the latest release.
## 3.0.0-dev.0
- chore(cherrypick_flutter): sync version with cherrypick 3.0.0-dev.12

View File

@@ -1,3 +1,8 @@
[![Melos + FVM CI](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
[![Netlify Status](https://api.netlify.com/api/v1/badges/3c3e0f98-27a9-4dd4-9eab-4be0b96798b8/deploy-status)](https://app.netlify.com/projects/cherrypick-di/deploys)
---
# CherryPick Flutter
`cherrypick_flutter` offers a Flutter integration to access and manage dependency injection scopes using the `CherryPickProvider`. This setup facilitates accessing the root scope directly from the widget tree, providing a straightforward mechanism for dependences management within Flutter applications.

View File

@@ -1,8 +1,8 @@
name: cherrypick_flutter
description: "Flutter library that allows access to the root scope through the context using `CherryPickProvider`."
version: 3.0.0-dev.0
homepage: https://cherrypick-di.dev/
documentation: https://cherrypick-di.dev/docs/intro
version: 3.0.2
homepage: https://cherrypick-di.netlify.app
documentation: https://cherrypick-di.netlify.app/docs/intro
repository: https://github.com/pese-git/cherrypick
issue_tracker: https://github.com/pese-git/cherrypick/issues
topics:
@@ -13,19 +13,19 @@ topics:
- inversion-of-control
environment:
sdk: ">=3.5.2 <4.0.0"
flutter: ">=3.24.0"
sdk: '>=3.2.0 <4.0.0'
flutter: ">=3.16.0"
dependencies:
flutter:
sdk: flutter
cherrypick: ^3.0.0-dev.12
cherrypick: ^3.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
test: ^1.25.7
flutter_lints: ^4.0.0
test: ^1.25.6
melos: ^6.3.2
# For information on the generic Dart part of this file, see the

View File

@@ -1,3 +1,15 @@
## 3.0.2-dev.0
- **REFACTOR**(generator): migrate cherrypick_generator to analyzer element2 API.
## 3.0.1
- **DOCS**: add Netlify deployment status badge to README files.
## 3.0.0
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 3.0.0-dev.0
- chore(cherrypick_generator): sync version with cherrypick 3.0.0-dev.12

View File

@@ -1,3 +1,8 @@
[![Melos + FVM CI](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
[![Netlify Status](https://api.netlify.com/api/v1/badges/3c3e0f98-27a9-4dd4-9eab-4be0b96798b8/deploy-status)](https://app.netlify.com/projects/cherrypick-di/deploys)
---
# Cherrypick Generator
**Cherrypick Generator** is a Dart code generation library for automating dependency injection (DI) boilerplate. It processes classes and fields annotated with [cherrypick_annotations](https://pub.dev/packages/cherrypick_annotations) and generates registration code for services, modules, and field injection for classes marked as `@injectable`. It supports advanced DI features such as scopes, named bindings, parameters, and asynchronous dependencies.

View File

@@ -32,3 +32,4 @@ include: package:lints/recommended.yaml
analyzer:
errors:
deprecated_member_use: ignore
unintended_html_in_doc_comment: ignore

View File

@@ -11,13 +11,12 @@
// limitations under the License.
//
import 'dart:async';
import 'package:analyzer/dart/constant/value.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/dart/element/nullability_suffix.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:build/build.dart';
import 'package:source_gen/source_gen.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:cherrypick_annotations/cherrypick_annotations.dart' as ann;
/// CherryPick DI field injector generator for codegen.
@@ -100,12 +99,12 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
/// }
/// ```
@override
FutureOr<String> generateForAnnotatedElement(
Element element,
dynamic generateForAnnotatedElement(
Element2 element,
ConstantReader annotation,
BuildStep buildStep,
) {
if (element is! ClassElement) {
if (element is! ClassElement2) {
throw InvalidGenerationSourceError(
'@injectable() can only be applied to classes.',
element: element,
@@ -113,7 +112,7 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
}
final classElement = element;
final className = classElement.name;
final className = classElement.firstFragment.name2;
final mixinName = '_\$$className';
final buffer = StringBuffer()
@@ -121,8 +120,9 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
..writeln(' void _inject($className instance) {');
// Collect and process all @inject fields
final injectFields =
classElement.fields.where(_isInjectField).map(_parseInjectField);
final injectFields = classElement.fields2
.where((f) => _isInjectField(f))
.map((f) => _parseInjectField(f));
for (final parsedField in injectFields) {
buffer.writeln(_generateInjectionLine(parsedField));
@@ -138,8 +138,8 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
/// Returns true if a field is annotated with `@inject`.
///
/// Used to detect which fields should be processed for injection.
static bool _isInjectField(FieldElement field) {
return field.metadata.any(
static bool _isInjectField(FieldElement2 field) {
return field.firstFragment.metadata2.annotations.any(
(m) => m.computeConstantValue()?.type?.getDisplayString() == 'inject',
);
}
@@ -149,11 +149,11 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
///
/// Converts Dart field declaration and all parameterizing injection-related
/// annotations into a [_ParsedInjectField] which is used for codegen.
static _ParsedInjectField _parseInjectField(FieldElement field) {
static _ParsedInjectField _parseInjectField(FieldElement2 field) {
String? scopeName;
String? namedValue;
for (final meta in field.metadata) {
for (final meta in field.firstFragment.metadata2.annotations) {
final DartObject? obj = meta.computeConstantValue();
final type = obj?.type?.getDisplayString();
if (type == 'scope') {
@@ -177,15 +177,15 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
}
// Determine nullability for field types like T? or Future<T?>
bool isNullable = dartType.nullabilitySuffix ==
NullabilitySuffix.question ||
bool isNullable =
dartType.nullabilitySuffix == NullabilitySuffix.question ||
(dartType is ParameterizedType &&
(dartType)
.typeArguments
.any((t) => t.nullabilitySuffix == NullabilitySuffix.question));
(dartType).typeArguments.any(
(t) => t.nullabilitySuffix == NullabilitySuffix.question,
));
return _ParsedInjectField(
fieldName: field.name,
fieldName: field.firstFragment.name2 ?? '',
coreType: coreTypeName.replaceAll('?', ''), // удаляем "?" на всякий
isFuture: isFuture,
isNullable: isNullable,
@@ -207,11 +207,11 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
String _generateInjectionLine(_ParsedInjectField field) {
final resolveMethod = field.isFuture
? (field.isNullable
? 'tryResolveAsync<${field.coreType}>'
: 'resolveAsync<${field.coreType}>')
? 'tryResolveAsync<${field.coreType}>'
: 'resolveAsync<${field.coreType}>')
: (field.isNullable
? 'tryResolve<${field.coreType}>'
: 'resolve<${field.coreType}>');
? 'tryResolve<${field.coreType}>'
: 'resolve<${field.coreType}>');
final openCall = (field.scopeName != null && field.scopeName!.isNotEmpty)
? "CherryPick.openScope(scopeName: '${field.scopeName}')"

View File

@@ -11,7 +11,7 @@
// limitations under the License.
//
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'package:build/build.dart';
import 'package:source_gen/source_gen.dart';
import 'package:cherrypick_annotations/cherrypick_annotations.dart' as ann;
@@ -79,12 +79,12 @@ class ModuleGenerator extends GeneratorForAnnotation<ann.module> {
///
/// See file-level docs for usage and generated output example.
@override
String generateForAnnotatedElement(
Element element,
dynamic generateForAnnotatedElement(
Element2 element,
ConstantReader annotation,
BuildStep buildStep,
) {
if (element is! ClassElement) {
if (element is! ClassElement2) {
throw InvalidGenerationSourceError(
'@module() can only be applied to classes.',
element: element,

View File

@@ -12,6 +12,7 @@
//
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'exceptions.dart';
import 'metadata_utils.dart';
@@ -52,8 +53,10 @@ class AnnotationValidator {
/// - Parameter validation for method arguments.
///
/// Throws [AnnotationValidationException] on any violation.
static void validateMethodAnnotations(MethodElement method) {
final annotations = _getAnnotationNames(method.metadata);
static void validateMethodAnnotations(MethodElement2 method) {
final annotations = _getAnnotationNames(
method.firstFragment.metadata2.annotations,
);
_validateMutuallyExclusiveAnnotations(method, annotations);
_validateAnnotationCombinations(method, annotations);
@@ -68,8 +71,10 @@ class AnnotationValidator {
/// - Correct scope naming if present.
///
/// Throws [AnnotationValidationException] if checks fail.
static void validateFieldAnnotations(FieldElement field) {
final annotations = _getAnnotationNames(field.metadata);
static void validateFieldAnnotations(FieldElement2 field) {
final annotations = _getAnnotationNames(
field.firstFragment.metadata2.annotations,
);
_validateInjectFieldAnnotations(field, annotations);
}
@@ -82,8 +87,10 @@ class AnnotationValidator {
/// - Provides helpful context for error/warning reporting.
///
/// Throws [AnnotationValidationException] if checks fail.
static void validateClassAnnotations(ClassElement classElement) {
final annotations = _getAnnotationNames(classElement.metadata);
static void validateClassAnnotations(ClassElement2 classElement) {
final annotations = _getAnnotationNames(
classElement.firstFragment.metadata2.annotations,
);
_validateModuleClassAnnotations(classElement, annotations);
_validateInjectableClassAnnotations(classElement, annotations);
@@ -104,7 +111,7 @@ class AnnotationValidator {
///
/// For example, `@instance` and `@provide` cannot both be present.
static void _validateMutuallyExclusiveAnnotations(
MethodElement method,
MethodElement2 method,
List<String> annotations,
) {
// @instance and @provide are mutually exclusive
@@ -127,7 +134,7 @@ class AnnotationValidator {
/// - One of `@instance` or `@provide` must be present for a registration method
/// - Validates singleton usage
static void _validateAnnotationCombinations(
MethodElement method,
MethodElement2 method,
List<String> annotations,
) {
// @params can only be used with @provide
@@ -165,7 +172,7 @@ class AnnotationValidator {
/// Singleton-specific method annotation checks.
static void _validateSingletonUsage(
MethodElement method,
MethodElement2 method,
List<String> annotations,
) {
// Singleton with params might not make sense in some contexts
@@ -181,18 +188,17 @@ class AnnotationValidator {
'Singleton methods cannot return void',
element: method,
suggestion: 'Remove @singleton annotation or change return type',
context: {
'method_name': method.displayName,
'return_type': returnType,
},
context: {'method_name': method.displayName, 'return_type': returnType},
);
}
}
/// Validates extra requirements or syntactic rules for annotation arguments, like @named.
static void _validateAnnotationParameters(MethodElement method) {
static void _validateAnnotationParameters(MethodElement2 method) {
// Validate @named annotation parameters
final namedValue = MetadataUtils.getNamedValue(method.metadata);
final namedValue = MetadataUtils.getNamedValue(
method.firstFragment.metadata2.annotations,
);
if (namedValue != null) {
if (namedValue.isEmpty) {
throw AnnotationValidationException(
@@ -222,8 +228,10 @@ class AnnotationValidator {
}
// Validate method parameters for @params usage
for (final param in method.parameters) {
final paramAnnotations = _getAnnotationNames(param.metadata);
for (final param in method.formalParameters) {
final paramAnnotations = _getAnnotationNames(
param.firstFragment.metadata2.annotations,
);
if (paramAnnotations.contains('params')) {
_validateParamsParameter(param, method);
}
@@ -232,7 +240,9 @@ class AnnotationValidator {
/// Checks that @params is used with compatible parameter type.
static void _validateParamsParameter(
ParameterElement param, MethodElement method) {
FormalParameterElement param,
MethodElement2 method,
) {
// @params parameter should typically be dynamic or Map<String, dynamic>
final paramType = param.type.getDisplayString();
if (paramType != 'dynamic' &&
@@ -256,7 +266,7 @@ class AnnotationValidator {
/// Checks field-level annotation for valid injectable fields.
static void _validateInjectFieldAnnotations(
FieldElement field,
FieldElement2 field,
List<String> annotations,
) {
if (!annotations.contains('inject')) {
@@ -270,15 +280,12 @@ class AnnotationValidator {
'Cannot inject void type',
element: field,
suggestion: 'Use a concrete type instead of void',
context: {
'field_name': field.displayName,
'field_type': fieldType,
},
context: {'field_name': field.displayName, 'field_type': fieldType},
);
}
// Validate scope annotation if present
for (final meta in field.metadata) {
for (final meta in field.firstFragment.metadata2.annotations) {
final obj = meta.computeConstantValue();
final type = obj?.type?.getDisplayString();
if (type == 'scope') {
@@ -290,7 +297,7 @@ class AnnotationValidator {
/// Checks @module usage: must have at least one DI method, each with DI-annotation.
static void _validateModuleClassAnnotations(
ClassElement classElement,
ClassElement2 classElement,
List<String> annotations,
) {
if (!annotations.contains('module')) {
@@ -298,8 +305,9 @@ class AnnotationValidator {
}
// Check if class has public methods
final publicMethods =
classElement.methods.where((m) => m.isPublic).toList();
final publicMethods = classElement.methods2
.where((m) => m.isPublic)
.toList();
if (publicMethods.isEmpty) {
throw AnnotationValidationException(
'Module class must have at least one public method',
@@ -314,7 +322,9 @@ class AnnotationValidator {
// Validate that public methods have appropriate annotations
for (final method in publicMethods) {
final methodAnnotations = _getAnnotationNames(method.metadata);
final methodAnnotations = _getAnnotationNames(
method.firstFragment.metadata2.annotations,
);
if (!methodAnnotations.contains('instance') &&
!methodAnnotations.contains('provide')) {
throw AnnotationValidationException(
@@ -332,7 +342,7 @@ class AnnotationValidator {
/// Checks @injectable usage on classes and their fields.
static void _validateInjectableClassAnnotations(
ClassElement classElement,
ClassElement2 classElement,
List<String> annotations,
) {
if (!annotations.contains('injectable')) {
@@ -340,8 +350,10 @@ class AnnotationValidator {
}
// Check if class has injectable fields
final injectFields = classElement.fields.where((f) {
final fieldAnnotations = _getAnnotationNames(f.metadata);
final injectFields = classElement.fields2.where((f) {
final fieldAnnotations = _getAnnotationNames(
f.firstFragment.metadata2.annotations,
);
return fieldAnnotations.contains('inject');
}).toList();

View File

@@ -11,7 +11,7 @@
// limitations under the License.
//
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'bind_parameters_spec.dart';
import 'metadata_utils.dart';
@@ -25,7 +25,7 @@ enum BindingType {
instance,
/// Provider/factory function (@provide).
provide;
provide,
}
/// ---------------------------------------------------------------------------
@@ -155,7 +155,8 @@ class BindSpec {
switch (bindingType) {
case BindingType.instance:
throw StateError(
'Internal error: _generateWithParamsProvideClause called for @instance binding with @params.');
'Internal error: _generateWithParamsProvideClause called for @instance binding with @params.',
);
//return isAsyncInstance
// ? '.toInstanceAsync(($fnArgs) => $methodName($fnArgs))'
// : '.toInstance(($fnArgs) => $methodName($fnArgs))';
@@ -189,20 +190,24 @@ class BindSpec {
case BindingType.provide:
if (isAsyncProvide) {
if (needsMultiline) {
final lambdaIndent =
(isSingleton || named != null) ? indent + 6 : indent + 2;
final closingIndent =
(isSingleton || named != null) ? indent + 4 : indent;
final lambdaIndent = (isSingleton || named != null)
? indent + 6
: indent + 2;
final closingIndent = (isSingleton || named != null)
? indent + 4
: indent;
return '.toProvideAsync(\n${' ' * lambdaIndent}() => $methodName($argsStr),\n${' ' * closingIndent})';
} else {
return '.toProvideAsync(() => $methodName($argsStr))';
}
} else {
if (needsMultiline) {
final lambdaIndent =
(isSingleton || named != null) ? indent + 6 : indent + 2;
final closingIndent =
(isSingleton || named != null) ? indent + 4 : indent;
final lambdaIndent = (isSingleton || named != null)
? indent + 6
: indent + 2;
final closingIndent = (isSingleton || named != null)
? indent + 4
: indent;
return '.toProvide(\n${' ' * lambdaIndent}() => $methodName($argsStr),\n${' ' * closingIndent})';
} else {
return '.toProvide(() => $methodName($argsStr))';
@@ -246,7 +251,7 @@ class BindSpec {
/// print(bindSpec.returnType); // e.g., 'Logger'
/// ```
/// Throws [AnnotationValidationException] or [CodeGenerationException] if invalid.
static BindSpec fromMethod(MethodElement method) {
static BindSpec fromMethod(MethodElement2 method) {
try {
// Validate method annotations
AnnotationValidator.validateMethodAnnotations(method);
@@ -254,28 +259,44 @@ class BindSpec {
// Parse return type using improved type parser
final parsedReturnType = TypeParser.parseType(method.returnType, method);
final methodName = method.displayName;
final methodName = method.firstFragment.name2 ?? '';
// Check for @singleton annotation.
final isSingleton = MetadataUtils.anyMeta(method.metadata, 'singleton');
final isSingleton = MetadataUtils.anyMeta(
method.firstFragment.metadata2.annotations,
'singleton',
);
// Get @named value if present.
final named = MetadataUtils.getNamedValue(method.metadata);
final named = MetadataUtils.getNamedValue(
method.firstFragment.metadata2.annotations,
);
// Parse each method parameter.
final params = <BindParameterSpec>[];
bool hasParams = false;
for (final p in method.parameters) {
for (final p in method.formalParameters) {
final typeStr = p.type.getDisplayString();
final paramNamed = MetadataUtils.getNamedValue(p.metadata);
final isParams = MetadataUtils.anyMeta(p.metadata, 'params');
final paramNamed = MetadataUtils.getNamedValue(
p.firstFragment.metadata2.annotations,
);
final isParams = MetadataUtils.anyMeta(
p.firstFragment.metadata2.annotations,
'params',
);
if (isParams) hasParams = true;
params.add(BindParameterSpec(typeStr, paramNamed, isParams: isParams));
}
// Determine bindingType: @instance or @provide.
final hasInstance = MetadataUtils.anyMeta(method.metadata, 'instance');
final hasProvide = MetadataUtils.anyMeta(method.metadata, 'provide');
final hasInstance = MetadataUtils.anyMeta(
method.firstFragment.metadata2.annotations,
'instance',
);
final hasProvide = MetadataUtils.anyMeta(
method.firstFragment.metadata2.annotations,
'provide',
);
if (!hasInstance && !hasProvide) {
throw AnnotationValidationException(
@@ -290,8 +311,9 @@ class BindSpec {
);
}
final bindingType =
hasInstance ? BindingType.instance : BindingType.provide;
final bindingType = hasInstance
? BindingType.instance
: BindingType.provide;
// PROHIBIT @params with @instance bindings!
if (bindingType == BindingType.instance && hasParams) {

View File

@@ -11,7 +11,7 @@
// limitations under the License.
//
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'package:source_gen/source_gen.dart';
/// ---------------------------------------------------------------------------
@@ -48,21 +48,21 @@ class CherryPickGeneratorException extends InvalidGenerationSourceError {
CherryPickGeneratorException(
String message, {
required Element element,
required Element2 element,
required this.category,
this.suggestion,
this.context,
}) : super(
_formatMessage(message, category, suggestion, context, element),
element: element,
);
_formatMessage(message, category, suggestion, context, element),
element: element,
);
static String _formatMessage(
String message,
String category,
String? suggestion,
Map<String, dynamic>? context,
Element element,
Element2 element,
) {
final buffer = StringBuffer();
@@ -74,7 +74,9 @@ class CherryPickGeneratorException extends InvalidGenerationSourceError {
buffer.writeln('Context:');
buffer.writeln(' Element: ${element.displayName}');
buffer.writeln(' Type: ${element.runtimeType}');
buffer.writeln(' Location: ${element.source?.fullName ?? 'unknown'}');
buffer.writeln(
' Location: ${element.firstFragment.libraryFragment?.source.fullName ?? 'unknown'}',
);
// Try to show enclosing element info for extra context
try {

View File

@@ -12,6 +12,7 @@
//
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'bind_spec.dart';
/// ---------------------------------------------------------------------------
@@ -75,14 +76,11 @@ class GeneratedClass {
/// final gen = GeneratedClass.fromClassElement(classElement);
/// print(gen.generatedClassName); // e.g. $AppModule
/// ```
static GeneratedClass fromClassElement(ClassElement element) {
final className = element.displayName;
// Generated class name with '$' prefix (standard for generated Dart code).
static GeneratedClass fromClassElement(ClassElement2 element) {
final className = element.firstFragment.name2 ?? '';
final generatedClassName = r'$' + className;
// Get source file name
final sourceFile = element.source.shortName;
// Collect bindings for all non-abstract methods.
final binds = element.methods
final sourceFile = element.firstFragment.libraryFragment.source.shortName;
final binds = element.methods2
.where((m) => !m.isAbstract)
.map(BindSpec.fromMethod)
.toList();

View File

@@ -41,14 +41,16 @@ class MetadataUtils {
/// bool isSingleton = MetadataUtils.anyMeta(myMethod.metadata, 'singleton');
/// ```
static bool anyMeta(List<ElementAnnotation> meta, String typeName) {
return meta.any((m) =>
m
.computeConstantValue()
?.type
?.getDisplayString()
.toLowerCase()
.contains(typeName.toLowerCase()) ??
false);
return meta.any(
(m) =>
m
.computeConstantValue()
?.type
?.getDisplayString()
.toLowerCase()
.contains(typeName.toLowerCase()) ??
false,
);
}
/// Extracts the string value from a `@named('value')` annotation if present in [meta].

View File

@@ -11,7 +11,7 @@
// limitations under the License.
//
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/dart/element/nullability_suffix.dart';
import 'package:analyzer/dart/element/type.dart';
import 'exceptions.dart';
@@ -45,7 +45,7 @@ class TypeParser {
/// final parsed = TypeParser.parseType(field.type, field);
/// if (parsed.isNullable) print('Field is nullable');
/// ```
static ParsedType parseType(DartType dartType, Element context) {
static ParsedType parseType(DartType dartType, Element2 context) {
try {
return _parseTypeInternal(dartType, context);
} catch (e) {
@@ -61,7 +61,7 @@ class TypeParser {
}
}
static ParsedType _parseTypeInternal(DartType dartType, Element context) {
static ParsedType _parseTypeInternal(DartType dartType, Element2 context) {
final displayString = dartType.getDisplayString();
final isNullable = dartType.nullabilitySuffix == NullabilitySuffix.question;
@@ -87,7 +87,10 @@ class TypeParser {
}
static ParsedType _parseFutureType(
DartType dartType, Element context, bool isNullable) {
DartType dartType,
Element2 context,
bool isNullable,
) {
if (dartType is! ParameterizedType || dartType.typeArguments.isEmpty) {
throw TypeParsingException(
'Future type must have a type argument',
@@ -112,7 +115,10 @@ class TypeParser {
}
static ParsedType _parseGenericType(
ParameterizedType dartType, Element context, bool isNullable) {
ParameterizedType dartType,
Element2 context,
bool isNullable,
) {
final typeArguments = dartType.typeArguments
.map((arg) => _parseTypeInternal(arg, context))
.toList();
@@ -138,7 +144,7 @@ class TypeParser {
/// final parsed = TypeParser.parseType(field.type, field);
/// TypeParser.validateInjectableType(parsed, field);
/// ```
static void validateInjectableType(ParsedType parsedType, Element context) {
static void validateInjectableType(ParsedType parsedType, Element2 context) {
// Check for void type
if (parsedType.coreType == 'void') {
throw TypeParsingException(

View File

@@ -2,9 +2,9 @@ name: cherrypick_generator
description: |
Source code generator for the cherrypick dependency injection system. Processes annotations to generate binding and module code for Dart & Flutter projects.
version: 3.0.0-dev.0
homepage: https://cherrypick-di.dev/
documentation: https://cherrypick-di.dev/docs/intro
version: 3.0.2-dev.0
homepage: https://cherrypick-di.netlify.app
documentation: https://cherrypick-di.netlify.app/docs/intro
repository: https://github.com/pese-git/cherrypick/cherrypick_generator
issue_tracker: https://github.com/pese-git/cherrypick/issues
topics:
@@ -15,20 +15,20 @@ topics:
- inversion-of-control
environment:
sdk: ">=3.5.2 <4.0.0"
sdk: ">=3.8.0 <4.0.0"
# Add regular dependencies here.
dependencies:
cherrypick_annotations: ^3.0.0-dev.0
analyzer: ^7.0.0
cherrypick_annotations: ^3.0.2-dev.0
analyzer: ">=7.5.9 <8.0.0"
dart_style: ^3.0.0
build: ^2.4.1
source_gen: ^2.0.0
build: ^3.0.0
source_gen: ^3.1.0
collection: ^1.18.0
dev_dependencies:
lints: ^4.0.0
mockito: ^5.4.4
lints: ^6.0.0
mockito: ^5.4.5
test: ^1.25.8
build_test: ^2.1.7
build_runner: ^2.4.13
build_test: ^3.0.0
build_runner: ^2.5.0

View File

@@ -480,9 +480,10 @@ void notAClass() {}
);
});
test('should generate empty mixin for class without @inject fields',
() async {
const input = '''
test(
'should generate empty mixin for class without @inject fields',
() async {
const input = '''
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
part 'test_widget.inject.cherrypick.g.dart';
@@ -494,7 +495,7 @@ class TestWidget {
}
''';
const expectedOutput = '''
const expectedOutput = '''
// dart format width=80
// GENERATED CODE - DO NOT MODIFY BY HAND
@@ -509,8 +510,9 @@ mixin _\$TestWidget {
}
''';
await _testGeneration(input, expectedOutput);
});
await _testGeneration(input, expectedOutput);
},
);
});
group('Edge Cases', () {
@@ -593,12 +595,8 @@ mixin _\$TestWidget {
Future<void> _testGeneration(String input, String expectedOutput) async {
await testBuilder(
injectBuilder(BuilderOptions.empty),
{
'a|lib/test_widget.dart': input,
},
outputs: {
'a|lib/test_widget.inject.cherrypick.g.dart': expectedOutput,
},
reader: await PackageAssetReader.currentIsolate(),
{'a|lib/test_widget.dart': input},
outputs: {'a|lib/test_widget.inject.cherrypick.g.dart': expectedOutput},
readerWriter: TestReaderWriter(),
);
}

View File

@@ -590,9 +590,10 @@ void notAClass() {}
);
});
test('should throw error for method without @instance or @provide',
() async {
const input = '''
test(
'should throw error for method without @instance or @provide',
() async {
const input = '''
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
import 'package:cherrypick/cherrypick.dart';
@@ -604,11 +605,12 @@ abstract class TestModule extends Module {
}
''';
await expectLater(
() => _testGeneration(input, ''),
throwsA(isA<InvalidGenerationSourceError>()),
);
});
await expectLater(
() => _testGeneration(input, ''),
throwsA(isA<InvalidGenerationSourceError>()),
);
},
);
test('should throw error for @params with @instance', () async {
const input = '''
@@ -637,12 +639,8 @@ abstract class TestModule extends Module {
Future<void> _testGeneration(String input, String expectedOutput) async {
await testBuilder(
moduleBuilder(BuilderOptions.empty),
{
'a|lib/test_module.dart': input,
},
outputs: {
'a|lib/test_module.module.cherrypick.g.dart': expectedOutput,
},
reader: await PackageAssetReader.currentIsolate(),
{'a|lib/test_module.dart': input},
outputs: {'a|lib/test_module.module.cherrypick.g.dart': expectedOutput},
readerWriter: TestReaderWriter(),
);
}

View File

@@ -1,7 +1,6 @@
import 'package:analyzer/dart/element/element2.dart';
import 'package:test/test.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/source/source.dart';
import 'package:cherrypick_generator/src/type_parser.dart';
import 'package:cherrypick_generator/src/exceptions.dart';
@@ -42,7 +41,9 @@ void main() {
expect(
() => TypeParser.validateInjectableType(
parsedType, _createMockElement()),
parsedType,
_createMockElement(),
),
throwsA(isA<TypeParsingException>()),
);
});
@@ -59,7 +60,9 @@ void main() {
expect(
() => TypeParser.validateInjectableType(
parsedType, _createMockElement()),
parsedType,
_createMockElement(),
),
throwsA(isA<TypeParsingException>()),
);
});
@@ -76,7 +79,9 @@ void main() {
expect(
() => TypeParser.validateInjectableType(
parsedType, _createMockElement()),
parsedType,
_createMockElement(),
),
returnsNormally,
);
});
@@ -159,19 +164,21 @@ void main() {
expect(parsedType.resolveMethodName, equals('resolveAsync'));
});
test('should return correct resolveMethodName for nullable async types',
() {
final parsedType = ParsedType(
displayString: 'Future<String?>',
coreType: 'String',
isNullable: true,
isFuture: true,
isGeneric: false,
typeArguments: [],
);
test(
'should return correct resolveMethodName for nullable async types',
() {
final parsedType = ParsedType(
displayString: 'Future<String?>',
coreType: 'String',
isNullable: true,
isFuture: true,
isGeneric: false,
typeArguments: [],
);
expect(parsedType.resolveMethodName, equals('tryResolveAsync'));
});
expect(parsedType.resolveMethodName, equals('tryResolveAsync'));
},
);
test('should implement equality correctly', () {
final parsedType1 = ParsedType(
@@ -216,19 +223,19 @@ void main() {
}
// Mock element for testing
Element _createMockElement() {
Element2 _createMockElement() {
return _MockElement();
}
class _MockElement implements Element {
class _MockElement implements Element2 {
@override
String get displayName => 'MockElement';
@override
String get name => 'MockElement';
@override
Source? get source => null;
//@override
//String get name => 'MockElement';
//
//@override
//Source? get source => null;
@override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

View File

@@ -0,0 +1,178 @@
# Release - CherryPick 3.x
> **CherryPick** — a lightweight and modular DI framework for Dart and Flutter that solves dependency injection through strong typing, code generation, and dependency control.
Version **3.x** was recently released with significant improvements.
## Main Changes in 3.x
* **O(1) dependency resolution** — thanks to Map indexing of bindings, performance does not depend on the size of the scope in the DI graph. This provides noticeable speedup in large projects.
* **Protection against circular dependencies** — checking works both within a single scope and across the entire hierarchy. When a cycle is detected, an informative exception with the dependency chain is thrown.
* **Integration with Talker** — all DI events (registration, creation, deletion, errors) are logged and can be displayed in the console or UI.
* **Automatic resource cleanup** — objects implementing `Disposable` are properly released when the scope is closed.
* **Stabilized declarative approach support** — annotations and code generation now work more reliably and are more convenient for use in projects.
## Resource Cleanup Example
```dart
class MyServiceWithSocket implements Disposable {
@override
Future<void> dispose() async {
await socket.close();
print('Socket closed!');
}
}
class AppModule extends Module {
@override
void builder(Scope currentScope) {
// singleton Api
bind<MyServiceWithSocket>()
.toProvide(() => MyServiceWithSocket())
.singleton();
}
}
scope.installModules([AppModule()]);
await CherryPick.closeRootScope(); // will wait for async dispose to complete
```
## Circular Dependency Checking
One of the new features in CherryPick 3.x is built-in cycle protection.
This helps catch situations early where services start depending on each other recursively.
### How to Enable Checking
For checking within a single scope:
```dart
final scope = CherryPick.openRootScope();
scope.enableCycleDetection();
```
For global checking across the entire hierarchy:
```dart
CherryPick.enableGlobalCycleDetection();
CherryPick.enableGlobalCrossScopeCycleDetection();
final rootScope = CherryPick.openRootScope();
```
### How a Cycle Can Occur
Suppose we have two services that depend on each other:
```dart
class UserService {
final OrderService orderService;
UserService(this.orderService);
}
class OrderService {
final UserService userService;
OrderService(this.userService);
}
```
If we register them in the same scope:
```dart
class AppModule extends Module {
@override
void builder(Scope currentScope) {
bind<UserService>().toProvide(() => UserService(scope.resolve()));
bind<OrderService>().toProvide(() => OrderService(scope.resolve()));
}
}
final scope = CherryPick.openRootScope()
..enableCycleDetection()
..installModules([AppModule()]);
scope.resolve<UserService>();
```
Then when trying to resolve the dependency, an exception will be thrown:
```bash
❌ Circular dependency detected for UserService
Dependency chain: UserService -> OrderService -> UserService
```
This way, the error is detected immediately, not "somewhere in runtime".
## Integration with Talker
CherryPick 3.x allows logging all DI events through [Talker](https://pub.dev/packages/talker): registration, object creation, deletion, and errors. This is convenient for debugging and diagnosing the dependency graph.
Connection example:
```dart
final talker = Talker();
final observer = TalkerCherryPickObserver(talker);
CherryPick.setGlobalObserver(observer);
```
After this, DI events will be displayed in the console or UI:
```bash
┌───────────────────────────────────────────────────────────────
[info] 9:41:33 | [scope opened][CherryPick] scope_1757054493089_7072
└───────────────────────────────────────────────────────────────
┌───────────────────────────────────────────────────────────────
[verbose] 9:41:33 | [diagnostic][CherryPick] Scope created: scope_1757054493089_7072 {type: Scope, name: scope_1757054493089_7072, description: scope created}
└───────────────────────────────────────────────────────────────
```
In the log, you can see when scopes are created, which objects are registered and deleted, and catch errors and cycles in real time.
## Declarative Approach with Annotations
In addition to fully programmatic module descriptions, CherryPick supports **declarative DI style through annotations**.
This allows minimizing manual code and automatically generating modules and mixins for automatic dependency injection.
Example of a declarative module:
```dart
@module()
abstract class AppModule extends Module {
@provide()
@singleton()
Api api() => Api();
@provide()
Repo repo(Api api) => Repo(api);
}
````
After code generation, you can automatically inject dependencies into widgets or services:
```dart
@injectable()
class MyScreen extends StatelessWidget with _$MyScreen {
@inject()
late final Repo repo;
MyScreen() {
_inject(this);
}
}
```
This way you can choose an approach in development: **programmatic (imperative) with explicit dependency registration** or **declarative through annotations**.
## Who Might Find CherryPick Useful?
* Projects where it's important to guarantee **no cycles in the dependency graph**;
* Teams that want to **minimize manual DI code** and use a declarative style with annotations;
* Applications that require **automatic resource cleanup** (sockets, controllers, streams).
## Useful Links
* 📦 Package: [pub.dev/packages/cherrypick](https://pub.dev/packages/cherrypick)
* 💻 Code: [github.com/pese-git/cherrypick](https://github.com/pese-git/cherrypick)
* 📖 Documentation: [cherrypick-di.netlify.app](https://cherrypick-di.netlify.app/)

View File

@@ -0,0 +1,180 @@
# Release - CherryPick 3.x
> **CherryPick** — лёгкий и модульный DI-фреймворк для Dart и Flutter, который решает задачу через строгую типизацию, кодогенерацию и контроль за зависимостями.
Недавно вышла версия **3.x**, где появились заметные улучшения.
## Основные изменения в 3.x
* **O(1) разрешение зависимостей** — благодаря Map-индексации биндингов производительность не зависит от размера скоупа в DI графе. На больших проектах это даёт ощутимое ускорение.
* **Защита от циклических зависимостей** — проверка работает как внутри одного scope, так и во всей иерархии. При обнаружении цикла выбрасывается информативное исключение с цепочкой зависимостей.
* **Интеграция с Talker** — все события DI (регистрация, создание, удаление, ошибки) логируются и могут выводиться в консоль или UI.
* **Автоматическая очистка ресурсов** — объекты, реализующие `Disposable`, корректно освобождаются при закрытии scope.
* **Стабилизирована поддержка декларативного подхода** — аннотации и генерация кода теперь работают надёжнее и удобнее для использования в проектах.
## Пример с очисткой ресурсов
```dart
class MyServiceWithSocket implements Disposable {
@override
Future<void> dispose() async {
await socket.close();
print('Socket закрыт!');
}
}
class AppModule extends Module {
@override
void builder(Scope currentScope) {
// singleton Api
bind<MyServiceWithSocket>()
.toProvide(() => MyServiceWithSocket())
.singleton();
}
}
scope.installModules([AppModule()]);
await CherryPick.closeRootScope(); // дождётся завершения async dispose
```
## Проверка циклических зависимостей
Одна из новинок CherryPick 3.x — встроенная защита от циклов.
Это помогает на раннем этапе отлавливать ситуации, когда сервисы начинают зависеть друг от друга рекурсивно.
### Как включить проверку
Для проверки внутри одного scope:
```dart
final scope = CherryPick.openRootScope();
scope.enableCycleDetection();
```
Для глобальной проверки во всей иерархии:
```dart
CherryPick.enableGlobalCycleDetection();
CherryPick.enableGlobalCrossScopeCycleDetection();
final rootScope = CherryPick.openRootScope();
```
### Как может возникнуть цикл
Предположим, у нас есть два сервиса, которые зависят друг от друга:
```dart
class UserService {
final OrderService orderService;
UserService(this.orderService);
}
class OrderService {
final UserService userService;
OrderService(this.userService);
}
```
Если зарегистрировать их в одном scope:
```dart
class AppModule extends Module {
@override
void builder(Scope currentScope) {
bind<UserService>().toProvide(() => UserService(scope.resolve());
bind<OrderService>().toProvide(() => OrderService(scope.resolve()));
}
}
final scope = CherryPick.openRootScope()
..enableCycleDetection()
..installModules([AppModule()]);
scope.resolve<UserService>();
```
То при попытке разрешить зависимость будет выброшено исключение:
```bash
❌ Circular dependency detected for UserService
Dependency chain: UserService -> OrderService -> UserService
```
Таким образом, ошибка выявляется сразу, а не «где-то в runtime».
## Интеграция с Talker
CherryPick 3.x позволяет логировать все события DI через [Talker](https://pub.dev/packages/talker): регистрацию, создание объектов, удаление и ошибки. Это удобно для отладки и диагностики графа зависимостей.
Пример подключения:
```dart
final talker = Talker();
final observer = TalkerCherryPickObserver(talker);
CherryPick.setGlobalObserver(observer);
```
После этого в консоли или UI будут отображаться события DI:
```bash
┌───────────────────────────────────────────────────────────────
[info] 9:41:33 | [scope opened][CherryPick] scope_1757054493089_7072
└───────────────────────────────────────────────────────────────
┌───────────────────────────────────────────────────────────────
[verbose] 9:41:33 | [diagnostic][CherryPick] Scope created: scope_1757054493089_7072 {type: Scope, name: scope_1757054493089_7072, description: scope created}
└───────────────────────────────────────────────────────────────
```
В логе можно увидеть, когда scope создаётся, какие объекты регистрируются и удаляются, а также отлавливать ошибки и циклы в реальном времени.
## Декларативный подход с аннотациями
Помимо полностью программного описания модулей, CherryPick поддерживает **декларативный стиль DI через аннотации**.
Это позволяет минимизировать ручной код и автоматически генерировать модули и mixin для автоподстановки зависимостей.
Пример декларативного модуля:
```dart
@module()
abstract class AppModule extends Module {
@provide()
@singleton()
Api api() => Api();
@provide()
Repo repo(Api api) => Repo(api);
}
````
После генерации кода можно автоматически подтягивать зависимости в виджеты или сервисы:
```dart
@injectable()
class MyScreen extends StatelessWidget with _$MyScreen {
@inject()
late final Repo repo;
MyScreen() {
_inject(this);
}
}
```
Таким образом можно выбрать подход в разработке: **программный (императивный) с явной регистрацией зависимостей** или **декларативный через аннотации**.
## Кому может быть полезен CherryPick?
* проектам, где важно гарантировать **отсутствие циклов в графе зависимостей**;
* командам, которые хотят **минимизировать ручной DI-код** и использовать декларативный стиль с аннотациями;
* приложениям, где требуется **автоматическое освобождение ресурсов** (сокеты, контроллеры, потоки).
## Полезные ссылки
* 📦 Пакет: [pub.dev/packages/cherrypick](https://pub.dev/packages/cherrypick)
* 💻 Код: [github.com/pese-git/cherrypick](https://github.com/pese-git/cherrypick)
* 📖 Документация: [cherrypick-di.netlify.app](https://cherrypick-di.netlify.app/)

244
doc/presentation_ru.md Normal file
View File

@@ -0,0 +1,244 @@
---
marp: true
---
<!--
#backgroundImage: url('./doc/assets/image.png')
backgroundSize: cover
-->
# CherryPick 3.x
### Быстро. Безопасно. Просто.
Современный DI-framework для Dart и Flutter
Автор: Сергей Пеньковский
---
<!--
backgroundImage: none
-->
## Что такое CherryPick?
- Лёгкий и модульный framework для внедрения зависимостей (DI)
- Фокус: производительность, безопасность и лаконичный код
- Применяется во frontend, backend, CLI
---
## Эволюция: что нового в 3.x?
- Оптимизация скорости разрешения зависимостей
- Интеграция с Talker для наглядного логирования DI-событий
- Защита от циклических зависимостей на уровне ядра
- Полностью декларативное описание DI через аннотации и генерацию кода
- Автоматическая очистка ресурсов
---
## Быстро
* Мгновенное разрешение зависимостей
---
### Мгновенное разрешение зависимостей
- Операция resolve<T> теперь выполняется за O(1)
- Используется Map-индексация всех биндингов в каждом скоупе (в среднем ускорение в 10x+ на крупных графах)
- Производительность не зависит от размера приложения
---
## Безопасно
* Циклические зависимости больше не страшны
* Интеграция с Talker и расширенное логирование
---
### Циклические зависимости больше не страшны
- CherryPick 3.x автоматически выявляет циклы при разрешении зависимостей.
- Возможна проверка как внутри отдельного scope, так и во всём DI-графе (глобально).
---
#### Как включить проверку циклов
- Для защиты только внутри одного scope:
```dart
// 1. Для текущего scope (локальная проверка)
final scope = CherryPick.openRootScope();
scope.enableCycleDetection();
```
- Для защиты всей иерархии скоупов:
```dart
// 2. Для всей иерархии скоупов (глобальная проверка)
CherryPick.enableGlobalCycleDetection();
CherryPick.enableGlobalCrossScopeCycleDetection();
final rootScope = CherryPick.openRootScope();
```
---
#### Пример обработки ошибки
При обнаружении цикла будет выброшено исключение с подробной трассировкой:
```dart
try {
scope.resolve<A>();
} on CircularDependencyException catch(e) {
print(e.dependencyChain);
}
```
```bash
=== Circular Dependency Detection Example ===
1. Attempt to create a scope with circular dependencies:
❌ Circular dependency detected: CircularDependencyException: Circular dependency detected for UserService
Dependency chain: UserService -> OrderService -> UserService
```
---
### Интеграция с Talker и расширенное логирование
- Всё, что происходит в DI: регистрация, создание, удаление, ошибки ― теперь логируется!
- Достаточно подключить observer:
```dart
final talker = Talker();
final talkerLogger = TalkerCherryPickObserver(talker);
CherryPick.setGlobalObserver(talkerLogger);
```
- Логи сразу видны в консоли, UI
```bash
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────
[info] | 9:41:33 89ms | [scope opened][CherryPick] scope_1757054493089_7072
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────
[verbose] | 9:41:33 90ms | [diagnostic][CherryPick] Scope created: scope_1757054493089_7072 {type: Scope, name: scope_1757054493089_7072, description: scope created}
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────
```
---
## Просто
* Декларативный DI
* Автоматическая очистка ресурсов
---
### Декларативный DI: аннотации и генерация кода
- Описывайте зависимости с помощью аннотаций
- Автоматически генерируется модуль DI и mixin для автоподстановки зависимостей
```dart
@module()
abstract class AppModule extends Module {
@provide()
@singleton()
Api api() => Api();
@provide()
Repo repo(Api api) => Repo(api);
}
```
Регистрация модуля
```dart
final scope = openRootScope()
..installModules([$AppModule()]);
```
---
### Field injection: минимум кода — максимум удобства
```dart
@injectable()
class MyScreen extends StatelessWidget with _$MyScreen {
@inject()
late final Repo repo;
MyScreen() {
_inject(this);
}
}
```
- После генерации mixin и вызова `screen._inject()` — зависимости готовы
- Сильная типизация, никаких ручных вызовов resolve
---
## Автоматическая очистка ресурсов
Автоматическая очистка ресурсов (контроллеры, потоки, сокеты, файлы и др.).
Если вы регистрируете объект, реализующий Disposable, через DI-контейнер, CherryPick вызовет его метод dispose() при закрытии скоупа.
```dart
class MyServiceWithSocket implements Disposable {
@override
Future<void> dispose() async {
await socket.close();
print('Socket закрыт!');
}
}
scope.installModules([
Module((bind) => bind<MyServiceWithSocket>().toProvide(() => MyServiceWithSocket()).singleton()),
]);
await CherryPick.closeRootScope(); // дождётся завершения async очистки
```
---
## Почему это удобно?
### Сравнение с ручным DI
|| Аннотации | Ручной DI |
|:---|:-----------|:------------|
|Гибко|✅|✅|
|Кратко|✅|❌|
|Безопасно|✅|❌ (легко ошибиться)|
---
## CherryPick 3.x: ваш DI-фреймворк
- Быстрое разрешение зависимостей
- Гарантия безопасности и тестируемости
- Интеграция с логированием
- Максимально простой и декларативный код
---
<!--
#backgroundImage: url('./doc/assets/image.png')
backgroundSize: cover
-->
## Спасибо за внимание
---
## Вопросы?
- Try CherryPick - [https://pub.dev/packages/cherrypick](https://pub.dev/packages/cherrypick)
- Contributing — [https://github.com/pese-git/cherrypick](https://github.com/pese-git/cherrypick)
- Документация и примеры — [https://cherrypick-di.netlify.app](https://cherrypick-di.netlify.app/)
- Готов помочь — пишите, пробуйте, внедряйте!

View File

@@ -9,11 +9,7 @@ void main() {
// Создаем модуль, который будет предоставлять UseCase
]);
runApp(
const CherryPickProvider(
child: MyApp(),
),
);
runApp(const CherryPickProvider(child: MyApp()));
}
class MyApp extends StatelessWidget {
@@ -21,10 +17,6 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CherryPickProvider(
child: MaterialApp(
home: MyHomePage(),
),
);
return CherryPickProvider(child: MaterialApp(home: MyHomePage()));
}
}

View File

@@ -11,12 +11,8 @@ class MyHomePage extends StatelessWidget {
Widget build(BuildContext context) {
//_inject(context); // Make sure this function is called in context
return Scaffold(
appBar: AppBar(
title: const Text('Example App'),
),
body: Center(
child: Text(useCase.fetchData()),
),
appBar: AppBar(title: const Text('Example App')),
body: Center(child: Text(useCase.fetchData())),
);
}
}

View File

@@ -5,18 +5,18 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: e55636ed79578b9abca5fecf9437947798f5ef7456308b5cb85720b793eac92f
sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f
url: "https://pub.dev"
source: hosted
version: "82.0.0"
version: "85.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "904ae5bb474d32c38fb9482e2d925d5454cda04ddd0e55d2e6826bc72f6ba8c0"
sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d"
url: "https://pub.dev"
source: hosted
version: "7.4.5"
version: "7.7.1"
args:
dependency: transitive
description:
@@ -29,10 +29,10 @@ packages:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.dev"
source: hosted
version: "2.12.0"
version: "2.13.0"
boolean_selector:
dependency: transitive
description:
@@ -45,50 +45,50 @@ packages:
dependency: transitive
description:
name: build
sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
sha256: ce76b1d48875e3233fde17717c23d1f60a91cc631597e49a400c89b475395b1d
url: "https://pub.dev"
source: hosted
version: "2.4.2"
version: "3.1.0"
build_config:
dependency: transitive
description:
name: build_config
sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1
sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.2.0"
build_daemon:
dependency: transitive
description:
name: build_daemon
sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9"
sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.4"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0
sha256: d1d57f7807debd7349b4726a19fd32ec8bc177c71ad0febf91a20f84cd2d4b46
url: "https://pub.dev"
source: hosted
version: "2.4.4"
version: "3.0.3"
build_runner:
dependency: "direct dev"
description:
name: build_runner
sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99"
sha256: b24597fceb695969d47025c958f3837f9f0122e237c6a22cb082a5ac66c3ca30
url: "https://pub.dev"
source: hosted
version: "2.4.15"
version: "2.7.1"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
sha256: "066dda7f73d8eb48ba630a55acb50c4a84a2e6b453b1cb4567f581729e794f7b"
url: "https://pub.dev"
source: hosted
version: "8.0.0"
version: "9.3.1"
built_collection:
dependency: transitive
description:
@@ -101,10 +101,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4
sha256: a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d
url: "https://pub.dev"
source: hosted
version: "8.9.5"
version: "8.12.0"
characters:
dependency: transitive
description:
@@ -117,38 +117,38 @@ packages:
dependency: transitive
description:
name: checked_yaml
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f"
url: "https://pub.dev"
source: hosted
version: "2.0.3"
version: "2.0.4"
cherrypick:
dependency: "direct main"
description:
path: "../../cherrypick"
relative: true
source: path
version: "3.0.0-dev.12"
version: "3.0.1"
cherrypick_annotations:
dependency: "direct main"
description:
path: "../../cherrypick_annotations"
relative: true
source: path
version: "1.1.2-dev.2"
version: "3.0.1"
cherrypick_flutter:
dependency: "direct main"
description:
path: "../../cherrypick_flutter"
relative: true
source: path
version: "1.1.3-dev.12"
version: "3.0.1"
cherrypick_generator:
dependency: "direct dev"
description:
path: "../../cherrypick_generator"
relative: true
source: path
version: "2.0.0-dev.2"
version: "3.0.1"
clock:
dependency: transitive
description:
@@ -201,18 +201,18 @@ packages:
dependency: transitive
description:
name: dart_style
sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac"
sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.1.1"
fake_async:
dependency: transitive
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.3"
file:
dependency: transitive
description:
@@ -238,10 +238,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
url: "https://pub.dev"
source: hosted
version: "5.0.0"
version: "6.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -271,14 +271,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.2"
http:
dependency: transitive
description:
name: http
sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
http_multi_server:
dependency: transitive
description:
@@ -291,10 +283,10 @@ packages:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.1.2"
io:
dependency: transitive
description:
@@ -303,14 +295,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.5"
js:
dependency: transitive
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.dev"
source: hosted
version: "0.7.1"
json_annotation:
dependency: transitive
description:
@@ -323,10 +307,10 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
url: "https://pub.dev"
source: hosted
version: "10.0.8"
version: "10.0.9"
leak_tracker_flutter_testing:
dependency: transitive
description:
@@ -347,10 +331,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
url: "https://pub.dev"
source: hosted
version: "5.0.0"
version: "6.0.0"
logging:
dependency: transitive
description:
@@ -427,26 +411,26 @@ packages:
dependency: transitive
description:
name: pubspec_parse
sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0"
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.5.0"
shelf:
dependency: transitive
description:
name: shelf
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
url: "https://pub.dev"
source: hosted
version: "1.4.1"
version: "1.4.2"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67
sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.0"
sky_engine:
dependency: transitive
description: flutter
@@ -456,10 +440,10 @@ packages:
dependency: transitive
description:
name: source_gen
sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b"
sha256: "7b19d6ba131c6eb98bfcbf8d56c1a7002eba438af2e7ae6f8398b2b0f4f381e3"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "3.1.0"
source_span:
dependency: transitive
description:
@@ -544,18 +528,18 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
source: hosted
version: "14.3.1"
version: "15.0.0"
watcher:
dependency: transitive
description:
name: watcher
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
sha256: "5bf046f41320ac97a469d506261797f35254fa61c641741ef32dacda98b7d39c"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.3"
web:
dependency: transitive
description:
@@ -589,5 +573,5 @@ packages:
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.7.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
dart: ">=3.8.0 <4.0.0"
flutter: ">=3.32.0"

View File

@@ -5,7 +5,7 @@ publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=3.5.2 <4.0.0"
sdk: ">=3.8.0 <4.0.0"
dependencies:
@@ -25,11 +25,11 @@ dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
flutter_lints: ^6.0.0
cherrypick_generator:
path: ../../cherrypick_generator
build_runner: ^2.4.15
build_runner: ^2.5.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

View File

@@ -4,7 +4,7 @@ part 'post_model.freezed.dart';
part 'post_model.g.dart';
@freezed
class PostModel with _$PostModel {
abstract class PostModel with _$PostModel {
const factory PostModel({
required int id,
required String title,

View File

@@ -12,9 +12,9 @@ class PostRepositoryImpl implements PostRepository {
Future<Either<Exception, List<Post>>> getPosts() async {
try {
final posts = await api.getPosts();
return Right(posts
.map((e) => Post(id: e.id, title: e.title, body: e.body))
.toList());
return Right(
posts.map((e) => Post(id: e.id, title: e.title, body: e.body)).toList(),
);
} catch (e) {
return Left(Exception(e.toString()));
}

View File

@@ -15,16 +15,17 @@ abstract class AppModule extends Module {
@provide()
@singleton()
TalkerDioLoggerSettings talkerDioLoggerSettings() => TalkerDioLoggerSettings(
printRequestHeaders: true,
printResponseHeaders: true,
printResponseMessage: true,
);
printRequestHeaders: true,
printResponseHeaders: true,
printResponseMessage: true,
);
@provide()
@singleton()
TalkerDioLogger talkerDioLogger(
Talker talker, TalkerDioLoggerSettings settings) =>
TalkerDioLogger(talker: talker, settings: settings);
Talker talker,
TalkerDioLoggerSettings settings,
) => TalkerDioLogger(talker: talker, settings: settings);
@instance()
int timeout() => 1000;
@@ -75,12 +76,14 @@ abstract class AppModule extends Module {
@provide()
@named('TestProvideWithParams1')
String testProvideWithParams1(
@named('baseUrl') String baseUrl, @params() dynamic params) =>
"hello $params";
@named('baseUrl') String baseUrl,
@params() dynamic params,
) => "hello $params";
@provide()
@named('TestProvideAsyncWithParams1')
Future<String> testProvideAsyncWithParams1(
@named('baseUrl') String baseUrl, @params() dynamic params) async =>
"hello $params";
@named('baseUrl') String baseUrl,
@params() dynamic params,
) async => "hello $params";
}

View File

@@ -3,7 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'post.freezed.dart';
@freezed
class Post with _$Post {
abstract class Post with _$Post {
const factory Post({
required int id,
required String title,

View File

@@ -23,10 +23,10 @@ void main() {
}
// Используем safe root scope для гарантии защиты
CherryPick.openRootScope()
.installModules([CoreModule(talker: talker), $AppModule()]);
CherryPick.openRootScope().installModules([
CoreModule(talker: talker),
$AppModule(),
]);
runApp(MyApp(
talker: talker,
));
runApp(MyApp(talker: talker));
}

View File

@@ -12,10 +12,7 @@ class PostDetailsPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Post #${post.id}')),
body: Padding(
padding: const EdgeInsets.all(16),
child: Text(post.body),
),
body: Padding(padding: const EdgeInsets.all(16), child: Text(post.body)),
);
}
}

View File

@@ -38,8 +38,9 @@ class PostsPage extends StatelessWidget {
title: Text(posts[i].title),
subtitle: Text(posts[i].body),
onTap: () {
AutoRouter.of(context)
.push(PostDetailsRoute(post: posts[i]));
AutoRouter.of(
context,
).push(PostDetailsRoute(post: posts[i]));
},
),
),

View File

@@ -5,8 +5,8 @@ import 'app_router.gr.dart';
class AppRouter extends RootStackRouter {
@override
List<AutoRoute> get routes => [
AutoRoute(page: PostsRoute.page, initial: true),
AutoRoute(page: PostDetailsRoute.page),
AutoRoute(page: LogsRoute.page),
];
AutoRoute(page: PostsRoute.page, initial: true),
AutoRoute(page: PostDetailsRoute.page),
AutoRoute(page: LogsRoute.page),
];
}

View File

@@ -5,18 +5,18 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: e55636ed79578b9abca5fecf9437947798f5ef7456308b5cb85720b793eac92f
sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f
url: "https://pub.dev"
source: hosted
version: "82.0.0"
version: "85.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "904ae5bb474d32c38fb9482e2d925d5454cda04ddd0e55d2e6826bc72f6ba8c0"
sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d"
url: "https://pub.dev"
source: hosted
version: "7.4.5"
version: "7.7.1"
ansi_styles:
dependency: transitive
description:
@@ -45,26 +45,26 @@ packages:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.dev"
source: hosted
version: "2.12.0"
version: "2.13.0"
auto_route:
dependency: "direct main"
description:
name: auto_route
sha256: "1d1bd908a1fec327719326d5d0791edd37f16caff6493c01003689fb03315ad7"
sha256: c820e918863a03544aac68eaf61e17c8a6126b663d7cad24a8fd3657a1e6be61
url: "https://pub.dev"
source: hosted
version: "9.3.0+1"
version: "10.1.2"
auto_route_generator:
dependency: "direct main"
dependency: "direct dev"
description:
name: auto_route_generator
sha256: c2e359d8932986d4d1bcad7a428143f81384ce10fef8d4aa5bc29e1f83766a46
sha256: ed4b65e85b4b2b00b06ef1e44c8623985c52c32d05d72147e3201257aa70a115
url: "https://pub.dev"
source: hosted
version: "9.3.1"
version: "10.2.4"
bloc:
dependency: transitive
description:
@@ -85,50 +85,50 @@ packages:
dependency: transitive
description:
name: build
sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
sha256: ce76b1d48875e3233fde17717c23d1f60a91cc631597e49a400c89b475395b1d
url: "https://pub.dev"
source: hosted
version: "2.4.2"
version: "3.1.0"
build_config:
dependency: transitive
description:
name: build_config
sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1
sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.2.0"
build_daemon:
dependency: transitive
description:
name: build_daemon
sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9"
sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.4"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0
sha256: d1d57f7807debd7349b4726a19fd32ec8bc177c71ad0febf91a20f84cd2d4b46
url: "https://pub.dev"
source: hosted
version: "2.4.4"
version: "3.0.3"
build_runner:
dependency: "direct main"
dependency: "direct dev"
description:
name: build_runner
sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99"
sha256: b24597fceb695969d47025c958f3837f9f0122e237c6a22cb082a5ac66c3ca30
url: "https://pub.dev"
source: hosted
version: "2.4.15"
version: "2.7.1"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
sha256: "066dda7f73d8eb48ba630a55acb50c4a84a2e6b453b1cb4567f581729e794f7b"
url: "https://pub.dev"
source: hosted
version: "8.0.0"
version: "9.3.1"
built_collection:
dependency: transitive
description:
@@ -141,10 +141,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4
sha256: a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d
url: "https://pub.dev"
source: hosted
version: "8.9.5"
version: "8.12.0"
characters:
dependency: transitive
description:
@@ -165,39 +165,47 @@ packages:
dependency: transitive
description:
name: checked_yaml
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f"
url: "https://pub.dev"
source: hosted
version: "2.0.3"
version: "2.0.4"
cherrypick:
dependency: "direct main"
description:
path: "../../cherrypick"
relative: true
source: path
version: "3.0.0-dev.12"
version: "3.0.1"
cherrypick_annotations:
dependency: "direct main"
description:
path: "../../cherrypick_annotations"
relative: true
source: path
version: "1.1.2-dev.2"
version: "3.0.1"
cherrypick_generator:
dependency: "direct main"
dependency: "direct dev"
description:
path: "../../cherrypick_generator"
relative: true
source: path
version: "2.0.0-dev.2"
version: "3.0.0"
cli_config:
dependency: transitive
description:
name: cli_config
sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec
url: "https://pub.dev"
source: hosted
version: "0.2.0"
cli_launcher:
dependency: transitive
description:
name: cli_launcher
sha256: "67d89e0a1c07b103d1253f6b953a43d3f502ee36805c8cfc21196282c9ddf177"
sha256: "17d2744fb9a254c49ec8eda582536abe714ea0131533e24389843a4256f82eac"
url: "https://pub.dev"
source: hosted
version: "0.3.2"
version: "0.3.2+1"
cli_util:
dependency: transitive
description:
@@ -234,10 +242,10 @@ packages:
dependency: transitive
description:
name: conventional_commit
sha256: fad254feb6fb8eace2be18855176b0a4b97e0d50e416ff0fe590d5ba83735d34
sha256: c40b1b449ce2a63fa2ce852f35e3890b1e182f5951819934c0e4a66254bc0dc3
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.6.1+1"
convert:
dependency: transitive
description:
@@ -246,6 +254,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.2"
coverage:
dependency: transitive
description:
name: coverage
sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
cross_file:
dependency: transitive
description:
@@ -274,10 +290,10 @@ packages:
dependency: transitive
description:
name: dart_style
sha256: "5b236382b47ee411741447c1f1e111459c941ea1b3f2b540dde54c210a3662af"
sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
version: "3.1.1"
dartz:
dependency: "direct main"
description:
@@ -290,10 +306,10 @@ packages:
dependency: "direct main"
description:
name: dio
sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9"
sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9
url: "https://pub.dev"
source: hosted
version: "5.8.0+1"
version: "5.9.0"
dio_web_adapter:
dependency: transitive
description:
@@ -306,10 +322,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.3"
ffi:
dependency: transitive
description:
@@ -348,15 +364,15 @@ packages:
source: hosted
version: "9.1.1"
flutter_lints:
dependency: "direct main"
dependency: "direct dev"
description:
name: flutter_lints
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
url: "https://pub.dev"
source: hosted
version: "5.0.0"
version: "6.0.0"
flutter_test:
dependency: "direct main"
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
@@ -366,21 +382,21 @@ packages:
source: sdk
version: "0.0.0"
freezed:
dependency: "direct main"
dependency: "direct dev"
description:
name: freezed
sha256: "59a584c24b3acdc5250bb856d0d3e9c0b798ed14a4af1ddb7dc1c7b41df91c9c"
sha256: da32f8ba8cfcd4ec71d9decc8cbf28bd2c31b5283d9887eb51eb4a0659d8110c
url: "https://pub.dev"
source: hosted
version: "2.5.8"
version: "3.2.0"
freezed_annotation:
dependency: "direct main"
description:
name: freezed_annotation
sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2
sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8"
url: "https://pub.dev"
source: hosted
version: "2.4.4"
version: "3.1.0"
frontend_server_client:
dependency: transitive
description:
@@ -413,14 +429,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.3.4"
hotreloader:
dependency: transitive
description:
name: hotreloader
sha256: bc167a1163807b03bada490bfe2df25b0d744df359227880220a5cbd04e5734b
url: "https://pub.dev"
source: hosted
version: "4.3.0"
http:
dependency: transitive
description:
name: http
sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b"
sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.5.0"
http_multi_server:
dependency: transitive
description:
@@ -433,18 +457,10 @@ packages:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
intl:
dependency: transitive
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.19.0"
version: "4.1.2"
io:
dependency: transitive
description:
@@ -457,12 +473,12 @@ packages:
dependency: transitive
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
url: "https://pub.dev"
source: hosted
version: "0.7.1"
version: "0.7.2"
json_annotation:
dependency: transitive
dependency: "direct main"
description:
name: json_annotation
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
@@ -470,21 +486,21 @@ packages:
source: hosted
version: "4.9.0"
json_serializable:
dependency: "direct main"
dependency: "direct dev"
description:
name: json_serializable
sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c
sha256: "33a040668b31b320aafa4822b7b1e177e163fc3c1e835c6750319d4ab23aa6fe"
url: "https://pub.dev"
source: hosted
version: "6.9.5"
version: "6.11.1"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
url: "https://pub.dev"
source: hosted
version: "10.0.8"
version: "10.0.9"
leak_tracker_flutter_testing:
dependency: transitive
description:
@@ -501,14 +517,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lean_builder:
dependency: transitive
description:
name: lean_builder
sha256: "3d3a04c9dda8ced6b2a48d23aaf98ef5aa32f68f9c62da1b6c6d45bf03aa8164"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
lints:
dependency: transitive
description:
name: lints
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
url: "https://pub.dev"
source: hosted
version: "5.0.0"
version: "6.0.0"
logging:
dependency: transitive
description:
@@ -537,10 +561,10 @@ packages:
dependency: "direct dev"
description:
name: melos
sha256: "3f3ab3f902843d1e5a1b1a4dd39a4aca8ba1056f2d32fd8995210fa2843f646f"
sha256: "4280dc46bd5b741887cce1e67e5c1a6aaf3c22310035cf5bd33dceeeda62ed22"
url: "https://pub.dev"
source: hosted
version: "6.3.2"
version: "6.3.3"
meta:
dependency: transitive
description:
@@ -573,6 +597,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
node_preamble:
dependency: transitive
description:
name: node_preamble
sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
package_config:
dependency: transitive
description:
@@ -601,18 +633,18 @@ packages:
dependency: transitive
description:
name: path_provider_android
sha256: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9
sha256: "993381400e94d18469750e5b9dcb8206f15bc09f9da86b9e44a9b0092a0066db"
url: "https://pub.dev"
source: hosted
version: "2.2.17"
version: "2.2.18"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"
sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd"
url: "https://pub.dev"
source: hosted
version: "2.4.1"
version: "2.4.2"
path_provider_linux:
dependency: transitive
description:
@@ -637,14 +669,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.0"
petitparser:
dependency: transitive
description:
name: petitparser
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
url: "https://pub.dev"
source: hosted
version: "6.0.2"
platform:
dependency: transitive
description:
@@ -689,18 +713,18 @@ packages:
dependency: transitive
description:
name: protobuf
sha256: "579fe5557eae58e3adca2e999e38f02441d8aa908703854a9e0a0f47fa857731"
sha256: de9c9eb2c33f8e933a42932fe1dc504800ca45ebc3d673e6ed7f39754ee4053e
url: "https://pub.dev"
source: hosted
version: "4.1.0"
version: "4.2.0"
provider:
dependency: transitive
description:
name: provider
sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84"
sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272"
url: "https://pub.dev"
source: hosted
version: "6.1.5"
version: "6.1.5+1"
pub_semver:
dependency: transitive
description:
@@ -713,66 +737,82 @@ packages:
dependency: transitive
description:
name: pub_updater
sha256: "54e8dc865349059ebe7f163d6acce7c89eb958b8047e6d6e80ce93b13d7c9e60"
sha256: "739a0161d73a6974c0675b864fb0cf5147305f7b077b7f03a58fa7a9ab3e7e7d"
url: "https://pub.dev"
source: hosted
version: "0.4.0"
version: "0.5.0"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0"
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.5.0"
retrofit:
dependency: "direct main"
description:
name: retrofit
sha256: c6cc9ad3374e6d07008343140a67afffaaa34cdf6bf08d4847d91417a99dcf45
sha256: "699cf44ec6c7fc7d248740932eca75d334e36bdafe0a8b3e9ff93100591c8a25"
url: "https://pub.dev"
source: hosted
version: "4.4.2"
version: "4.7.2"
retrofit_generator:
dependency: "direct main"
dependency: "direct dev"
description:
name: retrofit_generator
sha256: "65d28d3a7b4db485f1c73fee8ee32f552ef23ee4ecb68ba491f39d80b73bdcbf"
sha256: "4a2ac0364eb7d5975f71450dfd553b1591ecffad96438a01ce88494a266bceb4"
url: "https://pub.dev"
source: hosted
version: "9.2.0"
version: "10.0.5"
share_plus:
dependency: transitive
description:
name: share_plus
sha256: b2961506569e28948d75ec346c28775bb111986bb69dc6a20754a457e3d97fa0
sha256: d7dc0630a923883c6328ca31b89aa682bacbf2f8304162d29f7c6aaff03a27a1
url: "https://pub.dev"
source: hosted
version: "11.0.0"
version: "11.1.0"
share_plus_platform_interface:
dependency: transitive
description:
name: share_plus_platform_interface
sha256: "1032d392bc5d2095a77447a805aa3f804d2ae6a4d5eef5e6ebb3bd94c1bc19ef"
sha256: "88023e53a13429bd65d8e85e11a9b484f49d4c190abbd96c7932b74d6927cc9a"
url: "https://pub.dev"
source: hosted
version: "6.0.0"
version: "6.1.0"
shelf:
dependency: transitive
description:
name: shelf
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
url: "https://pub.dev"
source: hosted
version: "1.4.1"
version: "1.4.2"
shelf_packages_handler:
dependency: transitive
description:
name: shelf_packages_handler
sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
shelf_static:
dependency: transitive
description:
name: shelf_static
sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3
url: "https://pub.dev"
source: hosted
version: "1.1.3"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67
sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.0"
sky_engine:
dependency: transitive
description: flutter
@@ -782,18 +822,34 @@ packages:
dependency: transitive
description:
name: source_gen
sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b"
sha256: "7b19d6ba131c6eb98bfcbf8d56c1a7002eba438af2e7ae6f8398b2b0f4f381e3"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "3.1.0"
source_helper:
dependency: transitive
description:
name: source_helper
sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c"
sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723"
url: "https://pub.dev"
source: hosted
version: "1.3.5"
version: "1.3.8"
source_map_stack_trace:
dependency: transitive
description:
name: source_map_stack_trace
sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
url: "https://pub.dev"
source: hosted
version: "2.1.2"
source_maps:
dependency: transitive
description:
name: source_maps
sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812"
url: "https://pub.dev"
source: hosted
version: "0.10.13"
source_span:
dependency: transitive
description:
@@ -846,49 +902,49 @@ packages:
dependency: transitive
description:
name: talker
sha256: "028a753874d98df39f210cb74f0ee09a0a95e28f8bc2dc975c3c328e24fde23d"
sha256: "2d742b54e5cda58b7d386cd2d95088c3429ef273b2a0869dec552fe02601367a"
url: "https://pub.dev"
source: hosted
version: "4.9.3"
version: "5.0.0"
talker_bloc_logger:
dependency: "direct main"
description:
name: talker_bloc_logger
sha256: cf1e3b1d70f9a47e061288f0d230ba0e04a0f6394629d5df1c7b0933b236e397
sha256: "7752ca8a0b2eba487c8c189ca2390ebfcdaa4f7b10eda27587e5067e4427e7cd"
url: "https://pub.dev"
source: hosted
version: "4.9.3"
version: "5.0.0"
talker_cherrypick_logger:
dependency: "direct main"
description:
path: "../../talker_cherrypick_logger"
relative: true
source: path
version: "1.1.0-dev.7"
version: "3.0.1"
talker_dio_logger:
dependency: "direct main"
description:
name: talker_dio_logger
sha256: dcf784f1841e248c270ef741f8a07ca9cf562c6424ee43fc6e598c4eb7f18238
sha256: "20cc3bc9820fa73040f23e27d5d86462e590ddf02c43d0a801c56bf5ecc68922"
url: "https://pub.dev"
source: hosted
version: "4.9.3"
version: "5.0.0"
talker_flutter:
dependency: "direct main"
description:
name: talker_flutter
sha256: "2cfee6661277d415a895b6258ecb0bf80d7b564e91ea7e769fc6d0f970a01c09"
sha256: d249fa16936a08fe5c4fb9e2b9b122fdcbaef6be9c4dcf61e448d0b76f3179f1
url: "https://pub.dev"
source: hosted
version: "4.9.3"
version: "5.0.0"
talker_logger:
dependency: transitive
description:
name: talker_logger
sha256: "778ec673f1b71a6516e5576ae8d90ea23bbbcf9f405a97cc30e8ccdc33e26d27"
sha256: "4f06d46db664c11cf4d629378da661f2c75aee629e3ef898dbc3cf44a0c41cd7"
url: "https://pub.dev"
source: hosted
version: "4.9.3"
version: "5.0.0"
term_glyph:
dependency: transitive
description:
@@ -897,6 +953,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.2"
test:
dependency: transitive
description:
name: test
sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e"
url: "https://pub.dev"
source: hosted
version: "1.25.15"
test_api:
dependency: transitive
description:
@@ -905,6 +969,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.4"
test_core:
dependency: transitive
description:
name: test_core
sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa"
url: "https://pub.dev"
source: hosted
version: "0.6.8"
timing:
dependency: transitive
description:
@@ -973,18 +1045,18 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
source: hosted
version: "14.3.1"
version: "15.0.0"
watcher:
dependency: transitive
description:
name: watcher
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
sha256: "5bf046f41320ac97a469d506261797f35254fa61c641741ef32dacda98b7d39c"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.3"
web:
dependency: transitive
description:
@@ -1009,14 +1081,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
win32:
dependency: transitive
description:
name: win32
sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba"
sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03"
url: "https://pub.dev"
source: hosted
version: "5.13.0"
version: "5.14.0"
xdg_directories:
dependency: transitive
description:
@@ -1025,14 +1105,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
xml:
xxh3:
dependency: transitive
description:
name: xml
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
name: xxh3
sha256: "399a0438f5d426785723c99da6b16e136f4953fb1e9db0bf270bd41dd4619916"
url: "https://pub.dev"
source: hosted
version: "6.5.0"
version: "1.2.0"
yaml:
dependency: transitive
description:
@@ -1050,5 +1130,5 @@ packages:
source: hosted
version: "2.2.2"
sdks:
dart: ">=3.7.0 <4.0.0"
flutter: ">=3.27.0"
dart: ">=3.8.0 <4.0.0"
flutter: ">=3.32.0"

View File

@@ -5,49 +5,47 @@ publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ^3.5.2
sdk: ">=3.8.0 <4.0.0"
dependencies:
flutter:
sdk: flutter
cherrypick:
path: ../../cherrypick
cherrypick_annotations:
path: ../../cherrypick_annotations
cherrypick: any
cherrypick_annotations: ^3.0.2-dev.0
dio: ^5.4.0
retrofit: ^4.0.3
freezed_annotation: ^2.4.4
freezed_annotation: ^3.0.0
json_annotation: ^4.9.0
dartz: ^0.10.1
flutter_bloc: ^9.1.1
auto_route: ^9.3.0+1
auto_route: ^10.1.0+1
cupertino_icons: ^1.0.8
talker_flutter: ^4.9.3
talker_cherrypick_logger:
path: ../../talker_cherrypick_logger
talker_flutter: ^5.0.0
talker_cherrypick_logger: any
talker_dio_logger: ^5.0.0
talker_bloc_logger: ^5.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
flutter_lints: ^6.0.0
cherrypick_generator:
path: ../../cherrypick_generator
build_runner: 2.4.15
build_runner: ^2.5.0
cherrypick_generator: ^3.0.2-dev.0
retrofit_generator: ^9.1.5
freezed: ^2.5.8
json_serializable: ^6.9.0
auto_route_generator: ^9.0.0
talker_dio_logger: ^4.9.3
talker_bloc_logger: ^4.9.3
retrofit_generator: ^10.0.5
auto_route_generator: ^10.0.1
freezed: ^3.0.0
melos: ^6.3.2
flutter:
uses-material-design: true
dev_dependencies:
melos: ^6.3.2

View File

@@ -13,6 +13,28 @@ packages:
- examples/postly
scripts:
clean_all:
run: |
melos clean
melos exec -- rm -rf lib/**.g.dart lib/**/**.g.dart lib/generated/
melos exec -- rm -rf .dart_tool build pubspec_overrides.yaml
description: |
Очищает build артефакты flutter и сгенерированный код во всех пакетах.
all:
steps:
- codegen
- analyze
- format
- test
description: Run all steps.
lint:all:
steps:
- analyze
- format
description: Run all static analysis checks.
analyze:
exec: dart analyze
@@ -20,11 +42,10 @@ scripts:
exec: dart format lib
test:
run: |
echo "Running Dart tests..."
melos exec --scope="cherrypick,cherrypick_annotations,cherrypick_generator" -- dart test --reporter=compact
echo "Running Flutter tests..."
melos exec --scope="cherrypick_flutter" -- flutter test --reporter=compact
steps:
- test:dart
- test:flutter
description: Run all tests.
test:dart:
description: "Run tests for Dart packages only"

View File

@@ -1,27 +1,6 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
url: "https://pub.dev"
source: hosted
version: "76.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.3"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
url: "https://pub.dev"
source: hosted
version: "6.11.0"
ansi_styles:
dependency: transitive
description:
@@ -46,38 +25,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.13.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
build:
dependency: transitive
description:
name: build
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
url: "https://pub.dev"
source: hosted
version: "2.4.1"
built_collection:
dependency: transitive
description:
name: built_collection
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
url: "https://pub.dev"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4
url: "https://pub.dev"
source: hosted
version: "8.9.5"
charcode:
dependency: transitive
description:
@@ -94,22 +41,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.3"
cli_config:
dependency: transitive
description:
name: cli_config
sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec
url: "https://pub.dev"
source: hosted
version: "0.2.0"
cli_launcher:
dependency: transitive
description:
name: cli_launcher
sha256: "5e7e0282b79e8642edd6510ee468ae2976d847a0a29b3916e85f5fa1bfe24005"
sha256: "67d89e0a1c07b103d1253f6b953a43d3f502ee36805c8cfc21196282c9ddf177"
url: "https://pub.dev"
source: hosted
version: "0.3.1"
version: "0.3.2"
cli_util:
dependency: transitive
description:
@@ -126,14 +65,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.2"
code_builder:
dependency: transitive
description:
name: code_builder
sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e"
url: "https://pub.dev"
source: hosted
version: "4.10.1"
collection:
dependency: transitive
description:
@@ -146,42 +77,10 @@ packages:
dependency: transitive
description:
name: conventional_commit
sha256: dec15ad1118f029c618651a4359eb9135d8b88f761aa24e4016d061cd45948f2
sha256: fad254feb6fb8eace2be18855176b0a4b97e0d50e416ff0fe590d5ba83735d34
url: "https://pub.dev"
source: hosted
version: "0.6.0+1"
convert:
dependency: transitive
description:
name: convert
sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
url: "https://pub.dev"
source: hosted
version: "3.1.2"
coverage:
dependency: transitive
description:
name: coverage
sha256: "802bd084fb82e55df091ec8ad1553a7331b61c08251eef19a508b6f3f3a9858d"
url: "https://pub.dev"
source: hosted
version: "1.13.1"
crypto:
dependency: transitive
description:
name: crypto
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
dart_style:
dependency: transitive
description:
name: dart_style
sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab"
url: "https://pub.dev"
source: hosted
version: "2.3.7"
version: "0.6.1"
file:
dependency: transitive
description:
@@ -190,22 +89,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.1"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
url: "https://pub.dev"
source: hosted
version: "1.1.1"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
url: "https://pub.dev"
source: hosted
version: "4.0.0"
glob:
dependency: transitive
description:
@@ -226,18 +109,10 @@ packages:
dependency: transitive
description:
name: http
sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f
sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007
url: "https://pub.dev"
source: hosted
version: "1.3.0"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8
url: "https://pub.dev"
source: hosted
version: "3.2.2"
version: "1.5.0"
http_parser:
dependency: transitive
description:
@@ -262,14 +137,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.5"
js:
dependency: transitive
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.dev"
source: hosted
version: "0.7.1"
json_annotation:
dependency: transitive
description:
@@ -282,34 +149,10 @@ packages:
dependency: "direct dev"
description:
name: lints
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
logging:
dependency: transitive
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.dev"
source: hosted
version: "1.3.0"
macros:
dependency: transitive
description:
name: macros
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.dev"
source: hosted
version: "0.1.3-main.0"
matcher:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "5.1.1"
melos:
dependency: "direct dev"
description:
@@ -322,26 +165,10 @@ packages:
dependency: "direct main"
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
mime:
dependency: transitive
description:
name: mime
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
mockito:
dependency: "direct dev"
description:
name: mockito
sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917"
url: "https://pub.dev"
source: hosted
version: "5.4.4"
version: "1.17.0"
mustache_template:
dependency: transitive
description:
@@ -350,22 +177,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
node_preamble:
dependency: transitive
description:
name: node_preamble
sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
package_config:
dependency: transitive
description:
name: package_config
sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc
url: "https://pub.dev"
source: hosted
version: "2.2.0"
path:
dependency: transitive
description:
@@ -394,10 +205,10 @@ packages:
dependency: transitive
description:
name: process
sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d"
sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744
url: "https://pub.dev"
source: hosted
version: "5.0.3"
version: "5.0.5"
prompts:
dependency: transitive
description:
@@ -426,66 +237,10 @@ packages:
dependency: transitive
description:
name: pubspec_parse
sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
shelf:
dependency: transitive
description:
name: shelf
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
url: "https://pub.dev"
source: hosted
version: "1.4.2"
shelf_packages_handler:
dependency: transitive
description:
name: shelf_packages_handler
sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
shelf_static:
dependency: transitive
description:
name: shelf_static
sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3
url: "https://pub.dev"
source: hosted
version: "1.1.3"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
source_gen:
dependency: transitive
description:
name: source_gen
sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832"
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
url: "https://pub.dev"
source: hosted
version: "1.5.0"
source_map_stack_trace:
dependency: transitive
description:
name: source_map_stack_trace
sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
url: "https://pub.dev"
source: hosted
version: "2.1.2"
source_maps:
dependency: transitive
description:
name: source_maps
sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812"
url: "https://pub.dev"
source: hosted
version: "0.10.13"
source_span:
dependency: transitive
description:
@@ -502,14 +257,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.12.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
string_scanner:
dependency: transitive
description:
@@ -526,30 +273,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.2"
test:
dependency: "direct dev"
description:
name: test
sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e"
url: "https://pub.dev"
source: hosted
version: "1.25.15"
test_api:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
url: "https://pub.dev"
source: hosted
version: "0.7.4"
test_core:
dependency: transitive
description:
name: test_core
sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa"
url: "https://pub.dev"
source: hosted
version: "0.6.8"
typed_data:
dependency: transitive
description:
@@ -558,22 +281,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.4.0"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
source: hosted
version: "15.0.0"
watcher:
dependency: transitive
description:
name: watcher
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
web:
dependency: transitive
description:
@@ -582,30 +289,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.1"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: bfe6f435f6ec49cb6c01da1e275ae4228719e59a6b067048c51e72d9d63bcc4b
url: "https://pub.dev"
source: hosted
version: "1.0.0"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8
url: "https://pub.dev"
source: hosted
version: "3.0.3"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
yaml:
dependency: transitive
description:
@@ -623,4 +306,4 @@ packages:
source: hosted
version: "2.2.2"
sdks:
dart: ">=3.5.2 <4.0.0"
dart: ">=3.6.0 <4.0.0"

View File

@@ -7,16 +7,11 @@ repository: https://github.com/pese-git/cherrypick
issue_tracker: https://github.com/pese-git/cherrypick/issues
environment:
sdk: ">=3.5.2 <4.0.0"
sdk: ">=3.2.0 <4.0.0"
dependencies:
meta: ^1.3.0
dev_dependencies:
#pedantic: ^1.11.0
test: ^1.17.2
mockito: ^5.0.6
lints: ^2.1.0
lints: ^5.1.1
melos: ^6.3.2

View File

@@ -1,3 +1,23 @@
## 3.0.2
- Update a dependency to the latest release.
## 3.0.1
- **DOCS**: add Netlify deployment status badge to README files.
## 3.0.0
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
## 3.0.0-dev.1
- Update a dependency to the latest release.
## 3.0.0-dev.0
- chore(talker_cherrypick_logger): sync version with cherrypick 3.0.0-dev.12
## 1.1.0-dev.7
- Update a dependency to the latest release.

View File

@@ -1,3 +1,8 @@
[![Melos + FVM CI](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
[![Netlify Status](https://api.netlify.com/api/v1/badges/3c3e0f98-27a9-4dd4-9eab-4be0b96798b8/deploy-status)](https://app.netlify.com/projects/cherrypick-di/deploys)
---
# talker_cherrypick_logger
An integration package that allows you to log [CherryPick](https://github.com/pese-dot-work/cherrypick) Dependency Injection (DI) container events using the [Talker](https://pub.dev/packages/talker) logging system.

View File

@@ -1,8 +1,8 @@
name: talker_cherrypick_logger
description: A Talker logger integration for CherryPick DI to observe and log DI events and errors.
version: 1.1.0-dev.7
homepage: https://cherrypick-di.dev/
documentation: https://cherrypick-di.dev/docs/intro
version: 3.0.2
homepage: https://cherrypick-di.netlify.app
documentation: https://cherrypick-di.netlify.app/docs/intro
repository: https://github.com/pese-git/cherrypick
issue_tracker: https://github.com/pese-git/cherrypick/issues
@@ -13,14 +13,14 @@ topics:
- log
environment:
sdk: ">=3.5.2 <4.0.0"
sdk: '>=3.2.0 <4.0.0'
# Add regular dependencies here.
dependencies:
talker: ^4.9.3
cherrypick: ^3.0.0-dev.12
talker: ^5.0.0
cherrypick: ^3.0.2
dev_dependencies:
lints: ^5.0.0
test: ^1.24.0
lints: ^4.0.0
test: ^1.25.6