MethodChannelWebViewPlatform class

A WebViewPlatformController that uses a method channel to control the webview.

Implemented types

Constructors

MethodChannelWebViewPlatform(int id, WebViewPlatformCallbacksHandler _platformCallbacksHandler, JavascriptChannelRegistry _javascriptChannelRegistry)
Constructs an instance that will listen for webviews broadcasting to the given id, using the given WebViewPlatformCallbacksHandler.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Static Methods

clearCookies() Future<bool>
Method channel implementation for WebViewPlatform.clearCookies.
creationParamsToMap(CreationParams creationParams, {bool usesHybridComposition = false}) Map<String, dynamic>
Converts a CreationParams object to a map as expected by platform_views channel.
setCookie(WebViewCookie cookie) Future<void>
Method channel implementation for WebViewPlatform.setCookie.