mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 05:25:19 +00:00
- Replaced the main action button text with 'Explore CherryPick Documentation 🍒' instead of 'Docusaurus Tutorial'.
- Updated the button link to target /docs/intro (main docs entry point).
- Changed <Layout> props:
- Page title now uses project title only (siteConfig.title)
- Added a CherryPick-related site description for better SEO and context.
- The homepage is now tailored to reflect CherryPick's purpose as a Dart & Flutter DI library instead of Docusaurus boilerplate.
28 lines
590 B
Markdown
28 lines
590 B
Markdown
---
|
|
sidebar_position: 3
|
|
---
|
|
|
|
# Getting Started
|
|
|
|
Here is a minimal example that registers and resolves a dependency:
|
|
|
|
```dart
|
|
import 'package:cherrypick/cherrypick.dart';
|
|
|
|
class AppModule extends Module {
|
|
@override
|
|
void builder(Scope currentScope) {
|
|
bind<ApiClient>().toInstance(ApiClientMock());
|
|
bind<String>().toProvide(() => "Hello, CherryPick!");
|
|
}
|
|
}
|
|
|
|
final rootScope = CherryPick.openRootScope();
|
|
rootScope.installModules([AppModule()]);
|
|
|
|
final greeting = rootScope.resolve<String>();
|
|
print(greeting); // prints: Hello, CherryPick!
|
|
|
|
await CherryPick.closeRootScope();
|
|
```
|