Skip to content
pubscout

flutter_rx_bloc

7.0.0, released 2 years ago by primeholding.com

Flutter widgets that implement the BLoC pattern using reactive streams with rx_bloc and rxdart.

WASM-ready
$ flutter pub add flutter_rx_bloc
Source repository

What it does

Provides a set of Flutter widgets like RxBlocBuilder, RxResultBuilder, and RxBlocProvider to easily integrate reactive BLoC state management into your widget tree. It handles bloc lifecycle, dependency injection, and building UI in response to stream updates.

AI-written summary of version 7.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using the rx_bloc and rxdart architecture in your Flutter application.
  • You want concise reactive UI builders like RxBlocBuilder and RxResultBuilder without excessive boilerplate.
  • You need dependency injection and scoping for your blocs via RxBlocProvider.

Skip it when

  • You prefer the bloc and flutter_bloc packages instead of rx_bloc.
  • You are not using reactive streams or RxDart for your state management.

Strengths

  • Simplifies stream-based UI updates with clean widget builders.
  • Built-in handling of Result states via RxResultBuilder.
  • Seamless integration with RxBlocProvider for DI and bloc scoping.

Weaknesses

  • Strictly tied to the rx_bloc and rxdart ecosystem.
  • Requires learning the specific rx_bloc patterns and contracts.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3

Add flutter_rx_bloc, rx_bloc, and rxdart to your pubspec.yaml dependencies.

RxBlocBuilder<NewsBlocType, List<News>>(
  state: (bloc) => bloc.states.news,
  builder: (context, state, bloc) {
    return ListView.builder(
      itemCount: state.length,
      itemBuilder: (context, index) => Text(state[index].toString()),
    );
  },
)

Alternatives

Packages that do the same job and could replace flutter_rx_bloc.

  • flutter_bloc

    If you want to use the standard Bloc library instead of the reactive rx_bloc ecosystem.

  • flutter_riverpod

    If you want a modern, compile-safe state management solution without traditional blocs.

Works with

Packages commonly used together with flutter_rx_bloc: ones it builds on, ones built on it, and its own family.