RxPaginatedBuilder<B extends RxBlocTypeBase, T>.withRefreshIndicator constructor
RxPaginatedBuilder<B extends RxBlocTypeBase, T>.withRefreshIndicator ({
- required Stream<
PaginatedList< state(T> >- B
- required Widget buildSuccess(
- BuildContext,
- PaginatedList<
T> , - B
- required Widget buildError(
- BuildContext,
- PaginatedList<
T> , - B
- required Widget buildLoading(
- BuildContext,
- PaginatedList<
T> ?, - B
- required Future<
void> onRefresh(- B
- required void onBottomScrolled(
- B
- dynamic onScrolled()?,
- B? bloc,
- double scrollThreshold = 100,
- bool enableOnBottomScrolledCallback = true,
RxPaginatedBuilder constructor with refresh indicator.
An addition to the default constructor is the requirement for the
onRefresh
callback which will be executed once the refreshed using
the pull-down to refresh feature.
Implementation
factory RxPaginatedBuilder.withRefreshIndicator({
required Stream<PaginatedList<T>> Function(B) state,
required Widget Function(BuildContext, PaginatedList<T>, B) buildSuccess,
required Widget Function(BuildContext, PaginatedList<T>, B) buildError,
required Widget Function(BuildContext, PaginatedList<T>?, B) buildLoading,
required Future<void> Function(B) onRefresh,
required void Function(B) onBottomScrolled,
Function(bool)? onScrolled,
B? bloc,
double scrollThreshold = 100,
bool enableOnBottomScrolledCallback = true,
}) =>
RxPaginatedBuilder(
bloc: bloc,
state: state,
buildSuccess: buildSuccess,
buildLoading: buildLoading,
buildError: buildError,
onBottomScrolled: onBottomScrolled,
onScrolled: onScrolled,
scrollThreshold: scrollThreshold,
enableOnBottomScrolledCallback: enableOnBottomScrolledCallback,
wrapperBuilder: (_, b, c) => RefreshIndicator(
child: c,
onRefresh: () async => await onRefresh(b),
),
);