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.
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.
82Compare - rx_widgets
Stream-based Flutter widgets that facilitate a reactive programming style with RxDart and RxCommand.
45Compare - flutter_meedu
State management and dependency injection library for Flutter apps.
67Compare - meedu
A lightweight Flutter library for state management, dependency injection, and navigation without boilerplate.
60Compare
Works with
Packages commonly used together with rx_bloc_list: ones it builds on, ones built on it, and its own family.
- rxdartrx_bloc_list depends on itImplementation of the ReactiveX API for asynchronous programming leveraging native Dart Streams.
- rx_blocrx_bloc_list depends on itA BLoC design pattern implementation using reactive streams.
- flutter_rx_blocrx_bloc_list depends on itFlutter widgets that implement the BLoC pattern using reactive streams with rx_bloc and rxdart.
- rx_bloc_generatorSame familyCode generator for rx_bloc that eliminates boilerplate code.
- rx_bloc_testSame familyEasily test rxBlocs and states from the FlutterRxBloc package.
- rx_bloc_cliSame familyrx_bloc_cli that enables quick project setup including: flavors, localization [intl], state management [rx_bloc], routing [go_router], design system, analytics [firebase], tests
- widget_toolkitSame familyThe Widget Toolkit package consists of several lightweight and customisable UI components that boost productivity and reduce the development time.