RefreshController class

A controller controll header and footer state, it can trigger driving request Refresh ,set the initalRefresh,status if needed

See also:

  • SmartRefresher,a widget help you attach refresh and load more function easily

Constructors

RefreshController({bool initialRefresh = false, RefreshStatus? initialRefreshStatus, LoadStatus? initialLoadStatus})
initialRefresh:When SmartRefresher is init,it will call requestRefresh at once

Properties

footerMode RefreshNotifier<LoadStatus>?
footer status mode controll
getter/setter pair
footerStatus LoadStatus?
no setter
hashCode int
The hash code for this object.
no setterinherited
headerMode RefreshNotifier<RefreshStatus>?
header status mode controll
getter/setter pair
headerStatus RefreshStatus?
no setter
initialRefresh bool
final
isLoading bool
no setter
isRefresh bool
no setter
isTwoLevel bool
no setter
position ScrollPosition?
the scrollable inner's position
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
for some special situation, you should call dispose() for safe,it may throw errors after parent widget dispose
loadComplete() → void
after data returned,set the footer state to idle
loadFailed() → void
If catchError happen,you may call loadFailed indicate fetch data from network failed
loadNoData() → void
load more success without error,but no data returned
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onPositionUpdated(ScrollPosition newPosition) → void
callback when the indicator is builded,and catch the scrollable's inner position
refreshCompleted({bool resetFooterState = false}) → void
request complete,the header will enter complete state,
refreshFailed() → void
request failed,the header display failed state
refreshToIdle() → void
not show success or failed, it will set header state to idle and spring back at once
requestLoading({bool needMove = true, bool needCallback = true, Duration duration = const Duration(milliseconds: 300), Curve curve = Curves.linear}) Future<void>?
make the footer enter loading state,and callback onLoading
requestRefresh({bool needMove = true, bool needCallback = true, Duration duration = const Duration(milliseconds: 500), Curve curve = Curves.linear}) Future<void>?
make the header enter refreshing state,and callback onRefresh
requestTwoLevel({Duration duration = const Duration(milliseconds: 300), Curve curve = Curves.linear}) Future<void>
make the header enter refreshing state,and callback onRefresh
resetNoData() → void
reset footer noData state to idle
toString() String
A string representation of this object.
inherited
twoLevelComplete({Duration duration = const Duration(milliseconds: 500), Curve curve = Curves.linear}) Future<void>?
end twoLeveling,will return back first floor

Operators

operator ==(Object other) bool
The equality operator.
inherited