WebViewAndroidPlatformController class

Implementation of WebViewPlatformController with the Android WebView api.

Constructors

WebViewAndroidPlatformController({required bool useHybridComposition, required CreationParams creationParams, required WebViewPlatformCallbacksHandler callbacksHandler, required JavascriptChannelRegistry javascriptChannelRegistry, @visibleForTesting WebViewProxy webViewProxy = const WebViewProxy(), @visibleForTesting FlutterAssetManager flutterAssetManager = const android_webview.FlutterAssetManager(), @visibleForTesting WebStorage? webStorage})
Construct a WebViewAndroidPlatformController.

Properties

callbacksHandler → WebViewPlatformCallbacksHandler
Handles callbacks that are made by android_webview.WebViewClient, android_webview.DownloadListener, and android_webview.WebChromeClient.
final
downloadListener WebViewAndroidDownloadListener
Receives callbacks when content should be downloaded instead.
latefinal
flutterAssetManager → FlutterAssetManager
Manages access to Flutter assets that are part of the Android App bundle.
final
hashCode int
The hash code for this object.
no setterinherited
javascriptChannelRegistry → JavascriptChannelRegistry
Manages named JavaScript channels and forwarding incoming messages on the correct channel.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
webChromeClient WebViewAndroidWebChromeClient
Handles JavaScript dialogs, favicons, titles, new windows, and the progress for android_webview.WebView.
latefinal
webStorage → WebStorage
Manages the JavaScript storage APIs.
final
webView ↔ WebView
Represents the WebView maintained by platform code.
latefinal
webViewClient WebViewAndroidWebViewClient
Receive various notifications and requests for android_webview.WebView.
no setter
webViewProxy WebViewProxy
Handles constructing android_webview.WebViews and calling static methods.
final

Methods

addJavascriptChannels(Set<String> javascriptChannelNames) Future<void>
Adds new JavaScript channels to the set of enabled channels.
canGoBack() Future<bool>
Checks whether there's a back history item.
canGoForward() Future<bool>
Checks whether there's a forward history item.
clearCache() Future<void>
Clears all caches used by the WebView.
currentUrl() Future<String?>
Accessor to the current URL that the WebView is displaying.
evaluateJavascript(String javascript) Future<String>
Evaluates a JavaScript expression in the context of the current page.
getScrollX() Future<int>
Return the horizontal scroll position of this view.
getScrollY() Future<int>
Return the vertical scroll position of this view.
getTitle() Future<String?>
Returns the title of the currently loaded page.
goBack() Future<void>
Goes back in the history of this WebView.
goForward() Future<void>
Goes forward in the history of this WebView.
loadFile(String absoluteFilePath) Future<void>
Loads the file located on the specified absoluteFilePath.
loadFlutterAsset(String key) Future<void>
Loads the Flutter asset specified in the pubspec.yaml file.
loadHtmlString(String html, {String? baseUrl}) Future<void>
Loads the supplied HTML string.
loadRequest(WebViewRequest request) Future<void>
When making a POST request, headers are ignored. As a workaround, make the request manually and load the response data using loadHTMLString.
loadUrl(String url, Map<String, String>? headers) Future<void>
Loads the specified URL.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reload() Future<void>
Reloads the current URL.
removeJavascriptChannels(Set<String> javascriptChannelNames) Future<void>
Removes JavaScript channel names from the set of enabled channels.
runJavascript(String javascript) Future<void>
Runs the given JavaScript in the context of the current page.
runJavascriptReturningResult(String javascript) Future<String>
Runs the given JavaScript in the context of the current page, and returns the result.
scrollBy(int x, int y) Future<void>
Move the scrolled position of this view.
scrollTo(int x, int y) Future<void>
Set the scrolled position of this view.
toString() String
A string representation of this object.
inherited
updateSettings(WebSettings setting) Future<void>
Updates the webview settings.

Operators

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