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 ValueNotifier<LoadStatus>
footer status mode controll
read / write
footerStatus LoadStatus
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
headerMode ValueNotifier<RefreshStatus>
header status mode controll
read / write
headerStatus RefreshStatus
read-only
initialRefresh bool
final
isLoading bool
read-only
isRefresh bool
read-only
isTwoLevel bool
read-only
position ScrollPosition
the scrollable inner's position [...]
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scrollController ScrollController
deprecated member,not suggest to use it,it contain share position bug
@Deprecated('advice set ScrollController to child,use it directly will cause bug when call jumpTo() and animateTo()'), read / write

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 non-existent 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, 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, 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