Compare commits

..

20 Commits

Author SHA1 Message Date
Sergey Penkovsky
a0a0a967a2 chore(release): publish packages
- cherrypick_generator@1.1.0-dev.5
2025-06-04 00:39:25 +03:00
Sergey Penkovsky
a9260e0413 feat: implement tryResolve via generate code 2025-06-04 00:38:23 +03:00
Sergey Penkovsky
dd608031a2 chore(release): publish packages
- cherrypick_generator@1.1.0-dev.4
2025-05-28 01:36:40 +03:00
Sergey Penkovsky
49e3654ab8 fix: fixed warnings 2025-05-28 01:35:46 +03:00
Sergey Penkovsky
bc28ff79ef chore: update deps and up to flutter sdk 3.29.3 and dart >=3.7.0 2025-05-28 00:02:23 +03:00
Sergey Penkovsky
52bc66f2f9 update documentaions 2025-05-23 17:27:40 +03:00
Sergey Penkovsky
79a050d056 update documentaions 2025-05-23 17:23:22 +03:00
Sergey Penkovsky
3beb53a094 update documentations 2025-05-23 17:13:57 +03:00
Sergey Penkovsky
21955640d9 chore(release): publish packages
- cherrypick_annotations@1.1.0-dev.1
 - cherrypick_generator@1.1.0-dev.3
2025-05-23 16:11:08 +03:00
Sergey Penkovsky
a62052daa5 doc: update documentations 2025-05-23 16:10:09 +03:00
Sergey Penkovsky
7dbaa59c01 refactor inject generator 2025-05-23 16:03:29 +03:00
Sergey Penkovsky
8438697107 implement inject generator 2025-05-23 15:26:09 +03:00
Sergey Penkovsky
9c42ba4cef feat: implement InjectGenerator 2025-05-23 14:08:08 +03:00
Sergey Penkovsky
1f6ee172a1 starting implement inject generator 2025-05-23 12:21:23 +03:00
Sergey Penkovsky
161e9085f4 chore(release): publish packages
- cherrypick_generator@1.1.0-dev.2
2025-05-23 08:21:46 +03:00
Sergey Penkovsky
ef49595627 doc: update documentations 2025-05-23 08:21:11 +03:00
Sergey Penkovsky
0fd10488f3 update deps 2025-05-23 08:06:28 +03:00
Sergey Penkovsky
46c2939125 fix: update instance generator code 2025-05-23 08:06:08 +03:00
Sergey Penkovsky
6d5537f068 update pubspec 2025-05-23 00:18:54 +03:00
Sergey Penkovsky
2480757797 update pubspec 2025-05-23 00:17:32 +03:00
32 changed files with 1073 additions and 335 deletions

2
.fvmrc
View File

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

View File

