PlatformPullToRefreshController class abstract

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).

Inheritance
Implemented types
Annotations
  • @SupportedPlatforms.new(platforms: [AndroidPlatform(note: '**NOTE**: to be able to use the "pull-to-refresh" feature, [InAppWebViewSettings.useHybridComposition] must be `true`.'), IOSPlatform(), WindowsPlatform(note: 'Implemented in the Flutter platform-view gesture layer and WebView2 JavaScript scroll-position check.')])

Constructors

PlatformPullToRefreshController(PlatformPullToRefreshControllerCreationParams params)
Creates a new PlatformPullToRefreshController
factory
PlatformPullToRefreshController.implementation(PlatformPullToRefreshControllerCreationParams params)
Used by the platform implementation to create a new PlatformPullToRefreshController.
PlatformPullToRefreshController.static()
Creates a new empty PlatformPullToRefreshController to access static methods.
factory

Properties

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

Methods

beginRefreshing() Future<void>
Tells the controller that a refresh operation was started programmatically.
dispose({bool isKeepAlive = false}) → void
Disposes the controller.
override
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.
isClassSupported({TargetPlatform? platform}) bool
Check if the current class is supported by the defaultTargetPlatform or a specific platform.
isEnabled() Future<bool>
Returns true is pull-to-refresh feature is enabled, otherwise false.
isMethodSupported(PlatformPullToRefreshControllerMethod method, {TargetPlatform? platform}) bool
Check if the given method is supported by the defaultTargetPlatform or a specific platform.
isPropertySupported(PlatformPullToRefreshControllerCreationParamsProperty property, {TargetPlatform? platform}) bool
Check if the given property is supported by the defaultTargetPlatform or a specific platform.
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.
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.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

debugLoggingSettings DebugLoggingSettings
Debug settings.
getter/setter pair