A predictable state management library for Dart and Flutter that implements the BLoC design pattern.
Bloc is a state management library for Dart and Flutter that helps implement the BLoC (Business Logic Component) design pattern. It provides a predictable way to manage application state by separating business logic from presentation, making it easier to test, debug, and maintain complex applications. The library includes core packages for Flutter, AngularDart, and pure Dart, along with tools for testing, persistence, and concurrency control.
Flutter and Dart developers building medium to large-scale applications who need a structured, testable approach to state management. It's particularly useful for teams working on cross-platform projects where business logic needs to be shared between mobile and web.
Developers choose Bloc for its strong separation of concerns, excellent testability, and predictable state transitions. Its rich ecosystem of supporting packages and extensive documentation make it a robust choice for production applications, while its platform-agnostic core allows logic reuse across Flutter, AngularDart, and pure Dart projects.
A predictable state management library that helps implement the BLoC design pattern
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enforces unidirectional data flow with explicit state transitions, making debugging easier and state changes traceable, as highlighted in the architecture diagram and key features.
Cleanly divides business logic from presentation, improving code organization and maintainability, which is core to the BLoC design pattern philosophy.
Isolates business logic in Blocs, allowing easy unit testing without UI dependencies, supported by the dedicated bloc_test package and examples.
Blocs can be shared across Flutter, AngularDart, and pure Dart projects, promoting code reuse and consistent logic, as shown in the multi-platform examples.
Includes a rich set of packages for concurrency control, persistence, linting, and testing, providing a full toolkit for production applications.
Requires defining multiple classes for events, states, and handlers, leading to verbose code even for simple state changes, which can slow development.
Tightly coupled to Dart and Flutter, making it unsuitable for projects that may need to migrate to other languages or frameworks outside this ecosystem.
Demands understanding of streams, the BLoC pattern, and associated packages, which can be challenging for developers new to reactive programming.