@@ -3,6 +3,95 @@
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-06-04
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`cherrypick_generator` - `v1.1.0-dev.5`](#cherrypick_generator---v110-dev5)
---
#### `cherrypick_generator` - `v1.1.0-dev.5`
- **FEAT**: implement tryResolve via generate code.
## 2025-05-28
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`cherrypick_generator` - `v1.1.0-dev.4`](#cherrypick_generator---v110-dev4)
---
#### `cherrypick_generator` - `v1.1.0-dev.4`
- **FIX**: fixed warnings.
## 2025-05-23
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`cherrypick_annotations` - `v1.1.0-dev.1`](#cherrypick_annotations---v110-dev1)
- [`cherrypick_generator` - `v1.1.0-dev.3`](#cherrypick_generator---v110-dev3)
---
#### `cherrypick_annotations` - `v1.1.0-dev.1`
- **FEAT**: implement InjectGenerator.
#### `cherrypick_generator` - `v1.1.0-dev.3`
- **FEAT**: implement InjectGenerator.
## 2025-05-23
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`cherrypick_generator` - `v1.1.0-dev.2`](#cherrypick_generator---v110-dev2)
---
#### `cherrypick_generator` - `v1.1.0-dev.2`
- **FIX**: update instance generator code.
## 2025-05-22 ## 2025-05-22
### Changes ### Changes

View File

@@ -1,3 +1,7 @@
## 1.1.0-dev.1
- **FEAT**: implement InjectGenerator.
## 1.1.0-dev.0 ## 1.1.0-dev.0
- **FEAT**: implement generator for dynamic params. - **FEAT**: implement generator for dynamic params.

View File

@@ -2,7 +2,7 @@
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
A lightweight set of Dart annotations designed for dependency injection (DI) frameworks and code generation, inspired by modern approaches like Dagger and Injectable. Works best in tandem with [`cherrypick_generator`](https://pub.dev/packages/cherrypick_generator). A lightweight set of Dart annotations for dependency injection (DI) frameworks and code generation, inspired by modern approaches like Dagger and Injectable. Optimized for use with [`cherrypick_generator`](https://pub.dev/packages/cherrypick_generator).
--- ---
@@ -10,10 +10,13 @@ A lightweight set of Dart annotations designed for dependency injection (DI) fra
- **@module** Marks a class as a DI module for service/provider registration. - **@module** Marks a class as a DI module for service/provider registration.
- **@singleton** Declares that a method or class should be provided as a singleton. - **@singleton** Declares that a method or class should be provided as a singleton.
- **@instance** Marks a method or class so that a new instance is provided on each request (not a singleton). - **@instance** Marks a method or class so that a new instance is provided on each request.
- **@provide** Marks a method whose return value should be registered as a provider, supporting dependency injection into parameters. - **@provide** Marks a method whose return value should be registered as a provider, supporting DI into its parameters.
- **@named** Assigns a string name to a binding for keyed resolution. - **@named** Assigns a string name to a binding for keyed resolution and injection.
- **@params** Indicates that a parameter should be injected with runtime-supplied arguments. - **@params** Indicates that a parameter should be injected with runtime-supplied arguments.
- **@injectable** Marks a class as eligible for automatic field injection. Fields annotated with `@inject` will be injected by the code generator.
- **@inject** Marks a field to be automatically injected by the code generator.
- **@scope** Declares the DI scope from which a dependency should be resolved for a field.
These annotations streamline DI configuration and serve as markers for code generation tools such as [`cherrypick_generator`](https://pub.dev/packages/cherrypick_generator). These annotations streamline DI configuration and serve as markers for code generation tools such as [`cherrypick_generator`](https://pub.dev/packages/cherrypick_generator).
@@ -32,18 +35,21 @@ Add as a `dev_dependency` for code generation:
```yaml ```yaml
dev_dependencies: dev_dependencies:
cherrypick_generator: ^latest
build_runner: ^latest build_runner: ^latest
cherrypick_generator:
``` ```
### 2. Annotate your DI modules and providers ---
### 2. Annotate your DI modules, providers, and injectable classes
#### **Module and Provider Example**
```dart ```dart
import 'package:cherrypick_annotations/cherrypick_annotations.dart'; import 'package:cherrypick_annotations/cherrypick_annotations.dart';
import 'package:cherrypick/cherrypick.dart';
@module() @module()
abstract class AppModule extends Module { abstract class AppModule {
@singleton() @singleton()
Dio dio() => Dio(); Dio dio() => Dio();
@@ -61,7 +67,7 @@ abstract class AppModule extends Module {
} }
``` ```
When used with `cherrypick_generator`, code similar to the following will be generated: With `cherrypick_generator`, code like the following will be generated:
```dart ```dart
final class $AppModule extends AppModule { final class $AppModule extends AppModule {
@@ -78,13 +84,78 @@ final class $AppModule extends AppModule {
--- ---
#### **Field Injection Example**
```dart
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
@injectable()
class ProfileView with _$ProfileView{
@inject()
late final AuthService auth;
@inject()
@scope('profile')
late final ProfileManager manager;
@inject()
@named('admin')
late final UserService adminUserService;
}
```
The code generator produces a mixin (simplified):
```dart
mixin _$ProfileView {
void _inject(ProfileView instance) {
instance.auth = CherryPick.openRootScope().resolve<AuthService>();
instance.manager = CherryPick.openScope(scopeName: 'profile').resolve<ProfileManager>();
instance.adminUserService = CherryPick.openRootScope().resolve<UserService>(named: 'admin');
}
}
```
---
## Annotation Reference ## Annotation Reference
### `@injectable`
```dart
@injectable()
class MyWidget { ... }
```
Marks a class as injectable for CherryPick DI. The code generator will generate a mixin to perform automatic injection of fields marked with `@inject()`.
---
### `@inject`
```dart
@inject()
late final SomeService service;
```
Applied to a field to request automatic injection of the dependency using the CherryPick DI framework.
---
### `@scope`
```dart
@inject()
@scope('profile')
late final ProfileManager manager;
```
Specifies the scope from which the dependency should be resolved for an injected field.
---
### `@module` ### `@module`
```dart ```dart
@module() @module()
abstract class AppModule extends Module {} abstract class AppModule {}
``` ```
Use on classes to mark them as a DI module. This is the root for registering your dependency providers. Use on classes to mark them as a DI module. This is the root for registering your dependency providers.
@@ -127,6 +198,7 @@ Use on methods to indicate they provide a dependency to the DI module. Dependenc
String token() => 'abc'; String token() => 'abc';
``` ```
Assigns a name to a binding for keyed injection or resolution. Assigns a name to a binding for keyed injection or resolution.
Can be used on both provider methods and fields.
--- ---
@@ -136,7 +208,7 @@ Assigns a name to a binding for keyed injection or resolution.
@provide() @provide()
String greet(@params() dynamic params) => 'Hello $params'; String greet(@params() dynamic params) => 'Hello $params';
``` ```
Use on method parameters to indicate that this parameter should receive runtime-supplied arguments during dependency resolution (for example, via `.toProvide*((params) => greate(params))` in generated code). Indicates that this parameter should receive runtime-supplied arguments during dependency resolution.
--- ---

View File

@@ -19,3 +19,6 @@ export 'src/instance.dart';
export 'src/singleton.dart'; export 'src/singleton.dart';
export 'src/named.dart'; export 'src/named.dart';
export 'src/params.dart'; export 'src/params.dart';
export 'src/inject.dart';
export 'src/injectable.dart';
export 'src/scope.dart';

View File

@@ -0,0 +1,34 @@
//
// Copyright 2021 Sergey Penkovsky (sergey.penkovsky@gmail.com)
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import 'package:meta/meta.dart';
/// Annotation for field injection in CherryPick DI framework.
/// Apply this to a field, and the code generator will automatically inject
/// the appropriate dependency into it.
///
/// ---
///
/// Аннотация для внедрения зависимости в поле через фреймворк CherryPick DI.
/// Поместите её на поле класса — генератор кода автоматически подставит нужную зависимость.
///
/// Example / Пример:
/// ```dart
/// @inject()
/// late final SomeService service;
/// ```
@experimental
// ignore: camel_case_types
final class inject {
const inject();
}

View File

@@ -0,0 +1,38 @@
//
// Copyright 2021 Sergey Penkovsky (sergey.penkovsky@gmail.com)
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import 'package:meta/meta.dart';
/// Marks a class as injectable for the CherryPick dependency injection framework.
/// If a class is annotated with [@injectable()], the code generator will
/// create a mixin to perform automatic injection of fields marked with [@inject].
///
/// ---
///
/// Помечает класс как внедряемый для фреймворка внедрения зависимостей CherryPick.
/// Если класс помечен аннотацией [@injectable()], генератор создаст миксин
/// для автоматического внедрения полей, отмеченных [@inject].
///
/// Example / Пример:
/// ```dart
/// @injectable()
/// class MyWidget extends StatelessWidget {
/// @inject()
/// late final MyService service;
/// }
/// ```
@experimental
// ignore: camel_case_types
final class injectable {
const injectable();
}

View File

@@ -11,11 +11,12 @@
// limitations under the License. // limitations under the License.
// //
/// An annotation to specify that a method or class provides a new instance /// ENGLISH:
/// each time it is requested. /// Annotation to specify that a new instance should be provided on each request.
/// ///
/// This is typically used to indicate that the annotated binding should /// Use the `@instance()` annotation for methods or classes in your DI module
/// not be a singleton and a new object is created for every injection. /// to declare that the DI container must create a new object every time
/// the dependency is injected (i.e., no singleton behavior).
/// ///
/// Example: /// Example:
/// ```dart /// ```dart
@@ -35,6 +36,32 @@
/// } /// }
/// } /// }
/// ``` /// ```
///
/// RUSSIAN (Русский):
/// Аннотация для создания нового экземпляра при каждом запросе.
///
/// Используйте `@instance()` для методов или классов в DI-модуле,
/// чтобы указать, что контейнер внедрения зависимостей должен создавать
/// новый объект при каждом обращении к зависимости (то есть, не синглтон).
///
/// Пример:
/// ```dart
/// @module()
/// abstract class AppModule extends Module {
/// @instance()
/// Foo foo() => Foo();
/// }
/// ```
///
/// Будет сгенерирован следующий код:
/// ```dart
/// final class $AppModule extends AppModule {
/// @override
/// void builder(Scope currentScope) {
/// bind<Foo>().toInstance(() => foo());
/// }
/// }
/// ```
// ignore: camel_case_types // ignore: camel_case_types
final class instance { final class instance {
const instance(); const instance();

View File

@@ -11,25 +11,57 @@
// limitations under the License. // limitations under the License.
// //
/// An annotation used to mark a Dart class or library as a module. /// ENGLISH:
/// Annotation for marking Dart classes or libraries as modules.
/// ///
/// This annotation can be used for tooling, code generation, /// Use the `@module()` annotation on abstract classes (or on a library)
/// or to provide additional metadata about the module. /// to indicate that the class represents a DI (Dependency Injection) module.
/// This is commonly used in code generation tools to automatically register
/// and configure dependencies defined within the module.
/// ///
/// Example: /// Example:
/// ```dart /// ```dart
/// @module() /// @module()
/// abstract class AppModule extends Module { /// abstract class AppModule extends Module {
/// // Dependency definitions go here.
/// } /// }
/// ``` /// ```
/// Сгенерирует код: ///
/// Generates code like:
/// ```dart /// ```dart
/// final class $AppModule extends AppModule { /// final class $AppModule extends AppModule {
/// @override /// @override
/// void builder(Scope currentScope) { /// void builder(Scope currentScope) {
/// /// // Dependency registration...
/// } /// }
/// } /// }
/// ```
///
/// RUSSIAN (Русский):
/// Аннотация для пометки классов или библиотек Dart как модуля.
///
/// Используйте `@module()` для абстрактных классов (или библиотек), чтобы
/// показать, что класс реализует DI-модуль (Dependency Injection).
/// Обычно используется генераторами кода для автоматической регистрации
/// и конфигурирования зависимостей, определённых в модуле.
///
/// Пример:
/// ```dart
/// @module()
/// abstract class AppModule extends Module {
/// // Определения зависимостей
/// }
/// ```
///
/// Будет сгенерирован код:
/// ```dart
/// final class $AppModule extends AppModule {
/// @override
/// void builder(Scope currentScope) {
/// // Регистрация зависимостей...
/// }
/// }
/// ```
// ignore: camel_case_types // ignore: camel_case_types
final class module { final class module {
/// Creates a [module] annotation. /// Creates a [module] annotation.

View File

@@ -11,10 +11,13 @@
// limitations under the License. // limitations under the License.
// //
/// An annotation to assign a name or identifier to a class, method, or other element. /// ENGLISH:
/// Annotation to assign a name or identifier to a class, method, or other element.
/// ///
/// This can be useful for code generation, dependency injection, /// The `@named('value')` annotation allows you to specify a string name
/// or providing metadata within a framework. /// for a dependency, factory, or injectable. This is useful for distinguishing
/// between multiple registrations of the same type in dependency injection,
/// code generation, and for providing human-readable metadata.
/// ///
/// Example: /// Example:
/// ```dart /// ```dart
@@ -25,7 +28,33 @@
/// } /// }
/// ``` /// ```
/// ///
/// Сгенерирует код: /// This will generate:
/// ```dart
/// final class $AppModule extends AppModule {
/// @override
/// void builder(Scope currentScope) {
/// bind<Dio>().toProvide(() => dio()).withName('dio').singleton();
/// }
/// }
/// ```
///
/// RUSSIAN (Русский):
/// Аннотация для задания имени или идентификатора классу, методу или другому элементу.
///
/// Аннотация `@named('значение')` позволяет указать строковое имя для зависимости,
/// фабрики или внедряемого значения. Это удобно для различения нескольких
/// регистраций одного типа в DI, генерации кода.
///
/// Пример:
/// ```dart
/// @module()
/// abstract class AppModule extends Module {
/// @named('dio')
/// Dio dio() => Dio();
/// }
/// ```
///
/// Будет сгенерирован следующий код:
/// ```dart /// ```dart
/// final class $AppModule extends AppModule { /// final class $AppModule extends AppModule {
/// @override /// @override
@@ -36,9 +65,13 @@
/// ``` /// ```
// ignore: camel_case_types // ignore: camel_case_types
final class named { final class named {
/// The assigned name or identifier. /// EN: The assigned name or identifier for the element.
///
/// RU: Назначенное имя или идентификатор для элемента.
final String value; final String value;
/// Creates a [named] annotation with the given [value]. /// EN: Creates a [named] annotation with the given [value].
///
/// RU: Создаёт аннотацию [named] с заданным значением [value].
const named(this.value); const named(this.value);
} }

View File

@@ -11,11 +11,14 @@
// limitations under the License. // limitations under the License.
// //
/// An annotation to indicate that a parameter is to be injected with run-time provided arguments. /// ENGLISH:
/// Annotation to mark a method parameter for injection with run-time arguments.
/// ///
/// Use this annotation to mark a method parameter that should receive arguments /// Use the `@params()` annotation to specify that a particular parameter of a
/// passed during the resolution of a dependency (for example, through the /// provider method should be assigned a value supplied at resolution time,
/// `.withParams(...)` method in the generated code). /// rather than during static dependency graph creation. This is useful in DI
/// when a dependency must receive dynamic data passed by the consumer
/// (via `.withParams(...)` in the generated code).
/// ///
/// Example: /// Example:
/// ```dart /// ```dart
@@ -27,6 +30,26 @@
/// ```dart /// ```dart
/// bind<String>().toProvideWithParams((args) => greet(args)); /// bind<String>().toProvideWithParams((args) => greet(args));
/// ``` /// ```
///
/// RUSSIAN (Русский):
/// Аннотация для пометки параметра метода, который будет внедряться со значением во время выполнения.
///
/// Используйте `@params()` чтобы указать, что конкретный параметр метода-провайдера
/// должен получать значение, передаваемое в момент обращения к зависимости,
/// а не на этапе построения графа зависимостей. Это полезно, если зависимость
/// должна получать данные динамически от пользователя или другого процесса
/// через `.withParams(...)` в сгенерированном коде.
///
/// Пример:
/// ```dart
/// @provide()
/// String greet(@params() dynamic params) => 'Hello $params';
/// ```
///
/// Будет сгенерировано:
/// ```dart
/// bind<String>().toProvideWithParams((args) => greet(args));
/// ```
// ignore: camel_case_types // ignore: camel_case_types
final class params { final class params {
const params(); const params();

View File

@@ -11,28 +11,56 @@
// limitations under the License. // limitations under the License.
// //
/// An annotation to indicate that a method provides a dependency to the module. /// ENGLISH:
/// Annotation to declare a factory/provider method or class as a singleton.
/// ///
/// This annotation is typically used in conjunction with dependency injection, /// Use the `@singleton()` annotation on methods in your DI module to specify
/// marking methods whose return value should be registered as a provider. /// that only one instance of the resulting object should be created and shared
/// The annotated method can optionally declare dependencies as parameters, /// for all consumers. This is especially useful in dependency injection
/// which will be resolved and injected automatically. /// frameworks and service locators.
/// ///
/// Example: /// Example:
/// ```dart /// ```dart
/// @module() /// @module()
/// abstract class AppModule extends Module { /// abstract class AppModule extends Module {
/// @provide() /// @singleton()
/// Foo foo(Bar bar) => Foo(bar); /// Dio dio() => Dio();
/// } /// }
/// ``` /// ```
/// ///
/// This will generate: /// This generates the following code:
/// ```dart /// ```dart
/// final class $AppModule extends AppModule { /// final class $AppModule extends AppModule {
/// @override /// @override
/// void builder(Scope currentScope) { /// void builder(Scope currentScope) {
/// bind<Foo>().toProvide(() => foo(currentScope.resolve<Bar>())); /// bind<Dio>().toProvide(() => dio()).singleton();
/// }
/// }
/// ```
///
/// RUSSIAN (Русский):
/// Аннотация для объявления фабричного/провайдерного метода или класса синглтоном.
///
/// Используйте `@singleton()` для методов внутри DI-модуля, чтобы указать,
/// что соответствующий объект (экземпляр класса) должен быть создан только один раз
/// и использоваться всеми компонентами приложения (единый общий экземпляр).
/// Это характерно для систем внедрения зависимостей и сервис-локаторов.
///
/// Пример:
/// ```dart
/// @module()
/// abstract class AppModule extends Module {
/// @singleton()
/// Dio dio() => Dio();
/// }
/// ```
///
/// Будет сгенерирован следующий код:
/// ```dart
/// final class $AppModule extends AppModule {
/// @override
/// void builder(Scope currentScope) {
/// bind<Dio>().toProvide(() => dio()).singleton();
/// } /// }
/// } /// }
/// ``` /// ```

View File

@@ -0,0 +1,37 @@
//
// Copyright 2021 Sergey Penkovsky (sergey.penkovsky@gmail.com)
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import 'package:meta/meta.dart';
/// Annotation to specify a scope for dependency injection in CherryPick.
/// Use this on an injected field to indicate from which scope
/// the dependency must be resolved.
///
/// ---
///
/// Аннотация для указания области внедрения (scope) в CherryPick.
/// Используйте её на инъецируемом поле, чтобы определить из какой области
/// должна быть получена зависимость.
///
/// Example / Пример:
/// ```dart
/// @inject()
/// @scope('profile')
/// late final ProfileManager profileManager;
/// ```
@experimental
// ignore: camel_case_types
final class scope {
final String? name;
const scope(this.name);
}

View File

@@ -11,11 +11,14 @@
// limitations under the License. // limitations under the License.
// //
/// An annotation to declare a class as a singleton. /// ENGLISH:
/// Annotation to declare a dependency as a singleton.
/// ///
/// This can be used to indicate that only one instance of the class /// Use the `@singleton()` annotation on provider methods inside a module
/// should be created, which is often useful in dependency injection /// to indicate that only a single instance of this dependency should be
/// frameworks or service locators. /// created and shared throughout the application's lifecycle. This is
/// typically used in dependency injection frameworks or service locators
/// to guarantee a single shared instance.
/// ///
/// Example: /// Example:
/// ```dart /// ```dart
@@ -25,7 +28,36 @@
/// Dio dio() => Dio(); /// Dio dio() => Dio();
/// } /// }
/// ``` /// ```
/// Сгенерирует код: ///
/// This will generate code like:
/// ```dart
/// final class $AppModule extends AppModule {
/// @override
/// void builder(Scope currentScope) {
/// bind<Dio>().toProvide(() => dio()).singleton();
/// }
/// }
/// ```
///
/// RUSSIAN (Русский):
/// Аннотация для объявления зависимости как синглтона.
///
/// Используйте `@singleton()` для методов-провайдеров внутри модуля,
/// чтобы указать, что соответствующий объект должен быть создан
/// единожды и использоваться во всём приложении (общий синглтон).
/// Это характерно для систем внедрения зависимостей и сервис-локаторов,
/// чтобы гарантировать один общий экземпляр.
///
/// Пример:
/// ```dart
/// @module()
/// abstract class AppModule extends Module {
/// @singleton()
/// Dio dio() => Dio();
/// }
/// ```
///
/// Будет сгенерирован следующий код:
/// ```dart /// ```dart
/// final class $AppModule extends AppModule { /// final class $AppModule extends AppModule {
/// @override /// @override

View File

@@ -1,8 +1,9 @@
name: cherrypick_annotations name: cherrypick_annotations
description: Collection annotations. description: |
version: 1.1.0-dev.0 Set of annotations for CherryPick dependency injection library. Enables code generation and declarative DI for Dart & Flutter projects.
version: 1.1.0-dev.1
documentation: https://github.com/pese-git/cherrypick/wiki documentation: https://github.com/pese-git/cherrypick/wiki
repository: https://github.com/pese-git/cherrypick 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
environment: environment:

View File

@@ -1,3 +1,19 @@
## 1.1.0-dev.5
- **FEAT**: implement tryResolve via generate code.
## 1.1.0-dev.4
- **FIX**: fixed warnings.
## 1.1.0-dev.3
- **FEAT**: implement InjectGenerator.
## 1.1.0-dev.2
- **FIX**: update instance generator code.
## 1.1.0-dev.1 ## 1.1.0-dev.1
- **FIX**: optimize code. - **FIX**: optimize code.

View File

@@ -1,54 +1,95 @@
# Cherrypick Generator # Cherrypick Generator
**Cherrypick Generator** is a Dart code generation library for automatic boilerplate creation in dependency injection (DI) modules. It processes classes annotated with `@module()` (from [cherrypick_annotations](https://pub.dev/packages/cherrypick_annotations)) and generates code for registering dependencies, handling singletons, named bindings, runtime parameters, and more. **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.
--- ---
## Features ## Features
- **Automatic Binding Generation:** - **Automatic Field Injection:**
Generates `bind<Type>()` registration code for every method in a DI module marked with `@module()`. Detects classes annotated with `@injectable()`, and generates mixins to inject all fields annotated with `@inject()`, supporting scope and named qualifiers.
- **Support for DI Annotations:** - **Module and Service Registration:**
Understands and processes meta-annotations such as `@singleton`, `@named`, `@instance`, `@provide`, and `@params`. For classes annotated with `@module()`, generates service registration code for methods using annotations such as `@provide`, `@instance`, `@singleton`, `@named`, and `@params`.
- **Runtime & Compile-Time Parameters:** - **Scope & Named Qualifier Support:**
Handles both injected (compile-time) and runtime parameters for provider/binding methods. Supports advanced DI features:
&nbsp;&nbsp;• Field-level scoping with `@scope('scopename')`
&nbsp;&nbsp;• Named dependencies via `@named('value')`
- **Synchronous & Asynchronous Support:** - **Synchronous & Asynchronous Support:**
Correctly distinguishes between synchronous and asynchronous bindings (including `Future<T>` return types). Handles both synchronous and asynchronous services (including `Future<T>`) for both field injection and module registration.
- **Named Bindings:** - **Parameters and Runtime Arguments:**
Allows registration of named services via the `@named()` annotation. Recognizes and wires both injected dependencies and runtime parameters using `@params`.
- **Singletons:** - **Error Handling:**
Registers singletons via the `@singleton` annotation. Validates annotations at generation time. Provides helpful errors for incorrect usage (e.g., using `@injectable` on non-class elements).
--- ---
## How It Works ## How It Works
1. **Annotations** ### 1. Annotate your code
Annotate your module classes and methods using `@module()`, `@instance`, `@provide`, `@singleton`, and `@named` as needed.
2. **Code Scanning** Use annotations from [cherrypick_annotations](https://pub.dev/packages/cherrypick_annotations):
During the build process (with `build_runner`), the generator scans your annotated classes.
3. **Code Generation** - `@injectable()` — on classes to enable field injection
For each `@module()` class, a new class (with a `$` prefix) is generated. - `@inject()` — on fields to specify they should be injected
This class overrides the `builder(Scope)` method to register all bindings. - `@scope()`, `@named()` — on fields or parameters for advanced wiring
- `@module()` — on classes to mark as DI modules
- `@provide`, `@instance`, `@singleton`, `@params` — on methods and parameters for module-based DI
4. **Binding Logic** ### 2. Run the generator
Each binding method's signature and annotations are analyzed. Registration code is generated according to:
- Return type (sync/async) Use `build_runner` to process your code and generate `.module.cherrypick.g.dart` and `.inject.cherrypick.g.dart` files.
- Annotations (`@singleton`, `@named`, etc.)
- Parameter list (DI dependencies, `@named`, or `@params` for runtime values) ### 3. Use the output in your application
- For modules: Register DI providers using the generated `$YourModule` class.
- For services: Enable field injection on classes using the generated mixin.
--- ---
## Example ## Field Injection Example
Given the following annotated Dart code: Given the following:
```dart
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
@injectable()
class MyWidget with _$MyWidget {
@inject()
late final AuthService auth;
@inject()
@scope('profile')
late final ProfileManager manager;
@inject()
@named('special')
late final ApiClient specialApi;
}
```
**The generator will output (simplified):**
```dart
mixin _$MyWidget {
void _inject(MyWidget instance) {
instance.auth = CherryPick.openRootScope().resolve<AuthService>();
instance.manager = CherryPick.openScope(scopeName: 'profile').resolve<ProfileManager>();
instance.specialApi = CherryPick.openRootScope().resolve<ApiClient>(named: 'special');
}
}
```
You can then mix this into your widget to enable automatic DI at runtime.
---
## Module Registration Example
Given:
```dart ```dart
import 'package:cherrypick_annotations/cherrypick_annotations.dart'; import 'package:cherrypick_annotations/cherrypick_annotations.dart';
@@ -57,98 +98,92 @@ import 'package:cherrypick_annotations/cherrypick_annotations.dart';
class MyModule { class MyModule {
@singleton @singleton
@instance @instance
SomeService provideService(ApiClient client); AuthService provideAuth(Api api);
@provide @provide
@named('special') @named('logging')
Future<Handler> createHandler(@params Map<String, dynamic> params); Future<Logger> provideLogger(@params Map<String, dynamic> args);
} }
``` ```
The generator will output (simplified): **The generator will output (simplified):**
```dart ```dart
final class $MyModule extends MyModule { final class $MyModule extends MyModule {
@override @override
void builder(Scope currentScope) { void builder(Scope currentScope) {
bind<SomeService>() bind<AuthService>()
.toInstance(provideService(currentScope.resolve<ApiClient>())) .toInstance(provideAuth(currentScope.resolve<Api>()))
.singleton(); .singleton();
bind<Handler>() bind<Logger>()
.toProvideAsyncWithParams((args) => createHandler(args)) .toProvideAsyncWithParams((args) => provideLogger(args))
.withName('special'); .withName('logging');
} }
} }
``` ```
--- ---
## Generated Code Overview ## Key Points
- **Constructor Registration:** - **Rich Annotation Support:**
All non-abstract methods are considered as providers and processed for DI registration. Mix and match field, parameter, and method annotations for maximum flexibility.
- **Scope and Named Resolution:**
- **Parameter Handling:** Use `@scope('...')` and `@named('...')` to precisely control where and how dependencies are wired.
Each method parameter is analyzed: - **Async/Synchronous:**
- Standard DI dependency: resolved via `currentScope.resolve<Type>()`. The generator distinguishes between sync (`resolve<T>`) and async (`resolveAsync<T>`) dependencies.
- Named dependency: resolved via `currentScope.resolve<Type>(named: 'name')`. - **Automatic Mixins:**
- Runtime parameter (`@params`): passed through as-is (e.g., `args`). For classes with `@injectable()`, a mixin is generated that injects all relevant fields (using constructor or setter).
- **Comprehensive Error Checking:**
- **Binding Types:** Misapplied annotations (e.g., `@injectable()` on non-class) produce clear build-time errors.
Supports both `.toInstance()` and `.toProvide()` (including async variants).
- **Singleton/Named:**
Appends `.singleton()` and/or `.withName('name')` as appropriate.
--- ---
## Usage ## Usage
1. **Add dependencies** 1. **Add dependencies**
In your `pubspec.yaml`:
```yaml ```yaml
dependencies: dependencies:
cherrypick_annotations: ^x.y.z cherrypick_annotations: ^latest
dev_dependencies: dev_dependencies:
cherrypick_generator: ^latest
build_runner: ^2.1.0 build_runner: ^2.1.0
cherrypick_generator: ^x.y.z
``` ```
2. **Apply annotations** 2. **Annotate your classes and modules as above**
Annotate your DI modules and provider methods as shown above.
3. **Run the generator** 3. **Run the generator**
```
```shell
dart run build_runner build dart run build_runner build
# or with Flutter: # or, if using Flutter:
flutter pub run build_runner build flutter pub run build_runner build
``` ```
4. **Import and use the generated code** 4. **Use generated code**
The generated files (suffix `.cherrypick.g.dart`) contain your `$YourModule` classes ready for use with your DI framework.
- Import the generated `.inject.cherrypick.g.dart` or `.cherrypick.g.dart` files where needed
--- ---
## Advanced ## Advanced Usage
- **Customizing Parameter Names:**
Use the `@named('value')` annotation on methods and parameters for named bindings.
- **Runtime Arguments:**
Use `@params` to designate parameters as runtime arguments that are supplied at injection time.
- **Combining Modules and Field Injection:**
It's possible to mix both style of DI — modules for binding, and field injection for consuming services.
- **Parameter and Named Injection:**
Use `@named` on both provider and parameter for named registration and lookup; use `@params` to pass runtime arguments.
- **Async Factories:** - **Async Factories:**
Methods returning `Future<T>` generate the appropriate `.toProvideAsync()` or `.toInstanceAsync()` bindings. Methods returning Future<T> generate async bindings and async field resolution logic.
--- ---
## Developer Notes ## Developer Notes
- The generator relies on Dart's analyzer, source_gen, and build packages. - The generator relies on the Dart analyzer, `source_gen`, and `build` packages.
- Each class and method is parsed for annotations; missing required annotations (like `@instance` or `@provide`) will result in a generation error. - All classes and methods are parsed for annotations.
- The generated code is designed to extend your original module classes while injecting all binding logic. - Improper annotation usage will result in generator errors.
--- ---
@@ -162,6 +197,7 @@ Licensed under the Apache License, Version 2.0
## Contribution ## Contribution
Pull requests and issues are welcome! Please open git issues or submit improvements as needed. Pull requests and issues are welcome! Please open GitHub issues or submit improvements.
--- ---

View File

@@ -28,3 +28,7 @@ include: package:lints/recommended.yaml
# For additional information about configuring this file, see # For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options # https://dart.dev/guides/language/analysis-options
analyzer:
errors:
deprecated_member_use: ignore

View File

@@ -7,6 +7,14 @@ builders:
required_inputs: ["lib/**"] required_inputs: ["lib/**"]
runs_before: [] runs_before: []
build_to: source build_to: source
inject_generator:
import: "package:cherrypick_generator/inject_generator.dart"
builder_factories: ["injectBuilder"]
build_extensions: {".dart": [".cherrypick.g.dart"]}
auto_apply: dependents
required_inputs: ["lib/**"]
runs_before: []
build_to: source
targets: targets:
$default: $default:
@@ -14,3 +22,6 @@ targets:
cherrypick_generator|module_generator: cherrypick_generator|module_generator:
generate_for: generate_for:
- lib/**.dart - lib/**.dart
cherrypick_generator|inject_generator:
generate_for:
- lib/**.dart

View File

@@ -14,3 +14,4 @@ library;
// //
export 'module_generator.dart'; export 'module_generator.dart';
export 'inject_generator.dart';

View File

@@ -0,0 +1,207 @@
//
// Copyright 2021 Sergey Penkovsky (sergey.penkovsky@gmail.com)
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import 'dart:async';
import 'package:analyzer/dart/constant/value.dart';
import 'package:analyzer/dart/element/nullability_suffix.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:build/build.dart';
import 'package:source_gen/source_gen.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:cherrypick_annotations/cherrypick_annotations.dart' as ann;
/// InjectGenerator generates a mixin for a class marked with @injectable()
/// and injects all fields annotated with @inject(), using CherryPick DI.
///
/// For Future<T> fields it calls .resolveAsync<T>(),
/// otherwise .resolve<T>() is used. Scope and named qualifiers are supported.
///
/// ---
///
/// InjectGenerator генерирует миксин для класса с аннотацией @injectable()
/// и внедряет все поля, помеченные @inject(), используя DI-фреймворк CherryPick.
///
/// Для Future<T> полей вызывается .resolveAsync<T>(),
/// для остальных — .resolve<T>(). Поддерживаются scope и named qualifier.
///
class InjectGenerator extends GeneratorForAnnotation<ann.injectable> {
const InjectGenerator();
/// The main entry point for code generation.
///
/// Checks class validity, collects injectable fields, and produces injection code.
///
/// Основная точка входа генератора. Проверяет класс, собирает инъектируемые поля и создает код внедрения зависимостей.
@override
FutureOr<String> generateForAnnotatedElement(
Element element,
ConstantReader annotation,
BuildStep buildStep,
) {
if (element is! ClassElement) {
throw InvalidGenerationSourceError(
'@injectable() can only be applied to classes.',
element: element,
);
}
final classElement = element;
final className = classElement.name;
final mixinName = '_\$$className';
final buffer = StringBuffer()
..writeln('mixin $mixinName {')
..writeln(' void _inject($className instance) {');
// Collect and process all @inject fields.
// Собираем и обрабатываем все поля с @inject.
final injectFields =
classElement.fields.where(_isInjectField).map(_parseInjectField);
for (final parsedField in injectFields) {
buffer.writeln(_generateInjectionLine(parsedField));
}
buffer
..writeln(' }')
..writeln('}');
return buffer.toString();
}
/// Checks if a field has the @inject annotation.
///
/// Проверяет, отмечено ли поле аннотацией @inject.
static bool _isInjectField(FieldElement field) {
return field.metadata.any(
(m) => m.computeConstantValue()?.type?.getDisplayString() == 'inject',
);
}
/// Parses the field for scope/named qualifiers and determines its type.
/// Returns a [_ParsedInjectField] describing injection information.
///
/// Разбирает поле на наличие модификаторов scope/named и выясняет его тип.
/// Возвращает [_ParsedInjectField] с информацией о внедрении.
static _ParsedInjectField _parseInjectField(FieldElement field) {
String? scopeName;
String? namedValue;
for (final meta in field.metadata) {
final DartObject? obj = meta.computeConstantValue();
final type = obj?.type?.getDisplayString();
if (type == 'scope') {
scopeName = obj?.getField('name')?.toStringValue();
} else if (type == 'named') {
namedValue = obj?.getField('value')?.toStringValue();
}
}
final DartType dartType = field.type;
String coreTypeName;
bool isFuture;
if (dartType.isDartAsyncFuture) {
final ParameterizedType paramType = dartType as ParameterizedType;
coreTypeName = paramType.typeArguments.first.getDisplayString();
isFuture = true;
} else {
coreTypeName = dartType.getDisplayString();
isFuture = false;
}
// ***
// Добавим определение nullable для типа (например PostRepository? или Future<PostRepository?>)
bool isNullable = dartType.nullabilitySuffix ==
NullabilitySuffix.question ||
(dartType is ParameterizedType &&
(dartType)
.typeArguments
.any((t) => t.nullabilitySuffix == NullabilitySuffix.question));
return _ParsedInjectField(
fieldName: field.name,
coreType: coreTypeName.replaceAll('?', ''), // удаляем "?" на всякий
isFuture: isFuture,
isNullable: isNullable,
scopeName: scopeName,
namedValue: namedValue,
);
}
/// Generates a line of code that performs the dependency injection for a field.
/// Handles resolve/resolveAsync, scoping, and named qualifiers.
///
/// Генерирует строку кода, которая внедряет зависимость для поля.
/// Учитывает resolve/resolveAsync, scoping и named qualifier.
String _generateInjectionLine(_ParsedInjectField field) {
// Используем tryResolve для nullable, иначе resolve
final resolveMethod = field.isFuture
? (field.isNullable
? 'tryResolveAsync<${field.coreType}>'
: 'resolveAsync<${field.coreType}>')
: (field.isNullable
? 'tryResolve<${field.coreType}>'
: 'resolve<${field.coreType}>');
final openCall = (field.scopeName != null && field.scopeName!.isNotEmpty)
? "CherryPick.openScope(scopeName: '${field.scopeName}')"
: "CherryPick.openRootScope()";
final params = (field.namedValue != null && field.namedValue!.isNotEmpty)
? "(named: '${field.namedValue}')"
: '()';
return " instance.${field.fieldName} = $openCall.$resolveMethod$params;";
}
}
/// Data structure representing all information required to generate
/// injection code for a field.
///
/// Структура данных, содержащая всю информацию,
/// необходимую для генерации кода внедрения для поля.
class _ParsedInjectField {
/// The name of the field / Имя поля.
final String fieldName;
/// The base type name (T or Future<T>) / Базовый тип (T или тип из Future<T>).
final String coreType;
/// True if the field type is Future<T>; false otherwise
/// Истина, если поле — Future<T>, иначе — ложь.
final bool isFuture;
/// Optional scope annotation argument / Опциональное имя scope.
final String? scopeName;
/// Optional named annotation argument / Опциональное имя named.
final String? namedValue;
final bool isNullable;
_ParsedInjectField({
required this.fieldName,
required this.coreType,
required this.isFuture,
required this.isNullable,
this.scopeName,
this.namedValue,
});
}
/// Builder factory. Used by build_runner.
///
/// Фабрика билдера. Используется build_runner.
Builder injectBuilder(BuilderOptions options) =>
PartBuilder([InjectGenerator()], '.inject.cherrypick.g.dart');

View File

@@ -90,4 +90,4 @@ class ModuleGenerator extends GeneratorForAnnotation<ann.module> {
/// файлов, где встречается @module(). /// файлов, где встречается @module().
/// --------------------------------------------------------------------------- /// ---------------------------------------------------------------------------
Builder moduleBuilder(BuilderOptions options) => Builder moduleBuilder(BuilderOptions options) =>
PartBuilder([ModuleGenerator()], '.cherrypick.g.dart'); PartBuilder([ModuleGenerator()], '.module.cherrypick.g.dart');

View File

@@ -125,11 +125,12 @@ class BindSpec {
final multiLine = fnArgs.length > 60 || fnArgs.contains('\n'); final multiLine = fnArgs.length > 60 || fnArgs.contains('\n');
switch (bindingType) { switch (bindingType) {
case BindingType.instance: case BindingType.instance:
return isAsyncInstance throw StateError(
? '.toInstanceAsync(($fnArgs) => $methodName($fnArgs))' 'Internal error: _generateWithParamsProvideClause called for @instance binding with @params.');
: '.toInstance(($fnArgs) => $methodName($fnArgs))'; //return isAsyncInstance
// ? '.toInstanceAsync(($fnArgs) => $methodName($fnArgs))'
// : '.toInstance(($fnArgs) => $methodName($fnArgs))';
case BindingType.provide: case BindingType.provide:
default:
if (isAsyncProvide) { if (isAsyncProvide) {
return multiLine return multiLine
? '.toProvideAsyncWithParams(\n${' ' * (indent + 2)}($paramVar) => $methodName($fnArgs))' ? '.toProvideAsyncWithParams(\n${' ' * (indent + 2)}($paramVar) => $methodName($fnArgs))'
@@ -152,7 +153,6 @@ class BindSpec {
? '.toInstanceAsync($methodName($argsStr))' ? '.toInstanceAsync($methodName($argsStr))'
: '.toInstance($methodName($argsStr))'; : '.toInstance($methodName($argsStr))';
case BindingType.provide: case BindingType.provide:
default:
if (isAsyncProvide) { if (isAsyncProvide) {
return multiLine return multiLine
? '.toProvideAsync(\n${' ' * (indent + 2)}() => $methodName($argsStr))' ? '.toProvideAsync(\n${' ' * (indent + 2)}() => $methodName($argsStr))'
@@ -218,6 +218,15 @@ class BindSpec {
final bindingType = final bindingType =
hasInstance ? BindingType.instance : BindingType.provide; hasInstance ? BindingType.instance : BindingType.provide;
// PROHIBIT @params with @instance bindings!
if (bindingType == BindingType.instance && hasParams) {
throw InvalidGenerationSourceError(
'@params() (runtime arguments) cannot be used together with @instance() on method $methodName. '
'Use @provide() instead if you want runtime arguments.',
element: method,
);
}
// -- Extract inner type for Future<T> and set async flags. // -- Extract inner type for Future<T> and set async flags.
bool isAsyncInstance = false; bool isAsyncInstance = false;
bool isAsyncProvide = false; bool isAsyncProvide = false;

View File

@@ -1,8 +1,10 @@
name: cherrypick_generator name: cherrypick_generator
description: Code generator for cherrypick annotations description: |
version: 1.1.0-dev.1 Source code generator for the cherrypick dependency injection system. Processes annotations to generate binding and module code for Dart & Flutter projects.
version: 1.1.0-dev.5
documentation: https://github.com/pese-git/cherrypick/wiki documentation: https://github.com/pese-git/cherrypick/wiki
repository: https://github.com/pese-git/cherrypick 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
environment: environment:
@@ -10,12 +12,13 @@ environment:
# Add regular dependencies here. # Add regular dependencies here.
dependencies: dependencies:
cherrypick_annotations: ^1.1.0-dev.0 cherrypick_annotations: ^1.1.0-dev.1
analyzer: ^6.7.0 analyzer: ^7.0.0
dart_style: ^2.3.7 dart_style: ^3.0.1
build: ^2.4.1 build: ^2.4.1
build_runner: ^2.4.13 build_runner: ^2.4.15
source_gen: ^1.5.0 source_gen: ^2.0.0
collection: ^1.18.0
dev_dependencies: dev_dependencies:
lints: ^5.0.0 lints: ^5.0.0

View File

@@ -5,23 +5,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: _fe_analyzer_shared name: _fe_analyzer_shared
sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 sha256: e55636ed79578b9abca5fecf9437947798f5ef7456308b5cb85720b793eac92f
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "72.0.0" version: "82.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.2"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 sha256: "904ae5bb474d32c38fb9482e2d925d5454cda04ddd0e55d2e6826bc72f6ba8c0"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.7.0" version: "7.4.5"
args: args:
dependency: transitive dependency: transitive
description: description:
@@ -34,26 +29,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.11.0" version: "2.12.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
build: build:
dependency: transitive dependency: transitive
description: description:
name: build name: build
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.1" version: "2.4.2"
build_config: build_config:
dependency: transitive dependency: transitive
description: description:
@@ -74,26 +69,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: build_resolvers name: build_resolvers
sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.2" version: "2.4.4"
build_runner: build_runner:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: build_runner name: build_runner
sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.13" version: "2.4.15"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
name: build_runner_core name: build_runner_core
sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.3.2" version: "8.0.0"
built_collection: built_collection:
dependency: transitive dependency: transitive
description: description:
@@ -114,10 +109,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.0" version: "1.4.0"
checked_yaml: checked_yaml:
dependency: transitive dependency: transitive
description: description:
@@ -132,36 +127,36 @@ packages:
path: "../../cherrypick" path: "../../cherrypick"
relative: true relative: true
source: path source: path
version: "2.2.0-dev.0" version: "2.2.0-dev.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.0-dev.0" version: "1.1.0-dev.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.2-dev.0" version: "1.1.2-dev.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: "1.1.0-dev.0" version: "1.1.0-dev.3"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.1" version: "1.1.2"
code_builder: code_builder:
dependency: transitive dependency: transitive
description: description:
@@ -174,10 +169,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.18.0" version: "1.19.1"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@@ -206,18 +201,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: dart_style name: dart_style
sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.7" version: "3.0.1"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.1" version: "1.3.2"
file: file:
dependency: transitive dependency: transitive
description: description:
@@ -276,6 +271,14 @@ 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:
@@ -320,18 +323,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.5" version: "10.0.8"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.5" version: "3.0.9"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
@@ -356,22 +359,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
macros:
dependency: transitive
description:
name: macros
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
url: "https://pub.dev"
source: hosted
version: "0.1.2-main.4"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.16+1" version: "0.12.17"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
@@ -384,10 +379,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.15.0" version: "1.16.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@@ -408,10 +403,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.0" version: "1.9.1"
pool: pool:
dependency: transitive dependency: transitive
description: description:
@@ -456,39 +451,39 @@ packages:
dependency: transitive dependency: transitive
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" version: "0.0.0"
source_gen: source_gen:
dependency: transitive dependency: transitive
description: description:
name: source_gen name: source_gen
sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.5.0" version: "2.0.0"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.10.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.1" version: "1.12.1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.2" version: "2.1.4"
stream_transform: stream_transform:
dependency: transitive dependency: transitive
description: description:
@@ -501,26 +496,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.4.1"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.1" version: "1.2.2"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.2" version: "0.7.4"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@@ -549,10 +544,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.2.5" version: "14.3.1"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@@ -594,5 +589,5 @@ packages:
source: hosted source: hosted
version: "3.1.3" version: "3.1.3"
sdks: sdks:
dart: ">=3.5.2 <4.0.0" dart: ">=3.7.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54" flutter: ">=3.18.0-18.0.pre.54"

View File

@@ -14,7 +14,7 @@ dependencies:
cherrypick: ^2.2.0-dev.1 cherrypick: ^2.2.0-dev.1
cherrypick_flutter: ^1.1.2-dev.1 cherrypick_flutter: ^1.1.2-dev.1
cherrypick_annotations: ^1.1.0-dev.0 cherrypick_annotations: ^1.1.0-dev.1
cupertino_icons: ^1.0.8 cupertino_icons: ^1.0.8
@@ -24,8 +24,8 @@ dev_dependencies:
flutter_lints: ^5.0.0 flutter_lints: ^5.0.0
cherrypick_generator: ^1.1.0-dev.1 cherrypick_generator: ^1.1.0-dev.5
build_runner: ^2.4.13 build_runner: ^2.4.15
# 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

View File

@@ -0,0 +1,35 @@
import 'package:cherrypick/cherrypick.dart';
import 'package:cherrypick_annotations/cherrypick_annotations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'domain/repository/post_repository.dart';
import 'presentation/bloc/post_bloc.dart';
import 'router/app_router.dart';
part 'app.inject.cherrypick.g.dart';
@injectable()
class MyApp extends StatelessWidget with _$MyApp {
final _appRouter = AppRouter();
@named('repo')
@inject()
late final PostRepository repository;
MyApp({super.key}) {
_inject(this);
}
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (_) => PostBloc(repository),
child: MaterialApp.router(
routeInformationParser: _appRouter.defaultRouteParser(),
routerDelegate: _appRouter.delegate(),
theme: ThemeData.light(),
),
);
}
}

View File

@@ -5,7 +5,7 @@ import '../data/network/json_placeholder_api.dart';
import '../data/post_repository_impl.dart'; import '../data/post_repository_impl.dart';
import '../domain/repository/post_repository.dart'; import '../domain/repository/post_repository.dart';
part 'app_module.cherrypick.g.dart'; part 'app_module.module.cherrypick.g.dart';
@module() @module()
abstract class AppModule extends Module { abstract class AppModule extends Module {

View File

@@ -1,36 +1,9 @@
import 'package:cherrypick/cherrypick.dart'; import 'package:cherrypick/cherrypick.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:postly/app.dart';
import 'di/app_module.dart'; import 'di/app_module.dart';
import 'domain/repository/post_repository.dart';
import 'presentation/bloc/post_bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'router/app_router.dart';
void main() { void main() {
final scope = CherryPick.openRootScope(); CherryPick.openRootScope().installModules([$AppModule()]);
scope.installModules([$AppModule()]); runApp(MyApp());
runApp(MyApp(scope: scope));
}
class MyApp extends StatelessWidget {
final Scope scope;
final _appRouter = AppRouter();
MyApp({super.key, required this.scope});
@override
Widget build(BuildContext context) {
// Получаем репозиторий через injector
final repository = scope.resolve<PostRepository>(named: 'repo');
return BlocProvider(
create: (_) => PostBloc(repository),
child: MaterialApp.router(
routeInformationParser: _appRouter.defaultRouteParser(),
routerDelegate: _appRouter.delegate(),
theme: ThemeData.light(),
),
);
}
} }

View File

@@ -5,23 +5,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: _fe_analyzer_shared name: _fe_analyzer_shared
sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 sha256: e55636ed79578b9abca5fecf9437947798f5ef7456308b5cb85720b793eac92f
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "72.0.0" version: "82.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.2"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 sha256: "904ae5bb474d32c38fb9482e2d925d5454cda04ddd0e55d2e6826bc72f6ba8c0"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.7.0" version: "7.4.5"
args: args:
dependency: transitive dependency: transitive
description: description:
@@ -34,10 +29,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.11.0" version: "2.12.0"
auto_route: auto_route:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -50,10 +45,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: auto_route_generator name: auto_route_generator
sha256: c9086eb07271e51b44071ad5cff34e889f3156710b964a308c2ab590769e79e6 sha256: c2e359d8932986d4d1bcad7a428143f81384ce10fef8d4aa5bc29e1f83766a46
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.0.0" version: "9.3.1"
bloc: bloc:
dependency: transitive dependency: transitive
description: description:
@@ -66,18 +61,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
build: build:
dependency: transitive dependency: transitive
description: description:
name: build name: build
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.1" version: "2.4.2"
build_config: build_config:
dependency: transitive dependency: transitive
description: description:
@@ -98,26 +93,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: build_resolvers name: build_resolvers
sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.2" version: "2.4.4"
build_runner: build_runner:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: build_runner name: build_runner
sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.13" version: "2.4.15"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
name: build_runner_core name: build_runner_core
sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.3.2" version: "8.0.0"
built_collection: built_collection:
dependency: transitive dependency: transitive
description: description:
@@ -138,10 +133,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.0" version: "1.4.0"
checked_yaml: checked_yaml:
dependency: transitive dependency: transitive
description: description:
@@ -156,29 +151,29 @@ packages:
path: "../../cherrypick" path: "../../cherrypick"
relative: true relative: true
source: path source: path
version: "2.2.0-dev.0" version: "2.2.0-dev.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.0-dev.0" version: "1.1.0-dev.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: "1.1.0-dev.0" version: "1.1.0-dev.4"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.1" version: "1.1.2"
code_builder: code_builder:
dependency: transitive dependency: transitive
description: description:
@@ -191,10 +186,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.18.0" version: "1.19.1"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@@ -223,10 +218,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: dart_style name: dart_style
sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" sha256: "5b236382b47ee411741447c1f1e111459c941ea1b3f2b540dde54c210a3662af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.7" version: "3.1.0"
dartz: dartz:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -255,10 +250,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.1" version: "1.3.2"
file: file:
dependency: transitive dependency: transitive
description: description:
@@ -305,10 +300,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: freezed name: freezed
sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e" sha256: "59a584c24b3acdc5250bb856d0d3e9c0b798ed14a4af1ddb7dc1c7b41df91c9c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.5.7" version: "2.5.8"
freezed_annotation: freezed_annotation:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -341,6 +336,14 @@ 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:
@@ -385,26 +388,26 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: json_serializable name: json_serializable
sha256: c2fcb3920cf2b6ae6845954186420fca40bc0a8abcc84903b7801f17d7050d7c sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.9.0" version: "6.9.5"
leak_tracker: leak_tracker:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.5" version: "10.0.8"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.5" version: "3.0.9"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
@@ -429,22 +432,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
macros:
dependency: transitive
description:
name: macros
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
url: "https://pub.dev"
source: hosted
version: "0.1.2-main.4"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.16+1" version: "0.12.17"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
@@ -457,10 +452,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.15.0" version: "1.16.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@@ -489,10 +484,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.0" version: "1.9.1"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@@ -513,10 +508,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: protobuf name: protobuf
sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" sha256: "579fe5557eae58e3adca2e999e38f02441d8aa908703854a9e0a0f47fa857731"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.1.0" version: "4.1.0"
provider: provider:
dependency: transitive dependency: transitive
description: description:
@@ -553,10 +548,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: retrofit_generator name: retrofit_generator
sha256: f76fdb2b66854690d5a332e7364d7561fc9dc2b3c924d7956ab8070495e21f6a sha256: "65d28d3a7b4db485f1c73fee8ee32f552ef23ee4ecb68ba491f39d80b73bdcbf"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.1.5" version: "9.2.0"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
@@ -577,15 +572,15 @@ packages:
dependency: transitive dependency: transitive
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" version: "0.0.0"
source_gen: source_gen:
dependency: transitive dependency: transitive
description: description:
name: source_gen name: source_gen
sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.5.0" version: "2.0.0"
source_helper: source_helper:
dependency: transitive dependency: transitive
description: description:
@@ -598,26 +593,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.10.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.1" version: "1.12.1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.2" version: "2.1.4"
stream_transform: stream_transform:
dependency: transitive dependency: transitive
description: description:
@@ -630,26 +625,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.4.1"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.1" version: "1.2.2"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.2" version: "0.7.4"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@@ -678,10 +673,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.2.5" version: "14.3.1"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@@ -731,5 +726,5 @@ packages:
source: hosted source: hosted
version: "3.1.3" version: "3.1.3"
sdks: sdks:
dart: ">=3.5.2 <4.0.0" dart: ">=3.7.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54" flutter: ">=3.18.0-18.0.pre.54"

View File

@@ -13,11 +13,11 @@ dependencies:
sdk: flutter sdk: flutter
cherrypick: ^2.2.0-dev.1 cherrypick: ^2.2.0-dev.1
cherrypick_annotations: ^1.1.0-dev.0 cherrypick_annotations: ^1.1.0-dev.1
dio: ^5.4.0 dio: ^5.4.0
retrofit: ^4.0.3 retrofit: ^4.0.3
freezed_annotation: ^2.3.2 freezed_annotation: ^2.4.4
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: ^9.3.0+1
@@ -30,11 +30,11 @@ dev_dependencies:
flutter_lints: ^5.0.0 flutter_lints: ^5.0.0
cherrypick_generator: ^1.1.0-dev.1 cherrypick_generator: ^1.1.0-dev.5
build_runner: 2.4.13 build_runner: 2.4.15
retrofit_generator: ^9.1.5 retrofit_generator: ^9.1.5
freezed: ^2.3.2 freezed: ^2.5.8
json_serializable: ^6.9.0 json_serializable: ^6.9.0
auto_route_generator: ^9.0.0 auto_route_generator: ^9.0.0

View File

@@ -5,23 +5,23 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: _fe_analyzer_shared name: _fe_analyzer_shared
sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77" sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "73.0.0" version: "76.0.0"
_macros: _macros:
dependency: transitive dependency: transitive
description: dart description: dart
source: sdk source: sdk
version: "0.3.2" version: "0.3.3"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a" sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.8.0" version: "6.11.0"
ansi_styles: ansi_styles:
dependency: transitive dependency: transitive
description: description:
@@ -298,10 +298,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: macros name: macros
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.2-main.4" version: "0.1.3-main.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description: