• Stars
    star
    11,351
  • Rank 2,788 (Top 0.06 %)
  • Language
    Dart
  • License
    MIT License
  • Created over 5 years ago
  • Updated 28 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Bloc

build codecov Star on Github 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
bloc pub package
bloc_test pub package
bloc_concurrency pub package
flutter_bloc pub package
angular_bloc pub package
hydrated_bloc pub package
replay_bloc pub package
sealed_flutter_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

  • Counter - an example of how to create a CounterBloc (pure dart).

Flutter

  • Counter - an example of how to create a CounterBloc to implement the classic Flutter Counter app.
  • Form Validation - an example of how to use the bloc and flutter_bloc packages to implement form validation.
  • Bloc with Stream - an example of how to hook up a bloc to a Stream and update the UI in response to data from the Stream.
  • Complex List - an example of how to manage a list of items and asynchronously delete items one at a time using bloc and flutter_bloc.
  • Infinite List - an example of how to use the bloc and flutter_bloc packages to implement an infinite scrolling list.
  • Login Flow - an example of how to use the bloc and flutter_bloc packages to implement a Login Flow.
  • Firebase Login - an example of how to use the bloc and flutter_bloc packages to implement login via Firebase.
  • Github Search - an example of how to create a Github Search Application using the bloc and flutter_bloc packages.
  • Weather - an example of how to create a Weather Application using the bloc and flutter_bloc packages. The app uses a RefreshIndicator to implement "pull-to-refresh" as well as dynamic theming.
  • Todos - an example of how to create a Todos Application using the bloc and flutter_bloc packages.
  • Timer - an example of how to create a Timer using the bloc and flutter_bloc packages.
  • Shopping Cart - an example of how to create a Shopping Cart Application using the bloc and flutter_bloc packages based on flutter samples.
  • Dynamic Form - an example of how to use the bloc and flutter_bloc packages to implement a dynamic form which pulls data from a repository.
  • Wizard - an example of how to build a multi-step wizard using the bloc and flutter_bloc packages.
  • Fluttersaurus - an example of how to use the bloc and flutter_bloc packages to create a thesaurus app -- made for Bytconf Flutter 2020.
  • I/O Photo Booth - an example of how to use the bloc and flutter_bloc packages to create a virtual photo booth web app -- made for Google I/O 2021.
  • I/O Pinball - an example of how to use the bloc and flutter_bloc packages to create a pinball web app -- made for Google I/O 2022.

Web

  • Counter - an example of how to use a CounterBloc in an AngularDart app.
  • Github Search - an example of how to create a Github Search Application using the bloc and angular_bloc packages.

Flutter + Web

  • Github Search - an example of how to create a Github Search Application and share code between Flutter and AngularDart.

Articles

Books

  • Flutter Complete Reference - A book about the Dart programming language (version 2.10, with null safety support) and the Flutter framework (version 1.20). It covers the bloc package (version 6.0.3) in all flavors: bloc, flutter_bloc hydrated_bloc, replay_bloc, bloc_test and cubit.

Extensions

  • IntelliJ - extends IntelliJ/Android Studio with support for the Bloc library and provides tools for effectively creating Blocs for both Flutter and AngularDart apps.
  • VSCode - extends VSCode with support for the Bloc library and provides tools for effectively creating Blocs for both Flutter and AngularDart apps.

Community

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

Packages

Video Tutorials

Written Resources

Extensions

Maintainers

More Repositories

1

mason

Tools which allow developers to create and consume reusable templates called bricks.
Dart
890
star
2

equatable

A Dart package that helps to implement value based equality without needing to explicitly override == and hashCode.
Dart
784
star
3

cubit

Cubit is a lightweight state management solution. It is a subset of the bloc package that does not rely on events and instead uses methods to emit new states.
Dart
583
star
4

mocktail

A mock library for Dart inspired by mockito
Dart
540
star
5

flow_builder

Flutter Flows made easy! A Flutter package which simplifies navigation flows with a flexible, declarative API.
Dart
375
star
6

fresh

πŸ‹ A token refresh library for Dart.
Dart
271
star
7

hydrated_bloc

An extension to the bloc state management library which automatically persists and restores bloc states.
Dart
189
star
8

bloc.js

A predictable state management library that helps implement the BLoC design pattern in JavaScript
TypeScript
182
star
9

fluttersaurus

A Flutter Thesaurus made for Byteconf Flutter 2020
Dart
148
star
10

web_socket_client

A simple WebSocket client for Dart which includes automatic reconnection logic.
Dart
79
star
11

sealed_flutter_bloc

flutter_bloc state management extension that integrates sealed_unions.
Dart
70
star
12

flutter_hub

one-stop-shop to discover flutter projects, developers, and news
Dart
66
star
13

flutter_text_view_plugin

A simple flutter plugin that demonstrates how to use PlatformViews with Android to embed native views within the flutter widget tree.
Dart
43
star
14

felangel

31
star
15

bloc_library_basics_and_beyond

Bloc Library: Basics and Beyond - Flutter Europe Talk 2020
Dart
30
star
16

flutter_services_binding

A subset of WidgetsFlutterBinding specifically for initializing the ServicesBinding.
C++
27
star
17

inherited_stream

An inherited widget for Streams, which updates its dependencies when the stream emits data.
C++
22
star
18

cubit_and_beyond

Cubit and Beyond - Talk given at Flutter Vikings 2020
Dart
21
star
19

flutter_flows

A sample Flutter project which demonstrates how to use flow_builder. Part of talk given at Flutter Hub 2021
Dart
20
star
20

sealed_flutter_bloc_samples

Dart
20
star
21

rainbow_container

🌈 A magical container which changes colors whenever its build method is called.
C++
20
star
22

stream_listener

Stream Helpers for Flutter & Dart
Dart
20
star
23

meet_mason

Meet Mason: Introduction to Templating and Code Generation presented at Flutter Vikings 2022
18
star
24

broadcast_bloc

An extension to the bloc state management library which adds support for broadcasting state changes to stream channels.
Dart
16
star
25

cool_counter

A cool counter application which showcases HydratedCubit and ReplayCubit -- Flutter Warsaw 2020
Dart
16
star
26

hydrated_weather

An example of how to use hydrated_bloc to cache application state in a Weather App
Dart
15
star
27

homebrew-mason

The official mason tap for homebrew
Ruby
13
star
28

codemagic_bloc_unit_tests

Bloc Unit Tests + Codemagic YAML
Dart
13
star
29

Flutter-Localization

Dart
9
star
30

simple_weather

A simple weather app built with flutter and the metaweather api.
Dart
7
star
31

bloc_todos

Dart
6
star
32

Flutter-Nested-TabBar

Dart
5
star
33

nested

A Flutter Widget which helps nest multiple widgets without needing to manually nest them.
Dart
4
star
34

flutter_platform_view_error

Ruby
3
star
35

flutter_skt_map_bug

Java
2
star
36

FelixAngelov

2
star
37

flutter_flavors_bug

C++
1
star
38

dartdevc_exception_bug

Dart
1
star
39

e2e_zones

C++
1
star
40

monorepo-ci-test

Dart
1
star
41

locale-manager

Locale-Manager is designed to be the simplest way possible to localize content while keeping an organized, scalable project structure.
JavaScript
1
star