IOSInAppWebViewController class
Controls a WebView, such as an InAppWebView
widget instance, a IOSHeadlessInAppWebView instance or IOSInAppBrowser WebView instance.
If you are using the InAppWebView
widget, an InAppWebViewController
instance can be obtained by setting the InAppWebView.onWebViewCreated
callback. Instead, if you are using an IOSInAppBrowser instance, you can get it through the IOSInAppBrowser.webViewController attribute.
- Inheritance
-
- Object
- PlatformInterface
- IOSInAppWebViewController
Constructors
- IOSInAppWebViewController(PlatformInAppWebViewControllerCreationParams params)
-
IOSInAppWebViewController.fromInAppBrowser(PlatformInAppWebViewControllerCreationParams params, MethodChannel channel, IOSInAppBrowser inAppBrowser, UnmodifiableListView<
UserScript> ? initialUserScripts) - IOSInAppWebViewController.static()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → dynamic
-
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.id}
WebView ID.
@{endtemplate}
no setterinherited
- params → PlatformInAppWebViewControllerCreationParams
-
The parameters used to initialize the
PlatformInAppWebViewController
.finalinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tRexRunnerCss
→ Future<
String> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.tRexRunnerCss}
Gets the css of the Chromium's t-rex runner game. Used in combination with tRexRunnerHtml.
no setter
-
tRexRunnerHtml
→ Future<
String> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.tRexRunnerHtml}
Gets the html (with javascript) of the Chromium's t-rex runner game. Used in combination with tRexRunnerCss.
no setter
- webStorage ↔ IOSWebStorage
-
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.webStorage}
Provides access to the JavaScript Web Storage API:
window.sessionStorage
andwindow.localStorage
. @{endtemplate}getter/setter pair - webviewParams → PlatformWebViewCreationParams?
-
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.webviewParams}
WebView params.
@{endtemplate}
no setterinherited
Methods
-
addJavaScriptHandler(
{required String handlerName, required JavaScriptHandlerCallback callback}) → void -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.addJavaScriptHandler}
Adds a JavaScript message handler
callback
(JavaScriptHandlerCallback
) that listen to post messages sent from JavaScript by the handler with namehandlerName
. -
addUserScript(
{required UserScript userScript}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.addUserScript}
Injects the specified
userScript
into the webpage’s content. -
addUserScripts(
{required List< UserScript> userScripts}) → Future<void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.addUserScripts}
Injects the
userScripts
into the webpage’s content. -
addWebMessageListener(
PlatformWebMessageListener webMessageListener) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.addWebMessageListener}
Adds a
PlatformWebMessageListener
to the WebView and injects a JavaScript object into each frame that thePlatformWebMessageListener
will listen on. -
callAsyncJavaScript(
{required String functionBody, Map< String, dynamic> arguments = const <String, dynamic>{}, ContentWorld? contentWorld}) → Future<CallAsyncJavaScriptResult?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.callAsyncJavaScript} Executes the specified string as an asynchronous JavaScript function.
-
canGoBack(
) → Future< bool> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.canGoBack} Returns a boolean value indicating whether the WebView can move backward.
-
canGoBackOrForward(
{required int steps}) → Future< bool> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.canGoBackOrForward} Returns a boolean value indicating whether the WebView can go back or forward the given number of steps. Steps is negative if backward and positive if forward.
-
canGoForward(
) → Future< bool> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.canGoForward} Returns a boolean value indicating whether the WebView can move forward.
-
canScrollHorizontally(
) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.canScrollHorizontally}
Returns
true
if the webpage can scroll horizontally, otherwisefalse
. -
canScrollVertically(
) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.canScrollVertically}
Returns
true
if the webpage can scroll vertically, otherwisefalse
. -
clearCache(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.clearCache} Clears all the WebView's cache.
-
clearClientCertPreferences(
) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.clearClientCertPreferences}
Clears the client certificate preferences stored in response to proceeding/cancelling client cert requests.
Note that WebView automatically clears these preferences when the system keychain is updated.
The preferences are shared by all the WebViews that are created by the embedder application.
inherited
-
clearFocus(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.clearFocus} Clears the current focus. On iOS and Android native WebView, it will clear also, for example, the current text selection.
-
clearHistory(
) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.clearHistory}
Clears the internal back/forward list.
inherited
-
clearMatches(
) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.clearMatches}
Use
PlatformFindInteractionController.clearMatches
instead. @{endtemplate} -
clearSslPreferences(
) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.clearSslPreferences}
Clears the SSL preferences table stored in response to proceeding with SSL certificate errors.
inherited
-
closeAllMediaPresentations(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.closeAllMediaPresentations} Closes all media the web view is presenting, including picture-in-picture video and fullscreen video.
-
createPdf(
{IOSWKPDFConfiguration? iosWKPdfConfiguration, PDFConfiguration? pdfConfiguration}) → Future< Uint8List?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.createPdf}
Generates PDF data from the web view’s contents asynchronously.
Returns
null
if a problem occurred. -
createWebArchiveData(
) → Future< Uint8List?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.createWebArchiveData}
Creates a web archive of the web view’s current contents asynchronously.
Returns
null
if a problem occurred. -
createWebMessageChannel(
) → Future< IOSWebMessageChannel?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.createWebMessageChannel} Creates a message channel to communicate with JavaScript and returns the message channel with ports that represent the endpoints of this message channel. The HTML5 message channel functionality is described here.
-
disableWebView(
) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.disableWebView}
Indicate that the current process does not intend to use WebView,
and that an exception should be thrown if a WebView is created or any other
methods in the
android.webkit
package are used.inherited -
dispose(
{bool isKeepAlive = false}) → void - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.dispose} Disposes the controller. @{endtemplate}
-
disposeKeepAlive(
InAppWebViewKeepAlive keepAlive) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.disposeKeepAlive}
Disposes the WebView that is using the
keepAlive
instance for the keep alive feature. -
evaluateJavascript(
{required String source, ContentWorld? contentWorld}) → Future -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.evaluateJavascript}
Evaluates JavaScript
source
code into the WebView and returns the result of the evaluation. -
findAllAsync(
{required String find}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.findAllAsync}
Use
PlatformFindInteractionController.findAll
instead. @{endtemplate} -
findNext(
{required bool forward}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.findNext}
Use
PlatformFindInteractionController.findNext
instead. @{endtemplate} -
getCameraCaptureState(
) → Future< MediaCaptureState?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getCameraCaptureState}
Returns a
MediaCaptureState
that indicates whether the webpage is using the camera to capture images or video. -
getCertificate(
) → Future< SslCertificate?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getCertificate} Gets the SSL certificate for the main top-level page or null if there is no certificate (the site is not secure).
-
getContentHeight(
) → Future< int?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getContentHeight} Gets the height of the HTML content.
-
getContentWidth(
) → Future< int?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getContentWidth} Gets the width of the HTML content.
-
getCopyBackForwardList(
) → Future< WebHistory?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getCopyBackForwardList} Gets the WebHistory for this WebView. This contains the back/forward list for use in querying each item in the history stack. This contains only a snapshot of the current state. Multiple calls to this method may return different objects. The object returned from this method will not be updated to reflect any new state.
-
getCurrentWebViewPackage(
) → Future< WebViewPackageInfo?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getCurrentWebViewPackage}
If WebView has already been loaded into the current process this method will return the package that was used to load it.
Otherwise, the package that would be used if the WebView was loaded right now will be returned;
this does not cause WebView to be loaded, so this information may become outdated at any time.
The WebView package changes either when the current WebView package is updated, disabled, or uninstalled.
It can also be changed through a Developer Setting. If the WebView package changes, any app process that
has loaded WebView will be killed.
The next time the app starts and loads WebView it will use the new WebView package instead.
inherited
-
getDefaultUserAgent(
) → Future< String> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getDefaultUserAgent} Gets the default user agent.
-
getFavicons(
) → Future< List< Favicon> > - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getFavicons} Gets the list of all favicons for the current page.
-
getHitTestResult(
) → Future< InAppWebViewHitTestResult?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getHitTestResult} Gets the hit result for hitting an HTML elements.
-
getHtml(
) → Future< String?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getHtml} Gets the content html of the page. It first tries to get the content through javascript. If this doesn't work, it tries to get the content reading the file:
-
getIFrameId(
) → Future< String?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getIFrameId}
Returns the iframe
id
attribute used on the Web platform.inherited -
getMetaTags(
) → Future< List< MetaTag> > -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getMetaTags}
Returns the list of
<meta>
tags of the current WebView. -
getMetaThemeColor(
) → Future< Color?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getMetaThemeColor}
Returns an instance of Color representing the
content
value of the<meta name="theme-color" content="">
tag of the current WebView, if available, otherwisenull
. -
getMicrophoneCaptureState(
) → Future< MediaCaptureState?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getMicrophoneCaptureState}
Returns a
MediaCaptureState
that indicates whether the webpage is using the microphone to capture audio. -
getOptions(
) → Future< InAppWebViewGroupOptions?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getOptions} Use getSettings instead. @{endtemplate}
-
getOriginalUrl(
) → Future< WebUri?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getOriginalUrl}
Gets the URL that was originally requested for the current page.
This is not always the same as the URL passed to
InAppWebView.onLoadStart
because although the load for that URL has begun, the current page may not have changed. Also, there may have been redirects resulting in a different URL to that originally requested. -
getProgress(
) → Future< int?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getProgress} Gets the progress for the current page. The progress value is between 0 and 100.
-
getSafeBrowsingPrivacyPolicyUrl(
) → Future< WebUri?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getSafeBrowsingPrivacyPolicyUrl}
Returns a URL pointing to the privacy policy for Safe Browsing reporting.
inherited
-
getScale(
) → Future< double?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getScale} Use getZoomScale instead. @{endtemplate}
-
getScrollX(
) → Future< int?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getScrollX} Returns the scrolled left position of the current WebView.
-
getScrollY(
) → Future< int?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getScrollY} Returns the scrolled top position of the current WebView.
-
getSelectedText(
) → Future< String?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getSelectedText} Gets the selected text.
-
getSettings(
) → Future< InAppWebViewSettings?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getSettings}
Gets the current WebView settings. Returns
null
if it wasn't able to get them. -
getTitle(
) → Future< String?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getTitle} Gets the title for the current page.
-
getTRexRunnerCss(
) → Future< String> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getTRexRunnerCss} Use tRexRunnerCss instead. @{endtemplate}
-
getTRexRunnerHtml(
) → Future< String> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getTRexRunnerHtml} Use tRexRunnerHtml instead. @{endtemplate}
-
getUrl(
) → Future< WebUri?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getUrl}
Gets the URL for the current page.
This is not always the same as the URL passed to
PlatformWebViewCreationParams.onLoadStart
because although the load for that URL has begun, the current page may not have changed. -
getVariationsHeader(
) → Future< String?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.getVariationsHeader}
Gets the WebView variations encoded to be used as the X-Client-Data HTTP header.
inherited
-
getViewId(
) → dynamic - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getViewId} View ID used internally. @{endtemplate}
-
getZoomScale(
) → Future< double?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.getZoomScale} Gets the current zoom scale of the WebView.
-
goBack(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.goBack} Goes back in the history of the WebView.
-
goBackOrForward(
{required int steps}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.goBackOrForward} Goes to the history item that is the number of steps away from the current item. Steps is negative if backward and positive if forward.
-
goForward(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.goForward} Goes forward in the history of the WebView.
-
goTo(
{required WebHistoryItem historyItem}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.goTo}
Navigates to a
WebHistoryItem
from the back-forwardWebHistory.list
and sets it as the current item. -
handlesURLScheme(
String urlScheme) → Future< bool> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.handlesURLScheme} Returns a Boolean value that indicates whether WebKit natively supports resources with the specified URL scheme.
-
hasJavaScriptHandler(
{required String handlerName}) → bool -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.hasJavaScriptHandler}
Returns
true
if a JavaScript handler withhandlerName
already exists, otherwisefalse
. -
hasOnlySecureContent(
) → Future< bool> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.hasOnlySecureContent} A Boolean value indicating whether all resources on the page have been loaded over securely encrypted connections.
-
hasUserScript(
{required UserScript userScript}) → bool -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.hasUserScript}
Returns
true
if theuserScript
has been already added, otherwisefalse
. -
hasWebMessageListener(
PlatformWebMessageListener webMessageListener) → bool -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.hasWebMessageListener}
Returns
true
if thewebMessageListener
has been already added, otherwisefalse
. -
injectCSSCode(
{required String source}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.injectCSSCode} Injects CSS into the WebView.
-
injectCSSFileFromAsset(
{required String assetFilePath}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.injectCSSFileFromAsset} Injects a CSS file into the WebView from the flutter assets directory.
-
injectCSSFileFromUrl(
{required WebUri urlFile, CSSLinkHtmlTagAttributes? cssLinkHtmlTagAttributes}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.injectCSSFileFromUrl} Injects an external CSS file into the WebView from a defined url.
-
injectJavascriptFileFromAsset(
{required String assetFilePath}) → Future - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.injectJavascriptFileFromAsset} Evaluates the content of a JavaScript file into the WebView from the flutter assets directory.
-
injectJavascriptFileFromUrl(
{required WebUri urlFile, ScriptHtmlTagAttributes? scriptHtmlTagAttributes}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.injectJavascriptFileFromUrl} Injects an external JavaScript file into the WebView from a defined url.
-
isInFullscreen(
) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.isInFullscreen}
Returns
true
if theWebView
is in fullscreen mode, otherwisefalse
. -
isLoading(
) → Future< bool> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.isLoading} Check if the WebView instance is in a loading state.
-
isMultiProcessEnabled(
) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.isMultiProcessEnabled}
Returns
true
if WebView is running in multi process mode.inherited -
isSecureContext(
) → Future< bool> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.isSecureContext} Indicates whether the webpage context is capable of using features that require secure contexts. This is implemented using Javascript (see window.isSecureContext).
-
loadData(
{required String data, String mimeType = "text/html", String encoding = "utf8", WebUri? baseUrl, Uri? androidHistoryUrl, WebUri? historyUrl, Uri? iosAllowingReadAccessTo, WebUri? allowingReadAccessTo}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.loadData}
Loads the given
data
into this WebView, usingbaseUrl
as the base URL for the content. -
loadFile(
{required String assetFilePath}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.loadFile}
Loads the given
assetFilePath
. -
loadSimulatedRequest(
{required URLRequest urlRequest, required Uint8List data, URLResponse? urlResponse}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.loadSimulatedRequest}
Loads the web content from the data you provide as if the data were the response to the request.
If
urlResponse
isnull
, it loads the web content from the data as an utf8 encoded HTML string as the response to the request. -
loadUrl(
{required URLRequest urlRequest, Uri? iosAllowingReadAccessTo, WebUri? allowingReadAccessTo}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.loadUrl}
Loads the given
urlRequest
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pageDown(
{required bool bottom}) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.pageDown}
Scrolls the contents of this WebView down by half the page size.
Returns
true
if the page was scrolled.inherited -
pageUp(
{required bool top}) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.pageUp}
Scrolls the contents of this WebView up by half the view size.
Returns
true
if the page was scrolled.inherited -
pause(
) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.pause}
Does a best-effort attempt to pause any processing that can be paused safely, such as animations and geolocation. Note that this call does not pause JavaScript.
To pause JavaScript globally, use
PlatformInAppWebViewController.pauseTimers
. To resume WebView, callresume
.inherited -
pauseAllMediaPlayback(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.pauseAllMediaPlayback} Pauses playback of all media in the web view.
-
pauseTimers(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.pauseTimers} On Android native WebView, it pauses all layout, parsing, and JavaScript timers for all WebViews. This is a global requests, not restricted to just this WebView. This can be useful if the application has been paused.
-
postUrl(
{required WebUri url, required Uint8List postData}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.postUrl}
Loads the given
url
withpostData
(x-www-form-urlencoded) usingPOST
method into this WebView. -
postWebMessage(
{required WebMessage message, WebUri? targetOrigin}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.postWebMessage} Post a message to main frame. The embedded application can restrict the messages to a certain target origin. See HTML5 spec for how target origin can be used.
-
printCurrentPage(
{PrintJobSettings? settings}) → Future< IOSPrintJobController?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.printCurrentPage} Prints the current page.
-
reload(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.reload} Reloads the WebView.
-
reloadFromOrigin(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.reloadFromOrigin} Reloads the current page, performing end-to-end revalidation using cache-validating conditionals if possible.
-
removeAllUserScripts(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.removeAllUserScripts} Removes all the user scripts from the webpage’s content.
-
removeJavaScriptHandler(
{required String handlerName}) → JavaScriptHandlerCallback? -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.removeJavaScriptHandler}
Removes a JavaScript message handler previously added with the addJavaScriptHandler associated to
handlerName
key. Returns the value associated withhandlerName
before it was removed. Returnsnull
ifhandlerName
was not found. -
removeUserScript(
{required UserScript userScript}) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.removeUserScript}
Removes the specified
userScript
from the webpage’s content. User scripts already loaded into the webpage's content cannot be removed. This will have effect only on the next page load. Returnstrue
ifuserScript
was in the list,false
otherwise. -
removeUserScripts(
{required List< UserScript> userScripts}) → Future<void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.removeUserScripts}
Removes the
userScripts
from the webpage’s content. User scripts already loaded into the webpage's content cannot be removed. This will have effect only on the next page load. -
removeUserScriptsByGroupName(
{required String groupName}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.removeUserScriptsByGroupName}
Removes all the
UserScript
s withgroupName
as group name from the webpage’s content. User scripts already loaded into the webpage's content cannot be removed. This will have effect only on the next page load. -
requestFocusNodeHref(
) → Future< RequestFocusNodeHrefResult?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.requestFocusNodeHref} Requests the anchor or image element URL at the last tapped point.
-
requestImageRef(
) → Future< RequestImageRefResult?> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.requestImageRef} Requests the URL of the image last touched by the user.
-
requestMediaPlaybackState(
) → Future< MediaPlaybackState?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.requestMediaPlaybackState}
Requests the playback status of media in the web view.
Returns a
MediaPlaybackState
that indicates whether the media in the web view is playing, paused, or suspended. If there’s no media in the web view to play, this method providesMediaPlaybackState.NONE
. -
resume(
) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.resume}
Resumes a WebView after a previous call to
pause
.inherited -
resumeTimers(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.resumeTimers} On Android, it resumes all layout, parsing, and JavaScript timers for all WebViews. This will resume dispatching all timers.
-
saveWebArchive(
{required String filePath, bool autoname = false}) → Future< String?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.saveWebArchive}
Saves the current WebView as a web archive.
Returns the file path under which the web archive file was saved, or
null
if saving the file failed. -
scrollBy(
{required int x, required int y, bool animated = false}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.scrollBy} Moves the scrolled position of the WebView.
-
scrollTo(
{required int x, required int y, bool animated = false}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.scrollTo} Scrolls the WebView to the position.
-
setAllMediaPlaybackSuspended(
{required bool suspended}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.setAllMediaPlaybackSuspended}
Changes whether the webpage is suspending playback of all media in the page.
Pass
true
to pause all media the web view is playing. Neither the user nor the webpage can resume playback until you call this method again withfalse
. -
setCameraCaptureState(
{required MediaCaptureState state}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.setCameraCaptureState} Changes whether the webpage is using the camera to capture images or video.
-
setContextMenu(
ContextMenu? contextMenu) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.setContextMenu} Sets or updates the WebView context menu to be used next time it will appear.
-
setMicrophoneCaptureState(
{required MediaCaptureState state}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.setMicrophoneCaptureState} Changes whether the webpage is using the microphone to capture audio.
-
setOptions(
{required InAppWebViewGroupOptions options}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.setOptions} Use setSettings instead. @{endtemplate}
-
setSafeBrowsingAllowlist(
{required List< String> hosts}) → Future<bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.setSafeBrowsingAllowlist}
Sets the list of hosts (domain names/IP addresses) that are exempt from SafeBrowsing checks. The list is global for all the WebViews.
inherited
-
setSafeBrowsingWhitelist(
{required List< String> hosts}) → Future<bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.setSafeBrowsingWhitelist}
Use
setSafeBrowsingAllowlist
instead. @{endtemplate}inherited -
setSettings(
{required InAppWebViewSettings settings}) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.setSettings}
Sets the WebView settings with the new
settings
and evaluates them. -
setWebContentsDebuggingEnabled(
bool debuggingEnabled) → Future< void> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.setWebContentsDebuggingEnabled}
Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this application.
This flag can be enabled in order to facilitate debugging of web layouts and JavaScript code running inside WebViews.
Please refer to WebView documentation for the debugging guide. The default is
false
.inherited -
startSafeBrowsing(
) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.startSafeBrowsing}
Starts Safe Browsing initialization.
inherited
-
stopLoading(
) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.stopLoading} Stops the WebView from loading.
-
takeScreenshot(
{ScreenshotConfiguration? screenshotConfiguration}) → Future< Uint8List?> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.takeScreenshot}
Takes a screenshot of the WebView's visible viewport and returns a Uint8List. Returns
null
if it wasn't be able to take it. -
toString(
) → String -
A string representation of this object.
inherited
-
zoomBy(
{required double zoomFactor, bool? iosAnimated, bool animated = false}) → Future< void> - {@template flutter_webview_platform_interface.PlatformInAppWebViewController.zoomBy} Performs a zoom operation in this WebView.
-
zoomIn(
) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.zoomIn}
Performs zoom in in this WebView.
Returns
true
if zoom in succeeds,false
if no zoom changes.inherited -
zoomOut(
) → Future< bool> -
{@template flutter_webview_platform_interface.PlatformInAppWebViewController.zoomOut}
Performs zoom out in this WebView.
Returns
true
if zoom out succeeds,false
if no zoom changes.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited