Repolode
felangel

felangel/bloc

A Dart state management library implementing the BLoC pattern to separate presentation from business logic, used mainly with Flutter and AngularDart.

Stars
12,483
Forks
3,414
Open issues
83
Last commit
yesterday

What is it?

Bloc is a predictable state management library for Dart that implements the BLoC (Business Logic Component) design pattern. Its goal is to separate presentation from business logic, which makes code easier to test and reuse.

The repository is a monorepo of several packages. The core bloc package provides the Bloc and Cubit classes, flutter_bloc supplies Flutter widgets for connecting blocs to the UI, and hydrated_bloc persists state across app restarts. Other packages add event concurrency transformers (bloc_concurrency), unit testing helpers (bloc_test), a lint rule set (bloc_lint), and replay_bloc for undo and redo style history. angular_bloc targets AngularDart apps.

The project is maintained by Felix Angelov and documented at bloclibrary.dev, which includes tutorials and a migration guide.

Key features

  • 01Provides Bloc and Cubit classes for managing state in Dart code.
  • 02Includes flutter_bloc widgets for connecting state to Flutter UI.
  • 03Offers hydrated_bloc to persist state between app launches.
  • 04Supplies bloc_test helpers for unit testing blocs.
  • 05Includes bloc_concurrency transformers to control how events are processed.

Use cases

  • Structuring state management in a Flutter app so UI widgets stay free of business logic.
  • Writing unit tests for application logic that is independent of the UI.
  • Keeping app state across restarts with hydrated_bloc.
  • Sharing Dart business logic between a Flutter app and an AngularDart web app.

Things to know

  • Its use is tied to the Dart ecosystem, mainly Flutter and AngularDart.

Topics

FAQ

What is bloc?
A Dart state management library implementing the BLoC pattern to separate presentation from business logic, used mainly with Flutter and AngularDart. Bloc is a predictable state management library for Dart that implements the BLoC (Business Logic Component) design pattern. Its goal is to separate presentation from business logic, which makes code easier to test and reuse.
Is bloc free to use? What license does it have?
bloc is open source under the MIT license. Check the license terms before using it in commercial products.
Is bloc still maintained?
Actively maintained. The last commit to bloc was on Oct 20, 2026.
What can I use bloc for?
Structuring state management in a Flutter app so UI widgets stay free of business logic. Writing unit tests for application logic that is independent of the UI. Keeping app state across restarts with hydrated_bloc. Sharing Dart business logic between a Flutter app and an AngularDart web app.
Where can I get bloc?
The source code and installation instructions are on GitHub: https://github.com/felangel/bloc

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects