mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-23 21:13:35 +00:00
renamed package
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# dart_di
|
||||
# cherrypick
|
||||
|
||||
Experimental development of DI in the Dart language
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ Example:
|
||||
|
||||
```dart
|
||||
// open main scope
|
||||
final rootScope = DartDi.openRootScope();
|
||||
final rootScope = Cherrypick.openRootScope();
|
||||
|
||||
// initializing scope with a custom module
|
||||
rootScope.installModules([AppModule()]);
|
||||
@@ -76,7 +76,7 @@ Example:
|
||||
final str = rootScope.tryResolve<String>();
|
||||
|
||||
// close main scope
|
||||
DartDi.closeRootScope();
|
||||
Cherrypick.closeRootScope();
|
||||
```
|
||||
|
||||
## Example app
|
||||
@@ -85,8 +85,8 @@ Example:
|
||||
```dart
|
||||
import 'dart:async';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:dart_di/experimental/scope.dart';
|
||||
import 'package:dart_di/experimental/module.dart';
|
||||
import 'package:cherrypick/scope.dart';
|
||||
import 'package:cherrypick/module.dart';
|
||||
|
||||
class AppModule extends Module {
|
||||
@override
|
||||
|
||||
@@ -65,7 +65,7 @@ Scope - это контейнер, который хранит все дерев
|
||||
|
||||
```dart
|
||||
// открыть главный scope
|
||||
final rootScope = DartDi.openRootScope();
|
||||
final rootScope = Cherrypick.openRootScope();
|
||||
|
||||
// инициализация scope пользовательским модулем
|
||||
rootScope.installModules([AppModule()]);
|
||||
@@ -76,7 +76,7 @@ Scope - это контейнер, который хранит все дерев
|
||||
final str = rootScope.tryResolve<String>();
|
||||
|
||||
// закрыть главный scope
|
||||
DartDi.closeRootScope();
|
||||
Cherrypick.closeRootScope();
|
||||
```
|
||||
|
||||
## Пример приложения
|
||||
@@ -85,8 +85,8 @@ Scope - это контейнер, который хранит все дерев
|
||||
```dart
|
||||
import 'dart:async';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:dart_di/experimental/scope.dart';
|
||||
import 'package:dart_di/experimental/module.dart';
|
||||
import 'package:cherrypick/scope.dart';
|
||||
import 'package:cherrypick/module.dart';
|
||||
|
||||
class AppModule extends Module {
|
||||
@override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:dart_di/scope.dart';
|
||||
import 'package:dart_di/module.dart';
|
||||
import 'package:cherrypick/scope.dart';
|
||||
import 'package:cherrypick/module.dart';
|
||||
|
||||
class AppModule extends Module {
|
||||
@override
|
||||
|
||||
@@ -8,7 +8,7 @@ environment:
|
||||
|
||||
|
||||
dependencies:
|
||||
dart_di:
|
||||
cherrypick:
|
||||
path: ../
|
||||
|
||||
dev_dependencies:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
library dart_di;
|
||||
|
||||
export 'package:dart_di/scope.dart';
|
||||
export 'package:dart_di/module.dart';
|
||||
export 'package:dart_di/binding.dart';
|
||||
export 'package:dart_di/di.dart';
|
||||
export 'package:cherrypick/scope.dart';
|
||||
export 'package:cherrypick/module.dart';
|
||||
export 'package:cherrypick/binding.dart';
|
||||
export 'package:cherrypick/di.dart';
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import 'package:dart_di/scope.dart';
|
||||
import 'package:cherrypick/scope.dart';
|
||||
|
||||
Scope? _rootScope = null;
|
||||
|
||||
class DartDi {
|
||||
class CherryPick {
|
||||
/// RU: Метод открывает главный [Scope].
|
||||
/// ENG: The method opens the main [Scope].
|
||||
///
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import 'package:dart_di/scope.dart';
|
||||
import 'package:cherrypick/scope.dart';
|
||||
|
||||
abstract class Factory<T> {
|
||||
T createInstance(Scope scope);
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:dart_di/binding.dart';
|
||||
import 'package:dart_di/scope.dart';
|
||||
import 'package:cherrypick/binding.dart';
|
||||
import 'package:cherrypick/scope.dart';
|
||||
|
||||
/// RU: Класс Module является основой для пользовательских модулей.
|
||||
/// Этот класс нужен для инициализации [Scope].
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:dart_di/binding.dart';
|
||||
import 'package:dart_di/module.dart';
|
||||
import 'package:cherrypick/binding.dart';
|
||||
import 'package:cherrypick/module.dart';
|
||||
|
||||
Scope openRootScope() => Scope(null);
|
||||
|
||||
|
||||
10
pubspec.yaml
10
pubspec.yaml
@@ -1,10 +1,10 @@
|
||||
name: dart_di
|
||||
name: cherrypick
|
||||
description: Experimental Dependency Injection library.
|
||||
version: 0.1.0
|
||||
homepage: https://github.com/pese-git/dart_di
|
||||
documentation: https://github.com/pese-git/dart_di/doc
|
||||
repository: https://github.com/pese-git/dart_di
|
||||
issue_tracker: https://github.com/pese-git/dart_di/issues
|
||||
homepage: https://github.com/pese-git/cherrypick
|
||||
documentation: https://github.com/pese-git/cherrypick/doc
|
||||
repository: https://github.com/pese-git/cherrypick
|
||||
issue_tracker: https://github.com/pese-git/cherrypick/issues
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:dart_di/binding.dart';
|
||||
import 'package:cherrypick/binding.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:dart_di/module.dart';
|
||||
import 'package:dart_di/scope.dart';
|
||||
import 'package:cherrypick/module.dart';
|
||||
import 'package:cherrypick/scope.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
|
||||
Reference in New Issue
Block a user