mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-23 21:13:35 +00:00
Compare commits
27 Commits
cherrypick
...
4953e917c9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4953e917c9 | ||
|
|
1997110d92 | ||
|
|
0e600ca3a2 | ||
|
|
25ae208ea1 | ||
|
|
685c0ae49c | ||
|
|
98d81b13a8 | ||
|
|
cccf460f01 | ||
|
|
0c1ef70b73 | ||
|
|
eb6d786600 | ||
|
|
c483d8c9e2 | ||
|
|
a74cec645e | ||
|
|
082b5a6fb6 | ||
|
|
6c1ba523c6 | ||
|
|
651b2a26d6 | ||
|
|
ec6e9aefd3 | ||
|
|
751cb08064 | ||
|
|
b2fbce74b3 | ||
|
|
81f14f5231 | ||
|
|
a9101513e1 | ||
|
|
f1cf1d054f | ||
|
|
f1ad1c42b5 | ||
|
|
be7f3e0392 | ||
|
|
1b0615810d | ||
|
|
ef04f464da | ||
|
|
6826f0f62c | ||
|
|
9e517d047f | ||
|
|
68a16aaa0c |
193
CHANGELOG.md
193
CHANGELOG.md
@@ -3,6 +3,199 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
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
|
## 2025-09-08
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
[](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
|
||||||
|
[](https://app.netlify.com/projects/cherrypick-di/deploys)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# CherryPick Workspace
|
# 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.
|
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.
|
||||||
@@ -142,4 +147,4 @@ Please see:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Happy Cherry Picking! 🍒**
|
**Happy Cherry Picking! 🍒**
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class BenchmarkCliRunner {
|
|||||||
final di = RiverpodAdapter();
|
final di = RiverpodAdapter();
|
||||||
if (scenario == UniversalScenario.asyncChain) {
|
if (scenario == UniversalScenario.asyncChain) {
|
||||||
final benchAsync = UniversalChainAsyncBenchmark<
|
final benchAsync = UniversalChainAsyncBenchmark<
|
||||||
Map<String, rp.ProviderBase<Object?>>> (
|
Map<String, rp.ProviderBase<Object?>>>(
|
||||||
di,
|
di,
|
||||||
chainCount: c,
|
chainCount: c,
|
||||||
nestingDepth: d,
|
nestingDepth: d,
|
||||||
@@ -111,7 +111,7 @@ class BenchmarkCliRunner {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
final benchSync = UniversalChainBenchmark<
|
final benchSync = UniversalChainBenchmark<
|
||||||
Map<String, rp.ProviderBase<Object?>>> (
|
Map<String, rp.ProviderBase<Object?>>>(
|
||||||
di,
|
di,
|
||||||
chainCount: c,
|
chainCount: c,
|
||||||
nestingDepth: d,
|
nestingDepth: d,
|
||||||
@@ -127,7 +127,8 @@ class BenchmarkCliRunner {
|
|||||||
} else if (config.di == 'yx_scope') {
|
} else if (config.di == 'yx_scope') {
|
||||||
final di = YxScopeAdapter();
|
final di = YxScopeAdapter();
|
||||||
if (scenario == UniversalScenario.asyncChain) {
|
if (scenario == UniversalScenario.asyncChain) {
|
||||||
final benchAsync = UniversalChainAsyncBenchmark<UniversalYxScopeContainer>(
|
final benchAsync =
|
||||||
|
UniversalChainAsyncBenchmark<UniversalYxScopeContainer>(
|
||||||
di,
|
di,
|
||||||
chainCount: c,
|
chainCount: c,
|
||||||
nestingDepth: d,
|
nestingDepth: d,
|
||||||
@@ -139,7 +140,8 @@ class BenchmarkCliRunner {
|
|||||||
repeats: config.repeats,
|
repeats: config.repeats,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
final benchSync = UniversalChainBenchmark<UniversalYxScopeContainer>(
|
final benchSync =
|
||||||
|
UniversalChainBenchmark<UniversalYxScopeContainer>(
|
||||||
di,
|
di,
|
||||||
chainCount: c,
|
chainCount: c,
|
||||||
nestingDepth: d,
|
nestingDepth: d,
|
||||||
|
|||||||
@@ -20,77 +20,80 @@ class KiwiAdapter extends DIAdapter<KiwiContainer> {
|
|||||||
registration(_container);
|
registration(_container);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Registration<KiwiContainer> universalRegistration<S extends Enum>({
|
Registration<KiwiContainer> universalRegistration<S extends Enum>({
|
||||||
required S scenario,
|
required S scenario,
|
||||||
required int chainCount,
|
required int chainCount,
|
||||||
required int nestingDepth,
|
required int nestingDepth,
|
||||||
required UniversalBindingMode bindingMode,
|
required UniversalBindingMode bindingMode,
|
||||||
}) {
|
}) {
|
||||||
if (scenario is UniversalScenario) {
|
if (scenario is UniversalScenario) {
|
||||||
if (scenario == UniversalScenario.asyncChain ||
|
if (scenario == UniversalScenario.asyncChain ||
|
||||||
bindingMode == UniversalBindingMode.asyncStrategy) {
|
bindingMode == UniversalBindingMode.asyncStrategy) {
|
||||||
throw UnsupportedError('Kiwi does not support async dependencies or async binding scenarios.');
|
throw UnsupportedError(
|
||||||
}
|
'Kiwi does not support async dependencies or async binding scenarios.');
|
||||||
return (container) {
|
}
|
||||||
switch (scenario) {
|
return (container) {
|
||||||
case UniversalScenario.asyncChain:
|
switch (scenario) {
|
||||||
break;
|
case UniversalScenario.asyncChain:
|
||||||
case UniversalScenario.register:
|
break;
|
||||||
container.registerSingleton<UniversalService>(
|
case UniversalScenario.register:
|
||||||
(c) => UniversalServiceImpl(value: 'reg', dependency: null),
|
container.registerSingleton<UniversalService>(
|
||||||
);
|
(c) => UniversalServiceImpl(value: 'reg', dependency: null),
|
||||||
break;
|
);
|
||||||
case UniversalScenario.named:
|
break;
|
||||||
container.registerFactory<UniversalService>(
|
case UniversalScenario.named:
|
||||||
(c) => UniversalServiceImpl(value: 'impl1'), name: 'impl1');
|
container.registerFactory<UniversalService>(
|
||||||
container.registerFactory<UniversalService>(
|
(c) => UniversalServiceImpl(value: 'impl1'),
|
||||||
(c) => UniversalServiceImpl(value: 'impl2'), name: 'impl2');
|
name: 'impl1');
|
||||||
break;
|
container.registerFactory<UniversalService>(
|
||||||
case UniversalScenario.chain:
|
(c) => UniversalServiceImpl(value: 'impl2'),
|
||||||
for (int chain = 1; chain <= chainCount; chain++) {
|
name: 'impl2');
|
||||||
for (int level = 1; level <= nestingDepth; level++) {
|
break;
|
||||||
final prevDepName = '${chain}_${level - 1}';
|
case UniversalScenario.chain:
|
||||||
final depName = '${chain}_$level';
|
for (int chain = 1; chain <= chainCount; chain++) {
|
||||||
switch (bindingMode) {
|
for (int level = 1; level <= nestingDepth; level++) {
|
||||||
case UniversalBindingMode.singletonStrategy:
|
final prevDepName = '${chain}_${level - 1}';
|
||||||
container.registerSingleton<UniversalService>(
|
final depName = '${chain}_$level';
|
||||||
(c) => UniversalServiceImpl(
|
switch (bindingMode) {
|
||||||
value: depName,
|
case UniversalBindingMode.singletonStrategy:
|
||||||
dependency: level > 1
|
container.registerSingleton<UniversalService>(
|
||||||
? c.resolve<UniversalService>(prevDepName)
|
(c) => UniversalServiceImpl(
|
||||||
: null),
|
value: depName,
|
||||||
name: depName);
|
dependency: level > 1
|
||||||
break;
|
? c.resolve<UniversalService>(prevDepName)
|
||||||
case UniversalBindingMode.factoryStrategy:
|
: null),
|
||||||
container.registerFactory<UniversalService>(
|
name: depName);
|
||||||
(c) => UniversalServiceImpl(
|
break;
|
||||||
value: depName,
|
case UniversalBindingMode.factoryStrategy:
|
||||||
dependency: level > 1
|
container.registerFactory<UniversalService>(
|
||||||
? c.resolve<UniversalService>(prevDepName)
|
(c) => UniversalServiceImpl(
|
||||||
: null),
|
value: depName,
|
||||||
name: depName);
|
dependency: level > 1
|
||||||
break;
|
? c.resolve<UniversalService>(prevDepName)
|
||||||
case UniversalBindingMode.asyncStrategy:
|
: null),
|
||||||
// Не поддерживается
|
name: depName);
|
||||||
break;
|
break;
|
||||||
|
case UniversalBindingMode.asyncStrategy:
|
||||||
|
// Не поддерживается
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
final depName = '${chainCount}_$nestingDepth';
|
||||||
final depName = '${chainCount}_$nestingDepth';
|
container.registerSingleton<UniversalService>(
|
||||||
container.registerSingleton<UniversalService>(
|
(c) => c.resolve<UniversalService>(depName));
|
||||||
(c) => c.resolve<UniversalService>(depName));
|
break;
|
||||||
break;
|
case UniversalScenario.override:
|
||||||
case UniversalScenario.override:
|
final depName = '${chainCount}_$nestingDepth';
|
||||||
final depName = '${chainCount}_$nestingDepth';
|
container.registerSingleton<UniversalService>(
|
||||||
container.registerSingleton<UniversalService>(
|
(c) => c.resolve<UniversalService>(depName));
|
||||||
(c) => c.resolve<UniversalService>(depName));
|
break;
|
||||||
break;
|
}
|
||||||
}
|
};
|
||||||
};
|
}
|
||||||
|
throw UnsupportedError('Scenario $scenario not supported by KiwiAdapter');
|
||||||
}
|
}
|
||||||
throw UnsupportedError('Scenario $scenario not supported by KiwiAdapter');
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
T resolve<T extends Object>({String? named}) {
|
T resolve<T extends Object>({String? named}) {
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ class YxScopeAdapter extends DIAdapter<UniversalYxScopeContainer> {
|
|||||||
late UniversalYxScopeContainer _scope;
|
late UniversalYxScopeContainer _scope;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setupDependencies(void Function(UniversalYxScopeContainer container) registration) {
|
void setupDependencies(
|
||||||
|
void Function(UniversalYxScopeContainer container) registration) {
|
||||||
_scope = UniversalYxScopeContainer();
|
_scope = UniversalYxScopeContainer();
|
||||||
registration(_scope);
|
registration(_scope);
|
||||||
}
|
}
|
||||||
@@ -45,7 +46,8 @@ class YxScopeAdapter extends DIAdapter<UniversalYxScopeContainer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Registration<UniversalYxScopeContainer> universalRegistration<S extends Enum>({
|
Registration<UniversalYxScopeContainer>
|
||||||
|
universalRegistration<S extends Enum>({
|
||||||
required S scenario,
|
required S scenario,
|
||||||
required int chainCount,
|
required int chainCount,
|
||||||
required int nestingDepth,
|
required int nestingDepth,
|
||||||
@@ -112,7 +114,8 @@ class YxScopeAdapter extends DIAdapter<UniversalYxScopeContainer> {
|
|||||||
// handled at benchmark level
|
// handled at benchmark level
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (scenario == UniversalScenario.chain || scenario == UniversalScenario.override) {
|
if (scenario == UniversalScenario.chain ||
|
||||||
|
scenario == UniversalScenario.override) {
|
||||||
final depName = '${chainCount}_$nestingDepth';
|
final depName = '${chainCount}_$nestingDepth';
|
||||||
final lastDep = scope.dep<UniversalService>(
|
final lastDep = scope.dep<UniversalService>(
|
||||||
() => scope.depFor<UniversalService>(name: depName).get,
|
() => 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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ packages:
|
|||||||
path: "../cherrypick"
|
path: "../cherrypick"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "3.0.0-dev.12"
|
version: "3.0.1"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ publish_to: none
|
|||||||
description: Universal benchmark for any DI library (cherrypick, get_it, and others)
|
description: Universal benchmark for any DI library (cherrypick, get_it, and others)
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0 <4.0.0'
|
sdk: '>=3.2.0 <4.0.0'
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
cherrypick:
|
cherrypick:
|
||||||
|
|||||||
@@ -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
|
## 3.0.0-dev.12
|
||||||
|
|
||||||
- **FIX**(scope): prevent concurrent modification in dispose().
|
- **FIX**(scope): prevent concurrent modification in dispose().
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
[](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
|
||||||
|
[](https://app.netlify.com/projects/cherrypick-di/deploys)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# CherryPick
|
# CherryPick
|
||||||
|
|
||||||
`cherrypick` is a flexible and lightweight dependency injection library for Dart and Flutter.
|
`cherrypick` is a flexible and lightweight dependency injection library for Dart and Flutter.
|
||||||
|
|||||||
@@ -37,4 +37,4 @@ void main() {
|
|||||||
// Освобождаем все ресурсы
|
// Освобождаем все ресурсы
|
||||||
scope.dispose();
|
scope.dispose();
|
||||||
print('Service wasDisposed = ${service.wasDisposed}'); // true
|
print('Service wasDisposed = ${service.wasDisposed}'); // true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,6 +191,7 @@ class Binding<T> {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
/// This restriction only applies to [toInstance] bindings.
|
/// 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.
|
/// With [toProvide]/[toProvideAsync] you may freely use `scope.resolve<T>()` in the builder or provider function.
|
||||||
Binding<T> toInstance(Instance<T> value) {
|
Binding<T> toInstance(Instance<T> value) {
|
||||||
_resolver = InstanceResolver<T>(value);
|
_resolver = InstanceResolver<T>(value);
|
||||||
|
|||||||
@@ -498,5 +498,10 @@ class Scope with CycleDetectionMixin, GlobalCycleDetectionMixin {
|
|||||||
await d.dispose();
|
await d.dispose();
|
||||||
}
|
}
|
||||||
_disposables.clear();
|
_disposables.clear();
|
||||||
|
|
||||||
|
// Clear modules
|
||||||
|
_modulesList.clear();
|
||||||
|
// Clear binding-index
|
||||||
|
_bindingResolvers.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
name: cherrypick
|
name: cherrypick
|
||||||
description: Cherrypick is a small dependency injection (DI) library for dart/flutter projects.
|
description: Cherrypick is a small dependency injection (DI) library for dart/flutter projects.
|
||||||
version: 3.0.0-dev.12
|
version: 3.0.2
|
||||||
homepage: https://cherrypick-di.dev/
|
homepage: https://cherrypick-di.netlify.app
|
||||||
documentation: https://cherrypick-di.dev/docs/intro
|
documentation: https://cherrypick-di.netlify.app/docs/intro
|
||||||
repository: https://github.com/pese-git/cherrypick
|
repository: https://github.com/pese-git/cherrypick
|
||||||
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
||||||
topics:
|
topics:
|
||||||
@@ -13,14 +13,14 @@ topics:
|
|||||||
- inversion-of-control
|
- inversion-of-control
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.5.2 <4.0.0"
|
sdk: '>=3.2.0 <4.0.0'
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
meta: ^1.3.0
|
meta: ^1.3.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
lints: ^5.0.0
|
lints: ^4.0.0
|
||||||
test: ^1.25.15
|
test: ^1.25.6
|
||||||
|
|
||||||
mockito: ^5.0.6
|
mockito: ^5.4.4
|
||||||
melos: ^6.3.2
|
melos: ^6.3.2
|
||||||
|
|||||||
65
cherrypick/test/binding_memory_leak_test.dart
Normal file
65
cherrypick/test/binding_memory_leak_test.dart
Normal 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);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -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
|
## 3.0.0-dev.0
|
||||||
|
|
||||||
- chore(cherrypick_annotations): sync version with cherrypick 3.0.0-dev.0
|
- chore(cherrypick_annotations): sync version with cherrypick 3.0.0-dev.0
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
[](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
|
||||||
|
[](https://app.netlify.com/projects/cherrypick-di/deploys)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# cherrypick_annotations
|
# cherrypick_annotations
|
||||||
|
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
name: cherrypick_annotations
|
name: cherrypick_annotations
|
||||||
description: |
|
description: |
|
||||||
Set of annotations for CherryPick dependency injection library. Enables code generation and declarative DI for Dart & Flutter projects.
|
Set of annotations for CherryPick dependency injection library. Enables code generation and declarative DI for Dart & Flutter projects.
|
||||||
version: 3.0.0-dev.0
|
version: 3.0.2-dev.0
|
||||||
homepage: https://cherrypick-di.dev/
|
homepage: https://cherrypick-di.netlify.app
|
||||||
documentation: https://cherrypick-di.dev/docs/intro
|
documentation: https://cherrypick-di.netlify.app/docs/intro
|
||||||
repository: https://github.com/pese-git/cherrypick/cherrypick_annotations
|
repository: https://github.com/pese-git/cherrypick/cherrypick_annotations
|
||||||
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
||||||
topics:
|
topics:
|
||||||
@@ -14,7 +14,7 @@ topics:
|
|||||||
- inversion-of-control
|
- inversion-of-control
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.5.2 <4.0.0"
|
sdk: ">=3.8.0 <4.0.0"
|
||||||
|
|
||||||
# Add regular dependencies here.
|
# Add regular dependencies here.
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -22,5 +22,5 @@ dependencies:
|
|||||||
# path: ^1.8.0
|
# path: ^1.8.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
lints: ^5.0.0
|
lints: ^6.0.0
|
||||||
test: ^1.25.8
|
test: ^1.25.8
|
||||||
|
|||||||
@@ -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
|
## 3.0.0-dev.0
|
||||||
|
|
||||||
- chore(cherrypick_flutter): sync version with cherrypick 3.0.0-dev.12
|
- chore(cherrypick_flutter): sync version with cherrypick 3.0.0-dev.12
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
[](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
|
||||||
|
[](https://app.netlify.com/projects/cherrypick-di/deploys)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# CherryPick Flutter
|
# 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.
|
`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.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
name: cherrypick_flutter
|
name: cherrypick_flutter
|
||||||
description: "Flutter library that allows access to the root scope through the context using `CherryPickProvider`."
|
description: "Flutter library that allows access to the root scope through the context using `CherryPickProvider`."
|
||||||
version: 3.0.0-dev.0
|
version: 3.0.2
|
||||||
homepage: https://cherrypick-di.dev/
|
homepage: https://cherrypick-di.netlify.app
|
||||||
documentation: https://cherrypick-di.dev/docs/intro
|
documentation: https://cherrypick-di.netlify.app/docs/intro
|
||||||
repository: https://github.com/pese-git/cherrypick
|
repository: https://github.com/pese-git/cherrypick
|
||||||
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
||||||
topics:
|
topics:
|
||||||
@@ -13,19 +13,19 @@ topics:
|
|||||||
- inversion-of-control
|
- inversion-of-control
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.5.2 <4.0.0"
|
sdk: '>=3.2.0 <4.0.0'
|
||||||
flutter: ">=3.24.0"
|
flutter: ">=3.16.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
cherrypick: ^3.0.0-dev.12
|
cherrypick: ^3.0.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_lints: ^5.0.0
|
flutter_lints: ^4.0.0
|
||||||
test: ^1.25.7
|
test: ^1.25.6
|
||||||
melos: ^6.3.2
|
melos: ^6.3.2
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
|
|||||||
@@ -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
|
## 3.0.0-dev.0
|
||||||
|
|
||||||
- chore(cherrypick_generator): sync version with cherrypick 3.0.0-dev.12
|
- chore(cherrypick_generator): sync version with cherrypick 3.0.0-dev.12
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
[](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
|
||||||
|
[](https://app.netlify.com/projects/cherrypick-di/deploys)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# Cherrypick Generator
|
# 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.
|
**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.
|
||||||
|
|||||||
@@ -31,4 +31,5 @@ include: package:lints/recommended.yaml
|
|||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
errors:
|
errors:
|
||||||
deprecated_member_use: ignore
|
deprecated_member_use: ignore
|
||||||
|
unintended_html_in_doc_comment: ignore
|
||||||
@@ -11,13 +11,12 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import 'dart:async';
|
|
||||||
import 'package:analyzer/dart/constant/value.dart';
|
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/nullability_suffix.dart';
|
||||||
import 'package:analyzer/dart/element/type.dart';
|
import 'package:analyzer/dart/element/type.dart';
|
||||||
import 'package:build/build.dart';
|
import 'package:build/build.dart';
|
||||||
import 'package:source_gen/source_gen.dart';
|
import 'package:source_gen/source_gen.dart';
|
||||||
import 'package:analyzer/dart/element/element.dart';
|
|
||||||
import 'package:cherrypick_annotations/cherrypick_annotations.dart' as ann;
|
import 'package:cherrypick_annotations/cherrypick_annotations.dart' as ann;
|
||||||
|
|
||||||
/// CherryPick DI field injector generator for codegen.
|
/// CherryPick DI field injector generator for codegen.
|
||||||
@@ -100,12 +99,12 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
@override
|
@override
|
||||||
FutureOr<String> generateForAnnotatedElement(
|
dynamic generateForAnnotatedElement(
|
||||||
Element element,
|
Element2 element,
|
||||||
ConstantReader annotation,
|
ConstantReader annotation,
|
||||||
BuildStep buildStep,
|
BuildStep buildStep,
|
||||||
) {
|
) {
|
||||||
if (element is! ClassElement) {
|
if (element is! ClassElement2) {
|
||||||
throw InvalidGenerationSourceError(
|
throw InvalidGenerationSourceError(
|
||||||
'@injectable() can only be applied to classes.',
|
'@injectable() can only be applied to classes.',
|
||||||
element: element,
|
element: element,
|
||||||
@@ -113,7 +112,7 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final classElement = element;
|
final classElement = element;
|
||||||
final className = classElement.name;
|
final className = classElement.firstFragment.name2;
|
||||||
final mixinName = '_\$$className';
|
final mixinName = '_\$$className';
|
||||||
|
|
||||||
final buffer = StringBuffer()
|
final buffer = StringBuffer()
|
||||||
@@ -121,8 +120,9 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
|
|||||||
..writeln(' void _inject($className instance) {');
|
..writeln(' void _inject($className instance) {');
|
||||||
|
|
||||||
// Collect and process all @inject fields
|
// Collect and process all @inject fields
|
||||||
final injectFields =
|
final injectFields = classElement.fields2
|
||||||
classElement.fields.where(_isInjectField).map(_parseInjectField);
|
.where((f) => _isInjectField(f))
|
||||||
|
.map((f) => _parseInjectField(f));
|
||||||
|
|
||||||
for (final parsedField in injectFields) {
|
for (final parsedField in injectFields) {
|
||||||
buffer.writeln(_generateInjectionLine(parsedField));
|
buffer.writeln(_generateInjectionLine(parsedField));
|
||||||
@@ -138,8 +138,8 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
|
|||||||
/// Returns true if a field is annotated with `@inject`.
|
/// Returns true if a field is annotated with `@inject`.
|
||||||
///
|
///
|
||||||
/// Used to detect which fields should be processed for injection.
|
/// Used to detect which fields should be processed for injection.
|
||||||
static bool _isInjectField(FieldElement field) {
|
static bool _isInjectField(FieldElement2 field) {
|
||||||
return field.metadata.any(
|
return field.firstFragment.metadata2.annotations.any(
|
||||||
(m) => m.computeConstantValue()?.type?.getDisplayString() == 'inject',
|
(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
|
/// Converts Dart field declaration and all parameterizing injection-related
|
||||||
/// annotations into a [_ParsedInjectField] which is used for codegen.
|
/// annotations into a [_ParsedInjectField] which is used for codegen.
|
||||||
static _ParsedInjectField _parseInjectField(FieldElement field) {
|
static _ParsedInjectField _parseInjectField(FieldElement2 field) {
|
||||||
String? scopeName;
|
String? scopeName;
|
||||||
String? namedValue;
|
String? namedValue;
|
||||||
|
|
||||||
for (final meta in field.metadata) {
|
for (final meta in field.firstFragment.metadata2.annotations) {
|
||||||
final DartObject? obj = meta.computeConstantValue();
|
final DartObject? obj = meta.computeConstantValue();
|
||||||
final type = obj?.type?.getDisplayString();
|
final type = obj?.type?.getDisplayString();
|
||||||
if (type == 'scope') {
|
if (type == 'scope') {
|
||||||
@@ -177,15 +177,15 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine nullability for field types like T? or Future<T?>
|
// Determine nullability for field types like T? or Future<T?>
|
||||||
bool isNullable = dartType.nullabilitySuffix ==
|
bool isNullable =
|
||||||
NullabilitySuffix.question ||
|
dartType.nullabilitySuffix == NullabilitySuffix.question ||
|
||||||
(dartType is ParameterizedType &&
|
(dartType is ParameterizedType &&
|
||||||
(dartType)
|
(dartType).typeArguments.any(
|
||||||
.typeArguments
|
(t) => t.nullabilitySuffix == NullabilitySuffix.question,
|
||||||
.any((t) => t.nullabilitySuffix == NullabilitySuffix.question));
|
));
|
||||||
|
|
||||||
return _ParsedInjectField(
|
return _ParsedInjectField(
|
||||||
fieldName: field.name,
|
fieldName: field.firstFragment.name2 ?? '',
|
||||||
coreType: coreTypeName.replaceAll('?', ''), // удаляем "?" на всякий
|
coreType: coreTypeName.replaceAll('?', ''), // удаляем "?" на всякий
|
||||||
isFuture: isFuture,
|
isFuture: isFuture,
|
||||||
isNullable: isNullable,
|
isNullable: isNullable,
|
||||||
@@ -207,11 +207,11 @@ class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
|
|||||||
String _generateInjectionLine(_ParsedInjectField field) {
|
String _generateInjectionLine(_ParsedInjectField field) {
|
||||||
final resolveMethod = field.isFuture
|
final resolveMethod = field.isFuture
|
||||||
? (field.isNullable
|
? (field.isNullable
|
||||||
? 'tryResolveAsync<${field.coreType}>'
|
? 'tryResolveAsync<${field.coreType}>'
|
||||||
: 'resolveAsync<${field.coreType}>')
|
: 'resolveAsync<${field.coreType}>')
|
||||||
: (field.isNullable
|
: (field.isNullable
|
||||||
? 'tryResolve<${field.coreType}>'
|
? 'tryResolve<${field.coreType}>'
|
||||||
: 'resolve<${field.coreType}>');
|
: 'resolve<${field.coreType}>');
|
||||||
|
|
||||||
final openCall = (field.scopeName != null && field.scopeName!.isNotEmpty)
|
final openCall = (field.scopeName != null && field.scopeName!.isNotEmpty)
|
||||||
? "CherryPick.openScope(scopeName: '${field.scopeName}')"
|
? "CherryPick.openScope(scopeName: '${field.scopeName}')"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
// limitations under the License.
|
// 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:build/build.dart';
|
||||||
import 'package:source_gen/source_gen.dart';
|
import 'package:source_gen/source_gen.dart';
|
||||||
import 'package:cherrypick_annotations/cherrypick_annotations.dart' as ann;
|
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.
|
/// See file-level docs for usage and generated output example.
|
||||||
@override
|
@override
|
||||||
String generateForAnnotatedElement(
|
dynamic generateForAnnotatedElement(
|
||||||
Element element,
|
Element2 element,
|
||||||
ConstantReader annotation,
|
ConstantReader annotation,
|
||||||
BuildStep buildStep,
|
BuildStep buildStep,
|
||||||
) {
|
) {
|
||||||
if (element is! ClassElement) {
|
if (element is! ClassElement2) {
|
||||||
throw InvalidGenerationSourceError(
|
throw InvalidGenerationSourceError(
|
||||||
'@module() can only be applied to classes.',
|
'@module() can only be applied to classes.',
|
||||||
element: element,
|
element: element,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import 'package:analyzer/dart/element/element.dart';
|
import 'package:analyzer/dart/element/element.dart';
|
||||||
|
import 'package:analyzer/dart/element/element2.dart';
|
||||||
import 'exceptions.dart';
|
import 'exceptions.dart';
|
||||||
import 'metadata_utils.dart';
|
import 'metadata_utils.dart';
|
||||||
|
|
||||||
@@ -52,8 +53,10 @@ class AnnotationValidator {
|
|||||||
/// - Parameter validation for method arguments.
|
/// - Parameter validation for method arguments.
|
||||||
///
|
///
|
||||||
/// Throws [AnnotationValidationException] on any violation.
|
/// Throws [AnnotationValidationException] on any violation.
|
||||||
static void validateMethodAnnotations(MethodElement method) {
|
static void validateMethodAnnotations(MethodElement2 method) {
|
||||||
final annotations = _getAnnotationNames(method.metadata);
|
final annotations = _getAnnotationNames(
|
||||||
|
method.firstFragment.metadata2.annotations,
|
||||||
|
);
|
||||||
|
|
||||||
_validateMutuallyExclusiveAnnotations(method, annotations);
|
_validateMutuallyExclusiveAnnotations(method, annotations);
|
||||||
_validateAnnotationCombinations(method, annotations);
|
_validateAnnotationCombinations(method, annotations);
|
||||||
@@ -68,8 +71,10 @@ class AnnotationValidator {
|
|||||||
/// - Correct scope naming if present.
|
/// - Correct scope naming if present.
|
||||||
///
|
///
|
||||||
/// Throws [AnnotationValidationException] if checks fail.
|
/// Throws [AnnotationValidationException] if checks fail.
|
||||||
static void validateFieldAnnotations(FieldElement field) {
|
static void validateFieldAnnotations(FieldElement2 field) {
|
||||||
final annotations = _getAnnotationNames(field.metadata);
|
final annotations = _getAnnotationNames(
|
||||||
|
field.firstFragment.metadata2.annotations,
|
||||||
|
);
|
||||||
|
|
||||||
_validateInjectFieldAnnotations(field, annotations);
|
_validateInjectFieldAnnotations(field, annotations);
|
||||||
}
|
}
|
||||||
@@ -82,8 +87,10 @@ class AnnotationValidator {
|
|||||||
/// - Provides helpful context for error/warning reporting.
|
/// - Provides helpful context for error/warning reporting.
|
||||||
///
|
///
|
||||||
/// Throws [AnnotationValidationException] if checks fail.
|
/// Throws [AnnotationValidationException] if checks fail.
|
||||||
static void validateClassAnnotations(ClassElement classElement) {
|
static void validateClassAnnotations(ClassElement2 classElement) {
|
||||||
final annotations = _getAnnotationNames(classElement.metadata);
|
final annotations = _getAnnotationNames(
|
||||||
|
classElement.firstFragment.metadata2.annotations,
|
||||||
|
);
|
||||||
|
|
||||||
_validateModuleClassAnnotations(classElement, annotations);
|
_validateModuleClassAnnotations(classElement, annotations);
|
||||||
_validateInjectableClassAnnotations(classElement, annotations);
|
_validateInjectableClassAnnotations(classElement, annotations);
|
||||||
@@ -104,7 +111,7 @@ class AnnotationValidator {
|
|||||||
///
|
///
|
||||||
/// For example, `@instance` and `@provide` cannot both be present.
|
/// For example, `@instance` and `@provide` cannot both be present.
|
||||||
static void _validateMutuallyExclusiveAnnotations(
|
static void _validateMutuallyExclusiveAnnotations(
|
||||||
MethodElement method,
|
MethodElement2 method,
|
||||||
List<String> annotations,
|
List<String> annotations,
|
||||||
) {
|
) {
|
||||||
// @instance and @provide are mutually exclusive
|
// @instance and @provide are mutually exclusive
|
||||||
@@ -127,7 +134,7 @@ class AnnotationValidator {
|
|||||||
/// - One of `@instance` or `@provide` must be present for a registration method
|
/// - One of `@instance` or `@provide` must be present for a registration method
|
||||||
/// - Validates singleton usage
|
/// - Validates singleton usage
|
||||||
static void _validateAnnotationCombinations(
|
static void _validateAnnotationCombinations(
|
||||||
MethodElement method,
|
MethodElement2 method,
|
||||||
List<String> annotations,
|
List<String> annotations,
|
||||||
) {
|
) {
|
||||||
// @params can only be used with @provide
|
// @params can only be used with @provide
|
||||||
@@ -165,7 +172,7 @@ class AnnotationValidator {
|
|||||||
|
|
||||||
/// Singleton-specific method annotation checks.
|
/// Singleton-specific method annotation checks.
|
||||||
static void _validateSingletonUsage(
|
static void _validateSingletonUsage(
|
||||||
MethodElement method,
|
MethodElement2 method,
|
||||||
List<String> annotations,
|
List<String> annotations,
|
||||||
) {
|
) {
|
||||||
// Singleton with params might not make sense in some contexts
|
// Singleton with params might not make sense in some contexts
|
||||||
@@ -181,18 +188,17 @@ class AnnotationValidator {
|
|||||||
'Singleton methods cannot return void',
|
'Singleton methods cannot return void',
|
||||||
element: method,
|
element: method,
|
||||||
suggestion: 'Remove @singleton annotation or change return type',
|
suggestion: 'Remove @singleton annotation or change return type',
|
||||||
context: {
|
context: {'method_name': method.displayName, 'return_type': returnType},
|
||||||
'method_name': method.displayName,
|
|
||||||
'return_type': returnType,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Validates extra requirements or syntactic rules for annotation arguments, like @named.
|
/// 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
|
// Validate @named annotation parameters
|
||||||
final namedValue = MetadataUtils.getNamedValue(method.metadata);
|
final namedValue = MetadataUtils.getNamedValue(
|
||||||
|
method.firstFragment.metadata2.annotations,
|
||||||
|
);
|
||||||
if (namedValue != null) {
|
if (namedValue != null) {
|
||||||
if (namedValue.isEmpty) {
|
if (namedValue.isEmpty) {
|
||||||
throw AnnotationValidationException(
|
throw AnnotationValidationException(
|
||||||
@@ -222,8 +228,10 @@ class AnnotationValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validate method parameters for @params usage
|
// Validate method parameters for @params usage
|
||||||
for (final param in method.parameters) {
|
for (final param in method.formalParameters) {
|
||||||
final paramAnnotations = _getAnnotationNames(param.metadata);
|
final paramAnnotations = _getAnnotationNames(
|
||||||
|
param.firstFragment.metadata2.annotations,
|
||||||
|
);
|
||||||
if (paramAnnotations.contains('params')) {
|
if (paramAnnotations.contains('params')) {
|
||||||
_validateParamsParameter(param, method);
|
_validateParamsParameter(param, method);
|
||||||
}
|
}
|
||||||
@@ -232,7 +240,9 @@ class AnnotationValidator {
|
|||||||
|
|
||||||
/// Checks that @params is used with compatible parameter type.
|
/// Checks that @params is used with compatible parameter type.
|
||||||
static void _validateParamsParameter(
|
static void _validateParamsParameter(
|
||||||
ParameterElement param, MethodElement method) {
|
FormalParameterElement param,
|
||||||
|
MethodElement2 method,
|
||||||
|
) {
|
||||||
// @params parameter should typically be dynamic or Map<String, dynamic>
|
// @params parameter should typically be dynamic or Map<String, dynamic>
|
||||||
final paramType = param.type.getDisplayString();
|
final paramType = param.type.getDisplayString();
|
||||||
if (paramType != 'dynamic' &&
|
if (paramType != 'dynamic' &&
|
||||||
@@ -256,7 +266,7 @@ class AnnotationValidator {
|
|||||||
|
|
||||||
/// Checks field-level annotation for valid injectable fields.
|
/// Checks field-level annotation for valid injectable fields.
|
||||||
static void _validateInjectFieldAnnotations(
|
static void _validateInjectFieldAnnotations(
|
||||||
FieldElement field,
|
FieldElement2 field,
|
||||||
List<String> annotations,
|
List<String> annotations,
|
||||||
) {
|
) {
|
||||||
if (!annotations.contains('inject')) {
|
if (!annotations.contains('inject')) {
|
||||||
@@ -270,15 +280,12 @@ class AnnotationValidator {
|
|||||||
'Cannot inject void type',
|
'Cannot inject void type',
|
||||||
element: field,
|
element: field,
|
||||||
suggestion: 'Use a concrete type instead of void',
|
suggestion: 'Use a concrete type instead of void',
|
||||||
context: {
|
context: {'field_name': field.displayName, 'field_type': fieldType},
|
||||||
'field_name': field.displayName,
|
|
||||||
'field_type': fieldType,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate scope annotation if present
|
// Validate scope annotation if present
|
||||||
for (final meta in field.metadata) {
|
for (final meta in field.firstFragment.metadata2.annotations) {
|
||||||
final obj = meta.computeConstantValue();
|
final obj = meta.computeConstantValue();
|
||||||
final type = obj?.type?.getDisplayString();
|
final type = obj?.type?.getDisplayString();
|
||||||
if (type == 'scope') {
|
if (type == 'scope') {
|
||||||
@@ -290,7 +297,7 @@ class AnnotationValidator {
|
|||||||
|
|
||||||
/// Checks @module usage: must have at least one DI method, each with DI-annotation.
|
/// Checks @module usage: must have at least one DI method, each with DI-annotation.
|
||||||
static void _validateModuleClassAnnotations(
|
static void _validateModuleClassAnnotations(
|
||||||
ClassElement classElement,
|
ClassElement2 classElement,
|
||||||
List<String> annotations,
|
List<String> annotations,
|
||||||
) {
|
) {
|
||||||
if (!annotations.contains('module')) {
|
if (!annotations.contains('module')) {
|
||||||
@@ -298,8 +305,9 @@ class AnnotationValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if class has public methods
|
// Check if class has public methods
|
||||||
final publicMethods =
|
final publicMethods = classElement.methods2
|
||||||
classElement.methods.where((m) => m.isPublic).toList();
|
.where((m) => m.isPublic)
|
||||||
|
.toList();
|
||||||
if (publicMethods.isEmpty) {
|
if (publicMethods.isEmpty) {
|
||||||
throw AnnotationValidationException(
|
throw AnnotationValidationException(
|
||||||
'Module class must have at least one public method',
|
'Module class must have at least one public method',
|
||||||
@@ -314,7 +322,9 @@ class AnnotationValidator {
|
|||||||
|
|
||||||
// Validate that public methods have appropriate annotations
|
// Validate that public methods have appropriate annotations
|
||||||
for (final method in publicMethods) {
|
for (final method in publicMethods) {
|
||||||
final methodAnnotations = _getAnnotationNames(method.metadata);
|
final methodAnnotations = _getAnnotationNames(
|
||||||
|
method.firstFragment.metadata2.annotations,
|
||||||
|
);
|
||||||
if (!methodAnnotations.contains('instance') &&
|
if (!methodAnnotations.contains('instance') &&
|
||||||
!methodAnnotations.contains('provide')) {
|
!methodAnnotations.contains('provide')) {
|
||||||
throw AnnotationValidationException(
|
throw AnnotationValidationException(
|
||||||
@@ -332,7 +342,7 @@ class AnnotationValidator {
|
|||||||
|
|
||||||
/// Checks @injectable usage on classes and their fields.
|
/// Checks @injectable usage on classes and their fields.
|
||||||
static void _validateInjectableClassAnnotations(
|
static void _validateInjectableClassAnnotations(
|
||||||
ClassElement classElement,
|
ClassElement2 classElement,
|
||||||
List<String> annotations,
|
List<String> annotations,
|
||||||
) {
|
) {
|
||||||
if (!annotations.contains('injectable')) {
|
if (!annotations.contains('injectable')) {
|
||||||
@@ -340,8 +350,10 @@ class AnnotationValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if class has injectable fields
|
// Check if class has injectable fields
|
||||||
final injectFields = classElement.fields.where((f) {
|
final injectFields = classElement.fields2.where((f) {
|
||||||
final fieldAnnotations = _getAnnotationNames(f.metadata);
|
final fieldAnnotations = _getAnnotationNames(
|
||||||
|
f.firstFragment.metadata2.annotations,
|
||||||
|
);
|
||||||
return fieldAnnotations.contains('inject');
|
return fieldAnnotations.contains('inject');
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import 'package:analyzer/dart/element/element.dart';
|
import 'package:analyzer/dart/element/element2.dart';
|
||||||
|
|
||||||
import 'bind_parameters_spec.dart';
|
import 'bind_parameters_spec.dart';
|
||||||
import 'metadata_utils.dart';
|
import 'metadata_utils.dart';
|
||||||
@@ -25,7 +25,7 @@ enum BindingType {
|
|||||||
instance,
|
instance,
|
||||||
|
|
||||||
/// Provider/factory function (@provide).
|
/// Provider/factory function (@provide).
|
||||||
provide;
|
provide,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ---------------------------------------------------------------------------
|
/// ---------------------------------------------------------------------------
|
||||||
@@ -155,7 +155,8 @@ class BindSpec {
|
|||||||
switch (bindingType) {
|
switch (bindingType) {
|
||||||
case BindingType.instance:
|
case BindingType.instance:
|
||||||
throw StateError(
|
throw StateError(
|
||||||
'Internal error: _generateWithParamsProvideClause called for @instance binding with @params.');
|
'Internal error: _generateWithParamsProvideClause called for @instance binding with @params.',
|
||||||
|
);
|
||||||
//return isAsyncInstance
|
//return isAsyncInstance
|
||||||
// ? '.toInstanceAsync(($fnArgs) => $methodName($fnArgs))'
|
// ? '.toInstanceAsync(($fnArgs) => $methodName($fnArgs))'
|
||||||
// : '.toInstance(($fnArgs) => $methodName($fnArgs))';
|
// : '.toInstance(($fnArgs) => $methodName($fnArgs))';
|
||||||
@@ -189,20 +190,24 @@ class BindSpec {
|
|||||||
case BindingType.provide:
|
case BindingType.provide:
|
||||||
if (isAsyncProvide) {
|
if (isAsyncProvide) {
|
||||||
if (needsMultiline) {
|
if (needsMultiline) {
|
||||||
final lambdaIndent =
|
final lambdaIndent = (isSingleton || named != null)
|
||||||
(isSingleton || named != null) ? indent + 6 : indent + 2;
|
? indent + 6
|
||||||
final closingIndent =
|
: indent + 2;
|
||||||
(isSingleton || named != null) ? indent + 4 : indent;
|
final closingIndent = (isSingleton || named != null)
|
||||||
|
? indent + 4
|
||||||
|
: indent;
|
||||||
return '.toProvideAsync(\n${' ' * lambdaIndent}() => $methodName($argsStr),\n${' ' * closingIndent})';
|
return '.toProvideAsync(\n${' ' * lambdaIndent}() => $methodName($argsStr),\n${' ' * closingIndent})';
|
||||||
} else {
|
} else {
|
||||||
return '.toProvideAsync(() => $methodName($argsStr))';
|
return '.toProvideAsync(() => $methodName($argsStr))';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (needsMultiline) {
|
if (needsMultiline) {
|
||||||
final lambdaIndent =
|
final lambdaIndent = (isSingleton || named != null)
|
||||||
(isSingleton || named != null) ? indent + 6 : indent + 2;
|
? indent + 6
|
||||||
final closingIndent =
|
: indent + 2;
|
||||||
(isSingleton || named != null) ? indent + 4 : indent;
|
final closingIndent = (isSingleton || named != null)
|
||||||
|
? indent + 4
|
||||||
|
: indent;
|
||||||
return '.toProvide(\n${' ' * lambdaIndent}() => $methodName($argsStr),\n${' ' * closingIndent})';
|
return '.toProvide(\n${' ' * lambdaIndent}() => $methodName($argsStr),\n${' ' * closingIndent})';
|
||||||
} else {
|
} else {
|
||||||
return '.toProvide(() => $methodName($argsStr))';
|
return '.toProvide(() => $methodName($argsStr))';
|
||||||
@@ -246,7 +251,7 @@ class BindSpec {
|
|||||||
/// print(bindSpec.returnType); // e.g., 'Logger'
|
/// print(bindSpec.returnType); // e.g., 'Logger'
|
||||||
/// ```
|
/// ```
|
||||||
/// Throws [AnnotationValidationException] or [CodeGenerationException] if invalid.
|
/// Throws [AnnotationValidationException] or [CodeGenerationException] if invalid.
|
||||||
static BindSpec fromMethod(MethodElement method) {
|
static BindSpec fromMethod(MethodElement2 method) {
|
||||||
try {
|
try {
|
||||||
// Validate method annotations
|
// Validate method annotations
|
||||||
AnnotationValidator.validateMethodAnnotations(method);
|
AnnotationValidator.validateMethodAnnotations(method);
|
||||||
@@ -254,28 +259,44 @@ class BindSpec {
|
|||||||
// Parse return type using improved type parser
|
// Parse return type using improved type parser
|
||||||
final parsedReturnType = TypeParser.parseType(method.returnType, method);
|
final parsedReturnType = TypeParser.parseType(method.returnType, method);
|
||||||
|
|
||||||
final methodName = method.displayName;
|
final methodName = method.firstFragment.name2 ?? '';
|
||||||
|
|
||||||
// Check for @singleton annotation.
|
// 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.
|
// Get @named value if present.
|
||||||
final named = MetadataUtils.getNamedValue(method.metadata);
|
final named = MetadataUtils.getNamedValue(
|
||||||
|
method.firstFragment.metadata2.annotations,
|
||||||
|
);
|
||||||
|
|
||||||
// Parse each method parameter.
|
// Parse each method parameter.
|
||||||
final params = <BindParameterSpec>[];
|
final params = <BindParameterSpec>[];
|
||||||
bool hasParams = false;
|
bool hasParams = false;
|
||||||
for (final p in method.parameters) {
|
for (final p in method.formalParameters) {
|
||||||
final typeStr = p.type.getDisplayString();
|
final typeStr = p.type.getDisplayString();
|
||||||
final paramNamed = MetadataUtils.getNamedValue(p.metadata);
|
final paramNamed = MetadataUtils.getNamedValue(
|
||||||
final isParams = MetadataUtils.anyMeta(p.metadata, 'params');
|
p.firstFragment.metadata2.annotations,
|
||||||
|
);
|
||||||
|
final isParams = MetadataUtils.anyMeta(
|
||||||
|
p.firstFragment.metadata2.annotations,
|
||||||
|
'params',
|
||||||
|
);
|
||||||
if (isParams) hasParams = true;
|
if (isParams) hasParams = true;
|
||||||
params.add(BindParameterSpec(typeStr, paramNamed, isParams: isParams));
|
params.add(BindParameterSpec(typeStr, paramNamed, isParams: isParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine bindingType: @instance or @provide.
|
// Determine bindingType: @instance or @provide.
|
||||||
final hasInstance = MetadataUtils.anyMeta(method.metadata, 'instance');
|
final hasInstance = MetadataUtils.anyMeta(
|
||||||
final hasProvide = MetadataUtils.anyMeta(method.metadata, 'provide');
|
method.firstFragment.metadata2.annotations,
|
||||||
|
'instance',
|
||||||
|
);
|
||||||
|
final hasProvide = MetadataUtils.anyMeta(
|
||||||
|
method.firstFragment.metadata2.annotations,
|
||||||
|
'provide',
|
||||||
|
);
|
||||||
|
|
||||||
if (!hasInstance && !hasProvide) {
|
if (!hasInstance && !hasProvide) {
|
||||||
throw AnnotationValidationException(
|
throw AnnotationValidationException(
|
||||||
@@ -290,8 +311,9 @@ class BindSpec {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final bindingType =
|
final bindingType = hasInstance
|
||||||
hasInstance ? BindingType.instance : BindingType.provide;
|
? BindingType.instance
|
||||||
|
: BindingType.provide;
|
||||||
|
|
||||||
// PROHIBIT @params with @instance bindings!
|
// PROHIBIT @params with @instance bindings!
|
||||||
if (bindingType == BindingType.instance && hasParams) {
|
if (bindingType == BindingType.instance && hasParams) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
// limitations under the License.
|
// 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';
|
import 'package:source_gen/source_gen.dart';
|
||||||
|
|
||||||
/// ---------------------------------------------------------------------------
|
/// ---------------------------------------------------------------------------
|
||||||
@@ -48,21 +48,21 @@ class CherryPickGeneratorException extends InvalidGenerationSourceError {
|
|||||||
|
|
||||||
CherryPickGeneratorException(
|
CherryPickGeneratorException(
|
||||||
String message, {
|
String message, {
|
||||||
required Element element,
|
required Element2 element,
|
||||||
required this.category,
|
required this.category,
|
||||||
this.suggestion,
|
this.suggestion,
|
||||||
this.context,
|
this.context,
|
||||||
}) : super(
|
}) : super(
|
||||||
_formatMessage(message, category, suggestion, context, element),
|
_formatMessage(message, category, suggestion, context, element),
|
||||||
element: element,
|
element: element,
|
||||||
);
|
);
|
||||||
|
|
||||||
static String _formatMessage(
|
static String _formatMessage(
|
||||||
String message,
|
String message,
|
||||||
String category,
|
String category,
|
||||||
String? suggestion,
|
String? suggestion,
|
||||||
Map<String, dynamic>? context,
|
Map<String, dynamic>? context,
|
||||||
Element element,
|
Element2 element,
|
||||||
) {
|
) {
|
||||||
final buffer = StringBuffer();
|
final buffer = StringBuffer();
|
||||||
|
|
||||||
@@ -74,7 +74,9 @@ class CherryPickGeneratorException extends InvalidGenerationSourceError {
|
|||||||
buffer.writeln('Context:');
|
buffer.writeln('Context:');
|
||||||
buffer.writeln(' Element: ${element.displayName}');
|
buffer.writeln(' Element: ${element.displayName}');
|
||||||
buffer.writeln(' Type: ${element.runtimeType}');
|
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 to show enclosing element info for extra context
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import 'package:analyzer/dart/element/element.dart';
|
import 'package:analyzer/dart/element/element.dart';
|
||||||
|
import 'package:analyzer/dart/element/element2.dart';
|
||||||
import 'bind_spec.dart';
|
import 'bind_spec.dart';
|
||||||
|
|
||||||
/// ---------------------------------------------------------------------------
|
/// ---------------------------------------------------------------------------
|
||||||
@@ -75,14 +76,11 @@ class GeneratedClass {
|
|||||||
/// final gen = GeneratedClass.fromClassElement(classElement);
|
/// final gen = GeneratedClass.fromClassElement(classElement);
|
||||||
/// print(gen.generatedClassName); // e.g. $AppModule
|
/// print(gen.generatedClassName); // e.g. $AppModule
|
||||||
/// ```
|
/// ```
|
||||||
static GeneratedClass fromClassElement(ClassElement element) {
|
static GeneratedClass fromClassElement(ClassElement2 element) {
|
||||||
final className = element.displayName;
|
final className = element.firstFragment.name2 ?? '';
|
||||||
// Generated class name with '$' prefix (standard for generated Dart code).
|
|
||||||
final generatedClassName = r'$' + className;
|
final generatedClassName = r'$' + className;
|
||||||
// Get source file name
|
final sourceFile = element.firstFragment.libraryFragment.source.shortName;
|
||||||
final sourceFile = element.source.shortName;
|
final binds = element.methods2
|
||||||
// Collect bindings for all non-abstract methods.
|
|
||||||
final binds = element.methods
|
|
||||||
.where((m) => !m.isAbstract)
|
.where((m) => !m.isAbstract)
|
||||||
.map(BindSpec.fromMethod)
|
.map(BindSpec.fromMethod)
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
@@ -41,14 +41,16 @@ class MetadataUtils {
|
|||||||
/// bool isSingleton = MetadataUtils.anyMeta(myMethod.metadata, 'singleton');
|
/// bool isSingleton = MetadataUtils.anyMeta(myMethod.metadata, 'singleton');
|
||||||
/// ```
|
/// ```
|
||||||
static bool anyMeta(List<ElementAnnotation> meta, String typeName) {
|
static bool anyMeta(List<ElementAnnotation> meta, String typeName) {
|
||||||
return meta.any((m) =>
|
return meta.any(
|
||||||
m
|
(m) =>
|
||||||
.computeConstantValue()
|
m
|
||||||
?.type
|
.computeConstantValue()
|
||||||
?.getDisplayString()
|
?.type
|
||||||
.toLowerCase()
|
?.getDisplayString()
|
||||||
.contains(typeName.toLowerCase()) ??
|
.toLowerCase()
|
||||||
false);
|
.contains(typeName.toLowerCase()) ??
|
||||||
|
false,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extracts the string value from a `@named('value')` annotation if present in [meta].
|
/// Extracts the string value from a `@named('value')` annotation if present in [meta].
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
// limitations under the License.
|
// 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/nullability_suffix.dart';
|
||||||
import 'package:analyzer/dart/element/type.dart';
|
import 'package:analyzer/dart/element/type.dart';
|
||||||
import 'exceptions.dart';
|
import 'exceptions.dart';
|
||||||
@@ -45,7 +45,7 @@ class TypeParser {
|
|||||||
/// final parsed = TypeParser.parseType(field.type, field);
|
/// final parsed = TypeParser.parseType(field.type, field);
|
||||||
/// if (parsed.isNullable) print('Field is nullable');
|
/// if (parsed.isNullable) print('Field is nullable');
|
||||||
/// ```
|
/// ```
|
||||||
static ParsedType parseType(DartType dartType, Element context) {
|
static ParsedType parseType(DartType dartType, Element2 context) {
|
||||||
try {
|
try {
|
||||||
return _parseTypeInternal(dartType, context);
|
return _parseTypeInternal(dartType, context);
|
||||||
} catch (e) {
|
} 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 displayString = dartType.getDisplayString();
|
||||||
final isNullable = dartType.nullabilitySuffix == NullabilitySuffix.question;
|
final isNullable = dartType.nullabilitySuffix == NullabilitySuffix.question;
|
||||||
|
|
||||||
@@ -87,7 +87,10 @@ class TypeParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ParsedType _parseFutureType(
|
static ParsedType _parseFutureType(
|
||||||
DartType dartType, Element context, bool isNullable) {
|
DartType dartType,
|
||||||
|
Element2 context,
|
||||||
|
bool isNullable,
|
||||||
|
) {
|
||||||
if (dartType is! ParameterizedType || dartType.typeArguments.isEmpty) {
|
if (dartType is! ParameterizedType || dartType.typeArguments.isEmpty) {
|
||||||
throw TypeParsingException(
|
throw TypeParsingException(
|
||||||
'Future type must have a type argument',
|
'Future type must have a type argument',
|
||||||
@@ -112,7 +115,10 @@ class TypeParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ParsedType _parseGenericType(
|
static ParsedType _parseGenericType(
|
||||||
ParameterizedType dartType, Element context, bool isNullable) {
|
ParameterizedType dartType,
|
||||||
|
Element2 context,
|
||||||
|
bool isNullable,
|
||||||
|
) {
|
||||||
final typeArguments = dartType.typeArguments
|
final typeArguments = dartType.typeArguments
|
||||||
.map((arg) => _parseTypeInternal(arg, context))
|
.map((arg) => _parseTypeInternal(arg, context))
|
||||||
.toList();
|
.toList();
|
||||||
@@ -138,7 +144,7 @@ class TypeParser {
|
|||||||
/// final parsed = TypeParser.parseType(field.type, field);
|
/// final parsed = TypeParser.parseType(field.type, field);
|
||||||
/// TypeParser.validateInjectableType(parsed, field);
|
/// TypeParser.validateInjectableType(parsed, field);
|
||||||
/// ```
|
/// ```
|
||||||
static void validateInjectableType(ParsedType parsedType, Element context) {
|
static void validateInjectableType(ParsedType parsedType, Element2 context) {
|
||||||
// Check for void type
|
// Check for void type
|
||||||
if (parsedType.coreType == 'void') {
|
if (parsedType.coreType == 'void') {
|
||||||
throw TypeParsingException(
|
throw TypeParsingException(
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ name: cherrypick_generator
|
|||||||
description: |
|
description: |
|
||||||
Source code generator for the cherrypick dependency injection system. Processes annotations to generate binding and module code for Dart & Flutter projects.
|
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
|
version: 3.0.2-dev.0
|
||||||
homepage: https://cherrypick-di.dev/
|
homepage: https://cherrypick-di.netlify.app
|
||||||
documentation: https://cherrypick-di.dev/docs/intro
|
documentation: https://cherrypick-di.netlify.app/docs/intro
|
||||||
repository: https://github.com/pese-git/cherrypick/cherrypick_generator
|
repository: https://github.com/pese-git/cherrypick/cherrypick_generator
|
||||||
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
||||||
topics:
|
topics:
|
||||||
@@ -15,20 +15,20 @@ topics:
|
|||||||
- inversion-of-control
|
- inversion-of-control
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.5.2 <4.0.0"
|
sdk: ">=3.8.0 <4.0.0"
|
||||||
|
|
||||||
# Add regular dependencies here.
|
# Add regular dependencies here.
|
||||||
dependencies:
|
dependencies:
|
||||||
cherrypick_annotations: ^3.0.0-dev.0
|
cherrypick_annotations: ^3.0.2-dev.0
|
||||||
analyzer: ^7.0.0
|
analyzer: ">=7.5.9 <8.0.0"
|
||||||
dart_style: ^3.0.0
|
dart_style: ^3.0.0
|
||||||
build: ^2.4.1
|
build: ^3.0.0
|
||||||
source_gen: ^2.0.0
|
source_gen: ^3.1.0
|
||||||
collection: ^1.18.0
|
collection: ^1.18.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
lints: ^4.0.0
|
lints: ^6.0.0
|
||||||
mockito: ^5.4.4
|
mockito: ^5.4.5
|
||||||
test: ^1.25.8
|
test: ^1.25.8
|
||||||
build_test: ^2.1.7
|
build_test: ^3.0.0
|
||||||
build_runner: ^2.4.13
|
build_runner: ^2.5.0
|
||||||
|
|||||||
@@ -480,9 +480,10 @@ void notAClass() {}
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should generate empty mixin for class without @inject fields',
|
test(
|
||||||
() async {
|
'should generate empty mixin for class without @inject fields',
|
||||||
const input = '''
|
() async {
|
||||||
|
const input = '''
|
||||||
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
|
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
|
||||||
|
|
||||||
part 'test_widget.inject.cherrypick.g.dart';
|
part 'test_widget.inject.cherrypick.g.dart';
|
||||||
@@ -494,7 +495,7 @@ class TestWidget {
|
|||||||
}
|
}
|
||||||
''';
|
''';
|
||||||
|
|
||||||
const expectedOutput = '''
|
const expectedOutput = '''
|
||||||
// dart format width=80
|
// dart format width=80
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
@@ -509,8 +510,9 @@ mixin _\$TestWidget {
|
|||||||
}
|
}
|
||||||
''';
|
''';
|
||||||
|
|
||||||
await _testGeneration(input, expectedOutput);
|
await _testGeneration(input, expectedOutput);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
group('Edge Cases', () {
|
group('Edge Cases', () {
|
||||||
@@ -593,12 +595,8 @@ mixin _\$TestWidget {
|
|||||||
Future<void> _testGeneration(String input, String expectedOutput) async {
|
Future<void> _testGeneration(String input, String expectedOutput) async {
|
||||||
await testBuilder(
|
await testBuilder(
|
||||||
injectBuilder(BuilderOptions.empty),
|
injectBuilder(BuilderOptions.empty),
|
||||||
{
|
{'a|lib/test_widget.dart': input},
|
||||||
'a|lib/test_widget.dart': input,
|
outputs: {'a|lib/test_widget.inject.cherrypick.g.dart': expectedOutput},
|
||||||
},
|
readerWriter: TestReaderWriter(),
|
||||||
outputs: {
|
|
||||||
'a|lib/test_widget.inject.cherrypick.g.dart': expectedOutput,
|
|
||||||
},
|
|
||||||
reader: await PackageAssetReader.currentIsolate(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -590,9 +590,10 @@ void notAClass() {}
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should throw error for method without @instance or @provide',
|
test(
|
||||||
() async {
|
'should throw error for method without @instance or @provide',
|
||||||
const input = '''
|
() async {
|
||||||
|
const input = '''
|
||||||
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
|
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
|
||||||
import 'package:cherrypick/cherrypick.dart';
|
import 'package:cherrypick/cherrypick.dart';
|
||||||
|
|
||||||
@@ -604,11 +605,12 @@ abstract class TestModule extends Module {
|
|||||||
}
|
}
|
||||||
''';
|
''';
|
||||||
|
|
||||||
await expectLater(
|
await expectLater(
|
||||||
() => _testGeneration(input, ''),
|
() => _testGeneration(input, ''),
|
||||||
throwsA(isA<InvalidGenerationSourceError>()),
|
throwsA(isA<InvalidGenerationSourceError>()),
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
test('should throw error for @params with @instance', () async {
|
test('should throw error for @params with @instance', () async {
|
||||||
const input = '''
|
const input = '''
|
||||||
@@ -637,12 +639,8 @@ abstract class TestModule extends Module {
|
|||||||
Future<void> _testGeneration(String input, String expectedOutput) async {
|
Future<void> _testGeneration(String input, String expectedOutput) async {
|
||||||
await testBuilder(
|
await testBuilder(
|
||||||
moduleBuilder(BuilderOptions.empty),
|
moduleBuilder(BuilderOptions.empty),
|
||||||
{
|
{'a|lib/test_module.dart': input},
|
||||||
'a|lib/test_module.dart': input,
|
outputs: {'a|lib/test_module.module.cherrypick.g.dart': expectedOutput},
|
||||||
},
|
readerWriter: TestReaderWriter(),
|
||||||
outputs: {
|
|
||||||
'a|lib/test_module.module.cherrypick.g.dart': expectedOutput,
|
|
||||||
},
|
|
||||||
reader: await PackageAssetReader.currentIsolate(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
|
import 'package:analyzer/dart/element/element2.dart';
|
||||||
import 'package:test/test.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/type_parser.dart';
|
||||||
import 'package:cherrypick_generator/src/exceptions.dart';
|
import 'package:cherrypick_generator/src/exceptions.dart';
|
||||||
|
|
||||||
@@ -42,7 +41,9 @@ void main() {
|
|||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => TypeParser.validateInjectableType(
|
() => TypeParser.validateInjectableType(
|
||||||
parsedType, _createMockElement()),
|
parsedType,
|
||||||
|
_createMockElement(),
|
||||||
|
),
|
||||||
throwsA(isA<TypeParsingException>()),
|
throwsA(isA<TypeParsingException>()),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -59,7 +60,9 @@ void main() {
|
|||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => TypeParser.validateInjectableType(
|
() => TypeParser.validateInjectableType(
|
||||||
parsedType, _createMockElement()),
|
parsedType,
|
||||||
|
_createMockElement(),
|
||||||
|
),
|
||||||
throwsA(isA<TypeParsingException>()),
|
throwsA(isA<TypeParsingException>()),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -76,7 +79,9 @@ void main() {
|
|||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => TypeParser.validateInjectableType(
|
() => TypeParser.validateInjectableType(
|
||||||
parsedType, _createMockElement()),
|
parsedType,
|
||||||
|
_createMockElement(),
|
||||||
|
),
|
||||||
returnsNormally,
|
returnsNormally,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -159,19 +164,21 @@ void main() {
|
|||||||
expect(parsedType.resolveMethodName, equals('resolveAsync'));
|
expect(parsedType.resolveMethodName, equals('resolveAsync'));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should return correct resolveMethodName for nullable async types',
|
test(
|
||||||
() {
|
'should return correct resolveMethodName for nullable async types',
|
||||||
final parsedType = ParsedType(
|
() {
|
||||||
displayString: 'Future<String?>',
|
final parsedType = ParsedType(
|
||||||
coreType: 'String',
|
displayString: 'Future<String?>',
|
||||||
isNullable: true,
|
coreType: 'String',
|
||||||
isFuture: true,
|
isNullable: true,
|
||||||
isGeneric: false,
|
isFuture: true,
|
||||||
typeArguments: [],
|
isGeneric: false,
|
||||||
);
|
typeArguments: [],
|
||||||
|
);
|
||||||
|
|
||||||
expect(parsedType.resolveMethodName, equals('tryResolveAsync'));
|
expect(parsedType.resolveMethodName, equals('tryResolveAsync'));
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
test('should implement equality correctly', () {
|
test('should implement equality correctly', () {
|
||||||
final parsedType1 = ParsedType(
|
final parsedType1 = ParsedType(
|
||||||
@@ -216,19 +223,19 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mock element for testing
|
// Mock element for testing
|
||||||
Element _createMockElement() {
|
Element2 _createMockElement() {
|
||||||
return _MockElement();
|
return _MockElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MockElement implements Element {
|
class _MockElement implements Element2 {
|
||||||
@override
|
@override
|
||||||
String get displayName => 'MockElement';
|
String get displayName => 'MockElement';
|
||||||
|
|
||||||
@override
|
//@override
|
||||||
String get name => 'MockElement';
|
//String get name => 'MockElement';
|
||||||
|
//
|
||||||
@override
|
//@override
|
||||||
Source? get source => null;
|
//Source? get source => null;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
|
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
|
||||||
|
|||||||
BIN
doc/assets/cherrypick-banner.jpg
Normal file
BIN
doc/assets/cherrypick-banner.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 224 KiB |
178
doc/news/cherrypick-3.x_en.md
Normal file
178
doc/news/cherrypick-3.x_en.md
Normal 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/)
|
||||||
180
doc/news/cherrypick-3.x_ru.md
Normal file
180
doc/news/cherrypick-3.x_ru.md
Normal 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
244
doc/presentation_ru.md
Normal 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/)
|
||||||
|
- Готов помочь — пишите, пробуйте, внедряйте!
|
||||||
|
|
||||||
@@ -9,11 +9,7 @@ void main() {
|
|||||||
// Создаем модуль, который будет предоставлять UseCase
|
// Создаем модуль, который будет предоставлять UseCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
runApp(
|
runApp(const CherryPickProvider(child: MyApp()));
|
||||||
const CherryPickProvider(
|
|
||||||
child: MyApp(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
@@ -21,10 +17,6 @@ class MyApp extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CherryPickProvider(
|
return CherryPickProvider(child: MaterialApp(home: MyHomePage()));
|
||||||
child: MaterialApp(
|
|
||||||
home: MyHomePage(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,12 +11,8 @@ class MyHomePage extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
//_inject(context); // Make sure this function is called in context
|
//_inject(context); // Make sure this function is called in context
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(title: const Text('Example App')),
|
||||||
title: const Text('Example App'),
|
body: Center(child: Text(useCase.fetchData())),
|
||||||
),
|
|
||||||
body: Center(
|
|
||||||
child: Text(useCase.fetchData()),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: _fe_analyzer_shared
|
name: _fe_analyzer_shared
|
||||||
sha256: e55636ed79578b9abca5fecf9437947798f5ef7456308b5cb85720b793eac92f
|
sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "82.0.0"
|
version: "85.0.0"
|
||||||
analyzer:
|
analyzer:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: analyzer
|
name: analyzer
|
||||||
sha256: "904ae5bb474d32c38fb9482e2d925d5454cda04ddd0e55d2e6826bc72f6ba8c0"
|
sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.4.5"
|
version: "7.7.1"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -29,10 +29,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
|
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.12.0"
|
version: "2.13.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -45,50 +45,50 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build
|
name: build
|
||||||
sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
|
sha256: ce76b1d48875e3233fde17717c23d1f60a91cc631597e49a400c89b475395b1d
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.2"
|
version: "3.1.0"
|
||||||
build_config:
|
build_config:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_config
|
name: build_config
|
||||||
sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1
|
sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.2.0"
|
||||||
build_daemon:
|
build_daemon:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_daemon
|
name: build_daemon
|
||||||
sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9"
|
sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.0.4"
|
||||||
build_resolvers:
|
build_resolvers:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_resolvers
|
name: build_resolvers
|
||||||
sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0
|
sha256: d1d57f7807debd7349b4726a19fd32ec8bc177c71ad0febf91a20f84cd2d4b46
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.4"
|
version: "3.0.3"
|
||||||
build_runner:
|
build_runner:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: build_runner
|
name: build_runner
|
||||||
sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99"
|
sha256: b24597fceb695969d47025c958f3837f9f0122e237c6a22cb082a5ac66c3ca30
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.15"
|
version: "2.7.1"
|
||||||
build_runner_core:
|
build_runner_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_runner_core
|
name: build_runner_core
|
||||||
sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
|
sha256: "066dda7f73d8eb48ba630a55acb50c4a84a2e6b453b1cb4567f581729e794f7b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.0.0"
|
version: "9.3.1"
|
||||||
built_collection:
|
built_collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -101,10 +101,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: built_value
|
name: built_value
|
||||||
sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4
|
sha256: a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.9.5"
|
version: "8.12.0"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -117,38 +117,38 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: checked_yaml
|
name: checked_yaml
|
||||||
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
|
sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.4"
|
||||||
cherrypick:
|
cherrypick:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../../cherrypick"
|
path: "../../cherrypick"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "3.0.0-dev.12"
|
version: "3.0.1"
|
||||||
cherrypick_annotations:
|
cherrypick_annotations:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../../cherrypick_annotations"
|
path: "../../cherrypick_annotations"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "1.1.2-dev.2"
|
version: "3.0.1"
|
||||||
cherrypick_flutter:
|
cherrypick_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../../cherrypick_flutter"
|
path: "../../cherrypick_flutter"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "1.1.3-dev.12"
|
version: "3.0.1"
|
||||||
cherrypick_generator:
|
cherrypick_generator:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
path: "../../cherrypick_generator"
|
path: "../../cherrypick_generator"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "2.0.0-dev.2"
|
version: "3.0.1"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -201,18 +201,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: dart_style
|
name: dart_style
|
||||||
sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac"
|
sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.1.1"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
|
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.2"
|
version: "1.3.3"
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -238,10 +238,10 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_lints
|
name: flutter_lints
|
||||||
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
|
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0"
|
version: "6.0.0"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -271,14 +271,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.2"
|
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:
|
http_multi_server:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -291,10 +283,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: http_parser
|
name: http_parser
|
||||||
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.1.2"
|
||||||
io:
|
io:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -303,14 +295,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.0.5"
|
||||||
js:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: js
|
|
||||||
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.1"
|
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -323,10 +307,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker
|
name: leak_tracker
|
||||||
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
|
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.0.8"
|
version: "10.0.9"
|
||||||
leak_tracker_flutter_testing:
|
leak_tracker_flutter_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -347,10 +331,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: lints
|
name: lints
|
||||||
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
|
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0"
|
version: "6.0.0"
|
||||||
logging:
|
logging:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -427,26 +411,26 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pubspec_parse
|
name: pubspec_parse
|
||||||
sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0"
|
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
version: "1.5.0"
|
||||||
shelf:
|
shelf:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shelf
|
name: shelf
|
||||||
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
|
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.1"
|
version: "1.4.2"
|
||||||
shelf_web_socket:
|
shelf_web_socket:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shelf_web_socket
|
name: shelf_web_socket
|
||||||
sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67
|
sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "3.0.0"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -456,10 +440,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_gen
|
name: source_gen
|
||||||
sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b"
|
sha256: "7b19d6ba131c6eb98bfcbf8d56c1a7002eba438af2e7ae6f8398b2b0f4f381e3"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "3.1.0"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -544,18 +528,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
|
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.3.1"
|
version: "15.0.0"
|
||||||
watcher:
|
watcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: watcher
|
name: watcher
|
||||||
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
|
sha256: "5bf046f41320ac97a469d506261797f35254fa61c641741ef32dacda98b7d39c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.3"
|
||||||
web:
|
web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -589,5 +573,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.3"
|
version: "3.1.3"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.7.0-0 <4.0.0"
|
dart: ">=3.8.0 <4.0.0"
|
||||||
flutter: ">=3.18.0-18.0.pre.54"
|
flutter: ">=3.32.0"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ publish_to: 'none'
|
|||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.5.2 <4.0.0"
|
sdk: ">=3.8.0 <4.0.0"
|
||||||
|
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -25,11 +25,11 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
flutter_lints: ^5.0.0
|
flutter_lints: ^6.0.0
|
||||||
|
|
||||||
cherrypick_generator:
|
cherrypick_generator:
|
||||||
path: ../../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
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ part 'post_model.freezed.dart';
|
|||||||
part 'post_model.g.dart';
|
part 'post_model.g.dart';
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class PostModel with _$PostModel {
|
abstract class PostModel with _$PostModel {
|
||||||
const factory PostModel({
|
const factory PostModel({
|
||||||
required int id,
|
required int id,
|
||||||
required String title,
|
required String title,
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ class PostRepositoryImpl implements PostRepository {
|
|||||||
Future<Either<Exception, List<Post>>> getPosts() async {
|
Future<Either<Exception, List<Post>>> getPosts() async {
|
||||||
try {
|
try {
|
||||||
final posts = await api.getPosts();
|
final posts = await api.getPosts();
|
||||||
return Right(posts
|
return Right(
|
||||||
.map((e) => Post(id: e.id, title: e.title, body: e.body))
|
posts.map((e) => Post(id: e.id, title: e.title, body: e.body)).toList(),
|
||||||
.toList());
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Left(Exception(e.toString()));
|
return Left(Exception(e.toString()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,16 +15,17 @@ abstract class AppModule extends Module {
|
|||||||
@provide()
|
@provide()
|
||||||
@singleton()
|
@singleton()
|
||||||
TalkerDioLoggerSettings talkerDioLoggerSettings() => TalkerDioLoggerSettings(
|
TalkerDioLoggerSettings talkerDioLoggerSettings() => TalkerDioLoggerSettings(
|
||||||
printRequestHeaders: true,
|
printRequestHeaders: true,
|
||||||
printResponseHeaders: true,
|
printResponseHeaders: true,
|
||||||
printResponseMessage: true,
|
printResponseMessage: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
@provide()
|
@provide()
|
||||||
@singleton()
|
@singleton()
|
||||||
TalkerDioLogger talkerDioLogger(
|
TalkerDioLogger talkerDioLogger(
|
||||||
Talker talker, TalkerDioLoggerSettings settings) =>
|
Talker talker,
|
||||||
TalkerDioLogger(talker: talker, settings: settings);
|
TalkerDioLoggerSettings settings,
|
||||||
|
) => TalkerDioLogger(talker: talker, settings: settings);
|
||||||
|
|
||||||
@instance()
|
@instance()
|
||||||
int timeout() => 1000;
|
int timeout() => 1000;
|
||||||
@@ -75,12 +76,14 @@ abstract class AppModule extends Module {
|
|||||||
@provide()
|
@provide()
|
||||||
@named('TestProvideWithParams1')
|
@named('TestProvideWithParams1')
|
||||||
String testProvideWithParams1(
|
String testProvideWithParams1(
|
||||||
@named('baseUrl') String baseUrl, @params() dynamic params) =>
|
@named('baseUrl') String baseUrl,
|
||||||
"hello $params";
|
@params() dynamic params,
|
||||||
|
) => "hello $params";
|
||||||
|
|
||||||
@provide()
|
@provide()
|
||||||
@named('TestProvideAsyncWithParams1')
|
@named('TestProvideAsyncWithParams1')
|
||||||
Future<String> testProvideAsyncWithParams1(
|
Future<String> testProvideAsyncWithParams1(
|
||||||
@named('baseUrl') String baseUrl, @params() dynamic params) async =>
|
@named('baseUrl') String baseUrl,
|
||||||
"hello $params";
|
@params() dynamic params,
|
||||||
|
) async => "hello $params";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
|||||||
part 'post.freezed.dart';
|
part 'post.freezed.dart';
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class Post with _$Post {
|
abstract class Post with _$Post {
|
||||||
const factory Post({
|
const factory Post({
|
||||||
required int id,
|
required int id,
|
||||||
required String title,
|
required String title,
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Используем safe root scope для гарантии защиты
|
// Используем safe root scope для гарантии защиты
|
||||||
CherryPick.openRootScope()
|
CherryPick.openRootScope().installModules([
|
||||||
.installModules([CoreModule(talker: talker), $AppModule()]);
|
CoreModule(talker: talker),
|
||||||
|
$AppModule(),
|
||||||
|
]);
|
||||||
|
|
||||||
runApp(MyApp(
|
runApp(MyApp(talker: talker));
|
||||||
talker: talker,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ class PostDetailsPage extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text('Post #${post.id}')),
|
appBar: AppBar(title: Text('Post #${post.id}')),
|
||||||
body: Padding(
|
body: Padding(padding: const EdgeInsets.all(16), child: Text(post.body)),
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
child: Text(post.body),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,9 @@ class PostsPage extends StatelessWidget {
|
|||||||
title: Text(posts[i].title),
|
title: Text(posts[i].title),
|
||||||
subtitle: Text(posts[i].body),
|
subtitle: Text(posts[i].body),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
AutoRouter.of(context)
|
AutoRouter.of(
|
||||||
.push(PostDetailsRoute(post: posts[i]));
|
context,
|
||||||
|
).push(PostDetailsRoute(post: posts[i]));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import 'app_router.gr.dart';
|
|||||||
class AppRouter extends RootStackRouter {
|
class AppRouter extends RootStackRouter {
|
||||||
@override
|
@override
|
||||||
List<AutoRoute> get routes => [
|
List<AutoRoute> get routes => [
|
||||||
AutoRoute(page: PostsRoute.page, initial: true),
|
AutoRoute(page: PostsRoute.page, initial: true),
|
||||||
AutoRoute(page: PostDetailsRoute.page),
|
AutoRoute(page: PostDetailsRoute.page),
|
||||||
AutoRoute(page: LogsRoute.page),
|
AutoRoute(page: LogsRoute.page),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: _fe_analyzer_shared
|
name: _fe_analyzer_shared
|
||||||
sha256: e55636ed79578b9abca5fecf9437947798f5ef7456308b5cb85720b793eac92f
|
sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "82.0.0"
|
version: "85.0.0"
|
||||||
analyzer:
|
analyzer:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: analyzer
|
name: analyzer
|
||||||
sha256: "904ae5bb474d32c38fb9482e2d925d5454cda04ddd0e55d2e6826bc72f6ba8c0"
|
sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.4.5"
|
version: "7.7.1"
|
||||||
ansi_styles:
|
ansi_styles:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -45,26 +45,26 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
|
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.12.0"
|
version: "2.13.0"
|
||||||
auto_route:
|
auto_route:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: auto_route
|
name: auto_route
|
||||||
sha256: "1d1bd908a1fec327719326d5d0791edd37f16caff6493c01003689fb03315ad7"
|
sha256: c820e918863a03544aac68eaf61e17c8a6126b663d7cad24a8fd3657a1e6be61
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "9.3.0+1"
|
version: "10.1.2"
|
||||||
auto_route_generator:
|
auto_route_generator:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: auto_route_generator
|
name: auto_route_generator
|
||||||
sha256: c2e359d8932986d4d1bcad7a428143f81384ce10fef8d4aa5bc29e1f83766a46
|
sha256: ed4b65e85b4b2b00b06ef1e44c8623985c52c32d05d72147e3201257aa70a115
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "9.3.1"
|
version: "10.2.4"
|
||||||
bloc:
|
bloc:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -85,50 +85,50 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build
|
name: build
|
||||||
sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
|
sha256: ce76b1d48875e3233fde17717c23d1f60a91cc631597e49a400c89b475395b1d
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.2"
|
version: "3.1.0"
|
||||||
build_config:
|
build_config:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_config
|
name: build_config
|
||||||
sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1
|
sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.2.0"
|
||||||
build_daemon:
|
build_daemon:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_daemon
|
name: build_daemon
|
||||||
sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9"
|
sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.0.4"
|
||||||
build_resolvers:
|
build_resolvers:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_resolvers
|
name: build_resolvers
|
||||||
sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0
|
sha256: d1d57f7807debd7349b4726a19fd32ec8bc177c71ad0febf91a20f84cd2d4b46
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.4"
|
version: "3.0.3"
|
||||||
build_runner:
|
build_runner:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: build_runner
|
name: build_runner
|
||||||
sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99"
|
sha256: b24597fceb695969d47025c958f3837f9f0122e237c6a22cb082a5ac66c3ca30
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.15"
|
version: "2.7.1"
|
||||||
build_runner_core:
|
build_runner_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_runner_core
|
name: build_runner_core
|
||||||
sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
|
sha256: "066dda7f73d8eb48ba630a55acb50c4a84a2e6b453b1cb4567f581729e794f7b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.0.0"
|
version: "9.3.1"
|
||||||
built_collection:
|
built_collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -141,10 +141,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: built_value
|
name: built_value
|
||||||
sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4
|
sha256: a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.9.5"
|
version: "8.12.0"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -165,39 +165,47 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: checked_yaml
|
name: checked_yaml
|
||||||
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
|
sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.4"
|
||||||
cherrypick:
|
cherrypick:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../../cherrypick"
|
path: "../../cherrypick"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "3.0.0-dev.12"
|
version: "3.0.1"
|
||||||
cherrypick_annotations:
|
cherrypick_annotations:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../../cherrypick_annotations"
|
path: "../../cherrypick_annotations"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "1.1.2-dev.2"
|
version: "3.0.1"
|
||||||
cherrypick_generator:
|
cherrypick_generator:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
path: "../../cherrypick_generator"
|
path: "../../cherrypick_generator"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
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:
|
cli_launcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: cli_launcher
|
name: cli_launcher
|
||||||
sha256: "67d89e0a1c07b103d1253f6b953a43d3f502ee36805c8cfc21196282c9ddf177"
|
sha256: "17d2744fb9a254c49ec8eda582536abe714ea0131533e24389843a4256f82eac"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.2"
|
version: "0.3.2+1"
|
||||||
cli_util:
|
cli_util:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -234,10 +242,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: conventional_commit
|
name: conventional_commit
|
||||||
sha256: fad254feb6fb8eace2be18855176b0a4b97e0d50e416ff0fe590d5ba83735d34
|
sha256: c40b1b449ce2a63fa2ce852f35e3890b1e182f5951819934c0e4a66254bc0dc3
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.1"
|
version: "0.6.1+1"
|
||||||
convert:
|
convert:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -246,6 +254,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
|
coverage:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: coverage
|
||||||
|
sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.15.0"
|
||||||
cross_file:
|
cross_file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -274,10 +290,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: dart_style
|
name: dart_style
|
||||||
sha256: "5b236382b47ee411741447c1f1e111459c941ea1b3f2b540dde54c210a3662af"
|
sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.1"
|
||||||
dartz:
|
dartz:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -290,10 +306,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: dio
|
name: dio
|
||||||
sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9"
|
sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.8.0+1"
|
version: "5.9.0"
|
||||||
dio_web_adapter:
|
dio_web_adapter:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -306,10 +322,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
|
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.2"
|
version: "1.3.3"
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -348,15 +364,15 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "9.1.1"
|
version: "9.1.1"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_lints
|
name: flutter_lints
|
||||||
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
|
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0"
|
version: "6.0.0"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
@@ -366,21 +382,21 @@ packages:
|
|||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
freezed:
|
freezed:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: freezed
|
name: freezed
|
||||||
sha256: "59a584c24b3acdc5250bb856d0d3e9c0b798ed14a4af1ddb7dc1c7b41df91c9c"
|
sha256: da32f8ba8cfcd4ec71d9decc8cbf28bd2c31b5283d9887eb51eb4a0659d8110c
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.8"
|
version: "3.2.0"
|
||||||
freezed_annotation:
|
freezed_annotation:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: freezed_annotation
|
name: freezed_annotation
|
||||||
sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2
|
sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.4"
|
version: "3.1.0"
|
||||||
frontend_server_client:
|
frontend_server_client:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -413,14 +429,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.3.4"
|
version: "5.3.4"
|
||||||
|
hotreloader:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: hotreloader
|
||||||
|
sha256: bc167a1163807b03bada490bfe2df25b0d744df359227880220a5cbd04e5734b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.3.0"
|
||||||
http:
|
http:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b"
|
sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
version: "1.5.0"
|
||||||
http_multi_server:
|
http_multi_server:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -433,18 +457,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: http_parser
|
name: http_parser
|
||||||
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.1.2"
|
||||||
intl:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: intl
|
|
||||||
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.19.0"
|
|
||||||
io:
|
io:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -457,12 +473,12 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: js
|
name: js
|
||||||
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
|
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.1"
|
version: "0.7.2"
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: json_annotation
|
name: json_annotation
|
||||||
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
|
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
|
||||||
@@ -470,21 +486,21 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "4.9.0"
|
version: "4.9.0"
|
||||||
json_serializable:
|
json_serializable:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: json_serializable
|
name: json_serializable
|
||||||
sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c
|
sha256: "33a040668b31b320aafa4822b7b1e177e163fc3c1e835c6750319d4ab23aa6fe"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.9.5"
|
version: "6.11.1"
|
||||||
leak_tracker:
|
leak_tracker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker
|
name: leak_tracker
|
||||||
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
|
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.0.8"
|
version: "10.0.9"
|
||||||
leak_tracker_flutter_testing:
|
leak_tracker_flutter_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -501,14 +517,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
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:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: lints
|
name: lints
|
||||||
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
|
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0"
|
version: "6.0.0"
|
||||||
logging:
|
logging:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -537,10 +561,10 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: melos
|
name: melos
|
||||||
sha256: "3f3ab3f902843d1e5a1b1a4dd39a4aca8ba1056f2d32fd8995210fa2843f646f"
|
sha256: "4280dc46bd5b741887cce1e67e5c1a6aaf3c22310035cf5bd33dceeeda62ed22"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.3.2"
|
version: "6.3.3"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -573,6 +597,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
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:
|
package_config:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -601,18 +633,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_android
|
name: path_provider_android
|
||||||
sha256: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9
|
sha256: "993381400e94d18469750e5b9dcb8206f15bc09f9da86b9e44a9b0092a0066db"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.17"
|
version: "2.2.18"
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_foundation
|
name: path_provider_foundation
|
||||||
sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"
|
sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.1"
|
version: "2.4.2"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -637,14 +669,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.0"
|
version: "2.3.0"
|
||||||
petitparser:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: petitparser
|
|
||||||
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "6.0.2"
|
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -689,18 +713,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: protobuf
|
name: protobuf
|
||||||
sha256: "579fe5557eae58e3adca2e999e38f02441d8aa908703854a9e0a0f47fa857731"
|
sha256: de9c9eb2c33f8e933a42932fe1dc504800ca45ebc3d673e6ed7f39754ee4053e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.0"
|
version: "4.2.0"
|
||||||
provider:
|
provider:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: provider
|
name: provider
|
||||||
sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84"
|
sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.5"
|
version: "6.1.5+1"
|
||||||
pub_semver:
|
pub_semver:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -713,66 +737,82 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pub_updater
|
name: pub_updater
|
||||||
sha256: "54e8dc865349059ebe7f163d6acce7c89eb958b8047e6d6e80ce93b13d7c9e60"
|
sha256: "739a0161d73a6974c0675b864fb0cf5147305f7b077b7f03a58fa7a9ab3e7e7d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.0"
|
version: "0.5.0"
|
||||||
pubspec_parse:
|
pubspec_parse:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pubspec_parse
|
name: pubspec_parse
|
||||||
sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0"
|
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
version: "1.5.0"
|
||||||
retrofit:
|
retrofit:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: retrofit
|
name: retrofit
|
||||||
sha256: c6cc9ad3374e6d07008343140a67afffaaa34cdf6bf08d4847d91417a99dcf45
|
sha256: "699cf44ec6c7fc7d248740932eca75d334e36bdafe0a8b3e9ff93100591c8a25"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.4.2"
|
version: "4.7.2"
|
||||||
retrofit_generator:
|
retrofit_generator:
|
||||||
dependency: "direct main"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: retrofit_generator
|
name: retrofit_generator
|
||||||
sha256: "65d28d3a7b4db485f1c73fee8ee32f552ef23ee4ecb68ba491f39d80b73bdcbf"
|
sha256: "4a2ac0364eb7d5975f71450dfd553b1591ecffad96438a01ce88494a266bceb4"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "9.2.0"
|
version: "10.0.5"
|
||||||
share_plus:
|
share_plus:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: share_plus
|
name: share_plus
|
||||||
sha256: b2961506569e28948d75ec346c28775bb111986bb69dc6a20754a457e3d97fa0
|
sha256: d7dc0630a923883c6328ca31b89aa682bacbf2f8304162d29f7c6aaff03a27a1
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "11.0.0"
|
version: "11.1.0"
|
||||||
share_plus_platform_interface:
|
share_plus_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: share_plus_platform_interface
|
name: share_plus_platform_interface
|
||||||
sha256: "1032d392bc5d2095a77447a805aa3f804d2ae6a4d5eef5e6ebb3bd94c1bc19ef"
|
sha256: "88023e53a13429bd65d8e85e11a9b484f49d4c190abbd96c7932b74d6927cc9a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.0"
|
version: "6.1.0"
|
||||||
shelf:
|
shelf:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shelf
|
name: shelf
|
||||||
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
|
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
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:
|
shelf_web_socket:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shelf_web_socket
|
name: shelf_web_socket
|
||||||
sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67
|
sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "3.0.0"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -782,18 +822,34 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_gen
|
name: source_gen
|
||||||
sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b"
|
sha256: "7b19d6ba131c6eb98bfcbf8d56c1a7002eba438af2e7ae6f8398b2b0f4f381e3"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "3.1.0"
|
||||||
source_helper:
|
source_helper:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_helper
|
name: source_helper
|
||||||
sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c"
|
sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
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:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -846,49 +902,49 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: talker
|
name: talker
|
||||||
sha256: "028a753874d98df39f210cb74f0ee09a0a95e28f8bc2dc975c3c328e24fde23d"
|
sha256: "2d742b54e5cda58b7d386cd2d95088c3429ef273b2a0869dec552fe02601367a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.9.3"
|
version: "5.0.0"
|
||||||
talker_bloc_logger:
|
talker_bloc_logger:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: talker_bloc_logger
|
name: talker_bloc_logger
|
||||||
sha256: cf1e3b1d70f9a47e061288f0d230ba0e04a0f6394629d5df1c7b0933b236e397
|
sha256: "7752ca8a0b2eba487c8c189ca2390ebfcdaa4f7b10eda27587e5067e4427e7cd"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.9.3"
|
version: "5.0.0"
|
||||||
talker_cherrypick_logger:
|
talker_cherrypick_logger:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "../../talker_cherrypick_logger"
|
path: "../../talker_cherrypick_logger"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "1.1.0-dev.7"
|
version: "3.0.1"
|
||||||
talker_dio_logger:
|
talker_dio_logger:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: talker_dio_logger
|
name: talker_dio_logger
|
||||||
sha256: dcf784f1841e248c270ef741f8a07ca9cf562c6424ee43fc6e598c4eb7f18238
|
sha256: "20cc3bc9820fa73040f23e27d5d86462e590ddf02c43d0a801c56bf5ecc68922"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.9.3"
|
version: "5.0.0"
|
||||||
talker_flutter:
|
talker_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: talker_flutter
|
name: talker_flutter
|
||||||
sha256: "2cfee6661277d415a895b6258ecb0bf80d7b564e91ea7e769fc6d0f970a01c09"
|
sha256: d249fa16936a08fe5c4fb9e2b9b122fdcbaef6be9c4dcf61e448d0b76f3179f1
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.9.3"
|
version: "5.0.0"
|
||||||
talker_logger:
|
talker_logger:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: talker_logger
|
name: talker_logger
|
||||||
sha256: "778ec673f1b71a6516e5576ae8d90ea23bbbcf9f405a97cc30e8ccdc33e26d27"
|
sha256: "4f06d46db664c11cf4d629378da661f2c75aee629e3ef898dbc3cf44a0c41cd7"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.9.3"
|
version: "5.0.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -897,6 +953,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.2"
|
version: "1.2.2"
|
||||||
|
test:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: test
|
||||||
|
sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.25.15"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -905,6 +969,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.4"
|
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:
|
timing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -973,18 +1045,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
|
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.3.1"
|
version: "15.0.0"
|
||||||
watcher:
|
watcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: watcher
|
name: watcher
|
||||||
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
|
sha256: "5bf046f41320ac97a469d506261797f35254fa61c641741ef32dacda98b7d39c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.3"
|
||||||
web:
|
web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1009,14 +1081,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.3"
|
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:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba"
|
sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.13.0"
|
version: "5.14.0"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1025,14 +1105,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
xml:
|
xxh3:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: xml
|
name: xxh3
|
||||||
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
|
sha256: "399a0438f5d426785723c99da6b16e136f4953fb1e9db0bf270bd41dd4619916"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.5.0"
|
version: "1.2.0"
|
||||||
yaml:
|
yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1050,5 +1130,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.2"
|
version: "2.2.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.7.0 <4.0.0"
|
dart: ">=3.8.0 <4.0.0"
|
||||||
flutter: ">=3.27.0"
|
flutter: ">=3.32.0"
|
||||||
|
|||||||
@@ -5,49 +5,47 @@ publish_to: 'none'
|
|||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.2
|
sdk: ">=3.8.0 <4.0.0"
|
||||||
|
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
cherrypick:
|
cherrypick: any
|
||||||
path: ../../cherrypick
|
cherrypick_annotations: ^3.0.2-dev.0
|
||||||
cherrypick_annotations:
|
|
||||||
path: ../../cherrypick_annotations
|
|
||||||
|
|
||||||
dio: ^5.4.0
|
dio: ^5.4.0
|
||||||
retrofit: ^4.0.3
|
retrofit: ^4.0.3
|
||||||
freezed_annotation: ^2.4.4
|
freezed_annotation: ^3.0.0
|
||||||
|
json_annotation: ^4.9.0
|
||||||
dartz: ^0.10.1
|
dartz: ^0.10.1
|
||||||
flutter_bloc: ^9.1.1
|
flutter_bloc: ^9.1.1
|
||||||
auto_route: ^9.3.0+1
|
auto_route: ^10.1.0+1
|
||||||
|
|
||||||
|
|
||||||
cupertino_icons: ^1.0.8
|
cupertino_icons: ^1.0.8
|
||||||
|
|
||||||
talker_flutter: ^4.9.3
|
talker_flutter: ^5.0.0
|
||||||
talker_cherrypick_logger:
|
talker_cherrypick_logger: any
|
||||||
path: ../../talker_cherrypick_logger
|
talker_dio_logger: ^5.0.0
|
||||||
|
talker_bloc_logger: ^5.0.0
|
||||||
|
|
||||||
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
flutter_lints: ^5.0.0
|
flutter_lints: ^6.0.0
|
||||||
|
|
||||||
cherrypick_generator:
|
build_runner: ^2.5.0
|
||||||
path: ../../cherrypick_generator
|
cherrypick_generator: ^3.0.2-dev.0
|
||||||
build_runner: 2.4.15
|
|
||||||
|
|
||||||
retrofit_generator: ^9.1.5
|
|
||||||
freezed: ^2.5.8
|
|
||||||
json_serializable: ^6.9.0
|
json_serializable: ^6.9.0
|
||||||
auto_route_generator: ^9.0.0
|
retrofit_generator: ^10.0.5
|
||||||
talker_dio_logger: ^4.9.3
|
auto_route_generator: ^10.0.1
|
||||||
talker_bloc_logger: ^4.9.3
|
freezed: ^3.0.0
|
||||||
|
melos: ^6.3.2
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
|
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
dev_dependencies:
|
|
||||||
melos: ^6.3.2
|
|
||||||
|
|||||||
31
melos.yaml
31
melos.yaml
@@ -13,6 +13,28 @@ packages:
|
|||||||
- examples/postly
|
- examples/postly
|
||||||
|
|
||||||
scripts:
|
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:
|
analyze:
|
||||||
exec: dart analyze
|
exec: dart analyze
|
||||||
|
|
||||||
@@ -20,11 +42,10 @@ scripts:
|
|||||||
exec: dart format lib
|
exec: dart format lib
|
||||||
|
|
||||||
test:
|
test:
|
||||||
run: |
|
steps:
|
||||||
echo "Running Dart tests..."
|
- test:dart
|
||||||
melos exec --scope="cherrypick,cherrypick_annotations,cherrypick_generator" -- dart test --reporter=compact
|
- test:flutter
|
||||||
echo "Running Flutter tests..."
|
description: Run all tests.
|
||||||
melos exec --scope="cherrypick_flutter" -- flutter test --reporter=compact
|
|
||||||
|
|
||||||
test:dart:
|
test:dart:
|
||||||
description: "Run tests for Dart packages only"
|
description: "Run tests for Dart packages only"
|
||||||
|
|||||||
345
pubspec.lock
345
pubspec.lock
@@ -1,27 +1,6 @@
|
|||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
packages:
|
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:
|
ansi_styles:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -46,38 +25,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.13.0"
|
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:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -94,22 +41,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
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:
|
cli_launcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: cli_launcher
|
name: cli_launcher
|
||||||
sha256: "5e7e0282b79e8642edd6510ee468ae2976d847a0a29b3916e85f5fa1bfe24005"
|
sha256: "67d89e0a1c07b103d1253f6b953a43d3f502ee36805c8cfc21196282c9ddf177"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.1"
|
version: "0.3.2"
|
||||||
cli_util:
|
cli_util:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -126,14 +65,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
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:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -146,42 +77,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: conventional_commit
|
name: conventional_commit
|
||||||
sha256: dec15ad1118f029c618651a4359eb9135d8b88f761aa24e4016d061cd45948f2
|
sha256: fad254feb6fb8eace2be18855176b0a4b97e0d50e416ff0fe590d5ba83735d34
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.0+1"
|
version: "0.6.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"
|
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -190,22 +89,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.1"
|
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:
|
glob:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -226,18 +109,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f
|
sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.5.0"
|
||||||
http_multi_server:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: http_multi_server
|
|
||||||
sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.2.2"
|
|
||||||
http_parser:
|
http_parser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -262,14 +137,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.0.5"
|
||||||
js:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: js
|
|
||||||
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.1"
|
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -282,34 +149,10 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: lints
|
name: lints
|
||||||
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
|
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "5.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"
|
|
||||||
melos:
|
melos:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@@ -322,26 +165,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0"
|
version: "1.17.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"
|
|
||||||
mustache_template:
|
mustache_template:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -350,22 +177,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
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:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -394,10 +205,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: process
|
name: process
|
||||||
sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d"
|
sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.3"
|
version: "5.0.5"
|
||||||
prompts:
|
prompts:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -426,66 +237,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pubspec_parse
|
name: pubspec_parse
|
||||||
sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0"
|
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
|
||||||
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"
|
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.5.0"
|
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:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -502,14 +257,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.12.1"
|
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:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -526,30 +273,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.2"
|
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:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -558,22 +281,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
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:
|
web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -582,30 +289,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
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:
|
yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -623,4 +306,4 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.2"
|
version: "2.2.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.5.2 <4.0.0"
|
dart: ">=3.6.0 <4.0.0"
|
||||||
|
|||||||
@@ -7,16 +7,11 @@ repository: https://github.com/pese-git/cherrypick
|
|||||||
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.5.2 <4.0.0"
|
sdk: ">=3.2.0 <4.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
meta: ^1.3.0
|
meta: ^1.3.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
#pedantic: ^1.11.0
|
lints: ^5.1.1
|
||||||
|
|
||||||
test: ^1.17.2
|
|
||||||
|
|
||||||
mockito: ^5.0.6
|
|
||||||
lints: ^2.1.0
|
|
||||||
melos: ^6.3.2
|
melos: ^6.3.2
|
||||||
|
|||||||
@@ -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
|
## 1.1.0-dev.7
|
||||||
|
|
||||||
- Update a dependency to the latest release.
|
- Update a dependency to the latest release.
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
[](https://github.com/pese-git/cherrypick/actions/workflows/pipeline.yml)
|
||||||
|
[](https://app.netlify.com/projects/cherrypick-di/deploys)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# talker_cherrypick_logger
|
# 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.
|
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.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
name: talker_cherrypick_logger
|
name: talker_cherrypick_logger
|
||||||
description: A Talker logger integration for CherryPick DI to observe and log DI events and errors.
|
description: A Talker logger integration for CherryPick DI to observe and log DI events and errors.
|
||||||
version: 1.1.0-dev.7
|
version: 3.0.2
|
||||||
homepage: https://cherrypick-di.dev/
|
homepage: https://cherrypick-di.netlify.app
|
||||||
documentation: https://cherrypick-di.dev/docs/intro
|
documentation: https://cherrypick-di.netlify.app/docs/intro
|
||||||
repository: https://github.com/pese-git/cherrypick
|
repository: https://github.com/pese-git/cherrypick
|
||||||
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
||||||
|
|
||||||
@@ -13,14 +13,14 @@ topics:
|
|||||||
- log
|
- log
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.5.2 <4.0.0"
|
sdk: '>=3.2.0 <4.0.0'
|
||||||
|
|
||||||
# Add regular dependencies here.
|
# Add regular dependencies here.
|
||||||
dependencies:
|
dependencies:
|
||||||
talker: ^4.9.3
|
talker: ^5.0.0
|
||||||
cherrypick: ^3.0.0-dev.12
|
cherrypick: ^3.0.2
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
lints: ^5.0.0
|
lints: ^4.0.0
|
||||||
test: ^1.24.0
|
test: ^1.25.6
|
||||||
|
|||||||
Reference in New Issue
Block a user