Skip to content

Getting Started

The bloc ecosystem consists of multiple packages listed below:

| Package | Description | Link | | ------------------------------------------------------------------------------------------ | --------------------------- | -------------------------------------------------------------------------------------------------------------- | | angular_bloc | AngularDart Components | pub package | | bloc | Core Dart APIs | pub package | | bloc_concurrency | Event Transformers | pub package | | bloc_lint | Custom Linter | pub package | | bloc_test | Testing APIs | pub package | | bloc_tools | Command-line Tools | pub package | | flutter_bloc | Flutter Widgets | pub package | | hydrated_bloc | Caching/Persistence Support | pub package | | replay_bloc | Undo/Redo Support | pub package |

Terminal window
# Add bloc to your project.
dart pub add bloc

Now that we have successfully installed bloc, we can create our main.dart and import the respective bloc package.

main.dart
import 'package:bloc/bloc.dart';
Morty Proxy This is a proxified and sanitized view of the page, visit original site.