Skip to content

Installation

Add CherryPick to your pubspec.yaml. Include cherrypick_annotations and cherrypick_generator only if you plan to use annotations and code generation.

pubspec.yaml
dependencies:
cherrypick: ^4.0.0
cherrypick_annotations: ^4.0.0
dev_dependencies:
build_runner: ^2.4.0
cherrypick_generator: ^4.0.0

Fetch the packages:

Terminal window
dart pub get # or: flutter pub get

If you use annotations, run the generator whenever your DI code changes:

Terminal window
dart run build_runner build --delete-conflicting-outputs

Import the core library where you configure dependencies:

import 'package:cherrypick/cherrypick.dart';

Next, head to Getting Started.