Skip to content

API Reference

This reference covers the core classes of the smart_refresher package. For visual customization, see Theming.

The primary widget that coordinates indicators and scroll physics.

PropertyTypeDefaultDescription
controllerRefreshControllerRequiredThe state manager for this refresher.
childWidget?nullThe scrollable content (e.g., ListView).
headerWidget?ClassicHeader()The top indicator for pull-to-refresh.
footerWidget?ClassicFooter()The bottom indicator for load-more.
enablePullDownbooltrueEnables/disables pull-to-refresh.
enablePullUpboolfalseEnables/disables pull-up loading.
onRefreshVoidCallback?nullCalled when the user pulls past the threshold.
onLoadingVoidCallback?nullCalled when the user reaches the bottom.
scrollControllerScrollController?nullOptional custom scroll controller.

The RefreshController is used to communicate with the SmartRefresher widget from your business logic (bloc, provider, or state).

Triggers the refresh state and animation immediately without user interaction.

refreshCompleted({bool resetFooterState = false})

Section titled “refreshCompleted({bool resetFooterState = false})”

Ends the refresh animation. If resetFooterState is true, it also resets the footer from a “noData” state back to “idle”.

Ends the refresh animation but shows the “Failed” state of the header.

Ends the infinite-scroll loading state and prepares the footer for the next pull.

Switches the footer to a “No more data” state. The footer will typically show a message or hide itself.

Ends the loading state but shows the “Failed” state of the footer.

  • headerStatus: Returns the current RefreshStatus (idle, canRefresh, refreshing, completed, failed).
  • footerStatus: Returns the current LoadStatus (idle, canLoading, loading, noData, failed).

A widget used at the root of your app to define global behavior for all refreshers in its subtree.

RefreshConfiguration(
headerTriggerDistance: 80.0,
footerTriggerDistance: 15.0,
maxOverScrollExtent: 100.0,
enableScrollWhenRefreshCompleted: true,
child: MaterialApp(...),
)