AndroidPullToRefreshController class

A standard controller that can initiate the refreshing of a scroll view’s contents. This should be used whenever the user can refresh the contents of a WebView via a vertical swipe gesture.

All the methods should be called only when the WebView has been created or is already running (for example PlatformWebViewCreationParams.onWebViewCreated or PlatformInAppBrowserEvents.onBrowserCreated).

NOTE for Android: to be able to use the "pull-to-refresh" feature, InAppWebViewSettings.useHybridComposition must be true.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
Inheritance
  • Object
  • PlatformInterface
  • AndroidPullToRefreshController

Constructors

AndroidPullToRefreshController.new(PlatformPullToRefreshControllerCreationParams params)
Constructs a AndroidPullToRefreshController.

Properties

hashCode int
The hash code for this object.
no setterinherited
onRefresh → void Function()?
Event called when a swipe gesture triggers a refresh.
no setterinherited
options → PullToRefreshOptions
Use settings instead.
no setterinherited
params → PlatformPullToRefreshControllerCreationParams
The parameters used to initialize the PlatformPullToRefreshController.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings → PullToRefreshSettings
Initial settings.
no setterinherited

Methods

beginRefreshing() Future<void>
Tells the controller that a refresh operation was started programmatically.
dispose({bool isKeepAlive = false}) → void
Disposes the controller.
endRefreshing() Future<void>
Tells the controller that a refresh operation has ended.
getDefaultSlingshotDistance() Future<int>
Gets the default distance that the refresh indicator can be pulled beyond its resting position during a swipe gesture.
isEnabled() Future<bool>
Returns true is pull-to-refresh feature is enabled, otherwise false.
isRefreshing() Future<bool>
Returns whether a refresh operation has been triggered and is in progress.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAttributedTitle(IOSNSAttributedString attributedTitle) Future<void>
Use setStyledTitle instead.
inherited
setBackgroundColor(Color color) Future<void>
Sets the background color of the refresh control.
setColor(Color color) Future<void>
Sets the color of the refresh control.
setDistanceToTriggerSync(int distanceToTriggerSync) Future<void>
Set the distance to trigger a sync in dips.
setEnabled(bool enabled) Future<void>
Sets whether the pull-to-refresh feature is enabled or not.
setIndicatorSize(PullToRefreshSize size) Future<void>
Sets the size of the refresh indicator. One of PullToRefreshSize.DEFAULT, or PullToRefreshSize.LARGE.
setSize(AndroidPullToRefreshSize size) Future<void>
Use setIndicatorSize instead.
setSlingshotDistance(int slingshotDistance) Future<void>
Sets the distance that the refresh indicator can be pulled beyond its resting position during a swipe gesture.
setStyledTitle(AttributedString attributedTitle) Future<void>
Sets the styled title text to display in the refresh control.
inherited
toString() String
A string representation of this object.
inherited

Operators

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