Skip to content
pubscout

rx_bloc_list

5.0.1, released 2 years ago by primeholding.com

Facilitates infinite scroll and pull-to-refresh features for the RxBloc ecosystem.

WASM-ready
$ flutter pub add rx_bloc_list
Source repository

What it does

The rx_bloc_list package provides the RxPaginatedBuilder widget and extensions to easily implement pagination, infinity scroll, and pull-to-refresh. It integrates seamlessly with the RxBloc state management ecosystem.

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

Use it when

  • You are building an app using the RxBloc ecosystem and need paginated lists.
  • You want a straightforward way to add infinity scroll and pull-to-refresh to your UI.

Skip it when

  • You are not using the RxBloc ecosystem or reactive streams for state management.
  • You prefer alternative state management solutions like Riverpod or Provider.

Strengths

  • Simplifies implementing infinity scroll and pull-to-refresh.
  • Provides built-in support for refresh indicators and list item state management.

Weaknesses

  • Tightly coupled to the RxBloc ecosystem.
  • Limited usefulness if not using streams for pagination.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
4

Add the dependency to pubspec.yaml and import the package in your Dart code.

RxPaginatedBuilder<UserBlocType, User>.withRefreshIndicator(
  state: (bloc) => bloc.states.paginatedList,
  onBottomScrolled: (bloc) => bloc.events.loadPage(),
  onRefresh: (bloc) async {
    bloc.events.loadPage(reset: true);
    return bloc.states.refreshDone;
  },
  buildSuccess: (context, list, bloc) => ListView.builder(
    itemBuilder: (context, index) {
      final user = list.getItem(index);
      if (user == null) return const CircularProgressIndicator();
      return ListTile(title: Text(user.name));
    },
    itemCount: list.itemCount,
  ),
  buildLoading: (context, list, bloc) => const CircularProgressIndicator(),
  buildError: (context, list, bloc) => Text(list.error!.toString()),
)

Alternatives

Packages that do the same job and could replace rx_bloc_list.

  • rxdart_ext

    Extension methods and classes built on top of RxDart like Single and StateStream.

  • rx_widgets

    Stream-based Flutter widgets that facilitate a reactive programming style with RxDart and RxCommand.

  • flutter_meedu

    State management and dependency injection library for Flutter apps.

  • meedu

    A lightweight Flutter library for state management, dependency injection, and navigation without boilerplate.

Works with

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