bloc README

The project's README from github.com/felangel/bloc. As one markdown file: README.md.

Bloc

build codecov Star on Github style: bloc lint Flutter Website Awesome Flutter Flutter Samples License: MIT Discord Bloc Library


A predictable state management library that helps implement the BLoC design pattern.

Package Pub
angular_bloc pub package
bloc pub package
bloc_concurrency pub package
bloc_lint pub package
bloc_test pub package
bloc_tools pub package
flutter_bloc pub package
hydrated_bloc pub package
replay_bloc pub package

Sponsors

Our top sponsors are shown below! [Become a Sponsor]


Overview

Bloc Architecture

The goal of this library is to make it easy to separate presentation from business logic, facilitating testability and reusability.

Documentation

Migration

Examples

Dart

Flutter

Web

Flutter + Web

Articles

Books

Extensions

Community

Learn more at the following links, which have been contributed by the community.

Packages

Video Tutorials

Written Resources

bloc (felangel/bloc)

dartlang
Searching Database…

12.5K ·GitHub
What is this?A predictable state management library for Dart that implements the BLoC design pattern — it separates presentation from business logic in Flutter and AngularDart apps.
Is it one package or a whole family of them?A family of packages on pub.dev: the core bloc, flutterbloc for Flutter, angularbloc for AngularDart, plus blocconcurrency, bloclint, bloctest, bloctools, hydratedbloc and replaybloc.
How do I add it to my app?Each piece is a pub.dev package — add bloc and flutterbloc to your pubspec (e.g. 'flutter pub add bloc flutter_bloc') and follow the Official Documentation linked in the README.
Does it drag in any services or keys of its own?No — it is a pure Dart library with no backend, accounts or API keys; the only prerequisite is a Flutter or AngularDart project to add it to.
Is it only usable from Flutter?No — the core bloc package works in pure Dart, angularbloc brings it to AngularDart web apps, and the README shows sharing code between a Flutter mobile app and an AngularDart web app.
Is my business logic easy to unit test?Yes — that is a stated goal of the library: separating presentation from business logic facilitates testability and reusability, and a dedicated bloctest package plus unit-testing tutorials support that.
Is there IDE support for creating blocs?Yes — official extensions for VS Code and IntelliJ/Android Studio add tools for effectively creating blocs in both Flutter and AngularDart apps.
Can a bloc remember its state between app restarts?Yes — the hydratedbloc package handles automatic state persistence, and the community tutorials cover exactly that scenario.
Are there sample apps showing real-world usage?Dozens — from a simple Counter to form validation, login and Firebase login flows, infinite lists, Github Search, a Weather app with pull-to-refresh, a Shopping Cart, a Wizard and Google I/O demos like I/O Pinball and I/O Flip.
Creator
felangel
Size
65.5 MB
Stars
12.5K
Age
8y
Commits · 90 Days