HeadlessInAppWebView class
Class that represents a WebView in headless mode.
It can be used to run a WebView in background without attaching an InAppWebView
to the widget tree.
NOTE: Remember to dispose it when you don't need it anymore.
Supported Platforms/Implementations:
- Android native WebView
- iOS
- Web
- MacOS
- Implemented types
Constructors
-
HeadlessInAppWebView({Size initialSize = const Size(-1, -1), int? windowId, URLRequest? initialUrlRequest, String? initialFile, InAppWebViewInitialData? initialData, @Deprecated('Use initialSettings instead') InAppWebViewGroupOptions? initialOptions, InAppWebViewSettings? initialSettings, ContextMenu? contextMenu, UnmodifiableListView<
UserScript> ? initialUserScripts, PullToRefreshController? pullToRefreshController, FindInteractionController? findInteractionController, WebViewImplementation implementation = WebViewImplementation.NATIVE, void onWebViewCreated(InAppWebViewController controller)?, void onLoadStart(InAppWebViewController controller, WebUri? url)?, void onLoadStop(InAppWebViewController controller, WebUri? url)?, @Deprecated("Use onReceivedError instead") void onLoadError(InAppWebViewController controller, Uri? url, int code, String message)?, void onReceivedError(InAppWebViewController controller, WebResourceRequest request, WebResourceError error)?, @Deprecated("Use onReceivedHttpError instead") void onLoadHttpError(InAppWebViewController controller, Uri? url, int statusCode, String description)?, void onReceivedHttpError(InAppWebViewController controller, WebResourceRequest request, WebResourceResponse errorResponse)?, void onProgressChanged(InAppWebViewController controller, int progress)?, void onConsoleMessage(InAppWebViewController controller, ConsoleMessage consoleMessage)?, Future<NavigationActionPolicy?> shouldOverrideUrlLoading(InAppWebViewController controller, )?, void onLoadResource(InAppWebViewController controller, LoadedResource resource)?, void onScrollChanged(InAppWebViewController controller, int x, int y)?, @Deprecated('Use onDownloadStartRequest instead') void onDownloadStart(InAppWebViewController controller, Uri url)?, void onDownloadStartRequest(InAppWebViewController controller, DownloadStartRequest downloadStartRequest)?, @Deprecated('Use onLoadResourceWithCustomScheme instead') Future<CustomSchemeResponse?> onLoadResourceCustomScheme(InAppWebViewController controller, Uri url)?, Future<CustomSchemeResponse?> onLoadResourceWithCustomScheme(InAppWebViewController controller, WebResourceRequest request)?, Future<bool?> onCreateWindow(InAppWebViewController controller, CreateWindowAction createWindowAction)?, void onCloseWindow(InAppWebViewController controller)?, Future<JsAlertResponse?> onJsAlert(InAppWebViewController controller, JsAlertRequest jsAlertRequest)?, Future<JsConfirmResponse?> onJsConfirm(InAppWebViewController controller, JsConfirmRequest jsConfirmRequest)?, Future<JsPromptResponse?> onJsPrompt(InAppWebViewController controller, JsPromptRequest jsPromptRequest)?, Future<HttpAuthResponse?> onReceivedHttpAuthRequest(InAppWebViewController controller, URLAuthenticationChallenge challenge)?, Future<ServerTrustAuthResponse?> onReceivedServerTrustAuthRequest(InAppWebViewController controller, URLAuthenticationChallenge challenge)?, Future<ClientCertResponse?> onReceivedClientCertRequest(InAppWebViewController controller, URLAuthenticationChallenge challenge)?, @Deprecated('Use FindInteractionController.onFindResultReceived instead') void onFindResultReceived(InAppWebViewController controller, int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?, Future<AjaxRequest?> shouldInterceptAjaxRequest(InAppWebViewController controller, AjaxRequest ajaxRequest)?, Future<AjaxRequestAction?> onAjaxReadyStateChange(InAppWebViewController controller, AjaxRequest ajaxRequest)?, Future<AjaxRequestAction> onAjaxProgress(InAppWebViewController controller, AjaxRequest ajaxRequest)?, Future<FetchRequest?> shouldInterceptFetchRequest(InAppWebViewController controller, FetchRequest fetchRequest)?, void onUpdateVisitedHistory(InAppWebViewController controller, WebUri? url, bool? isReload)?, @Deprecated("Use onPrintRequest instead") void onPrint(InAppWebViewController controller, Uri? url)?, Future<bool?> onPrintRequest(InAppWebViewController controller, WebUri? url, PrintJobController? printJobController)?, void onLongPressHitTestResult(InAppWebViewController controller, InAppWebViewHitTestResult hitTestResult)?, void onEnterFullscreen(InAppWebViewController controller)?, void onExitFullscreen(InAppWebViewController controller)?, void onPageCommitVisible(InAppWebViewController controller, WebUri? url)?, void onTitleChanged(InAppWebViewController controller, String? title)?, void onWindowFocus(InAppWebViewController controller)?, void onWindowBlur(InAppWebViewController controller)?, void onOverScrolled(InAppWebViewController controller, int x, int y, bool clampedX, bool clampedY)?, @Deprecated('Use onSafeBrowsingHit instead') Future<SafeBrowsingResponse?> androidOnSafeBrowsingHit(InAppWebViewController controller, Uri url, SafeBrowsingThreat? threatType)?, Future<SafeBrowsingResponse?> onSafeBrowsingHit(InAppWebViewController controller, WebUri url, SafeBrowsingThreat? threatType)?, @Deprecated('Use onPermissionRequest instead') Future<PermissionRequestResponse?> androidOnPermissionRequest(InAppWebViewController controller, String origin, List<String> resources)?, Future<PermissionResponse?> onPermissionRequest(InAppWebViewController controller, PermissionRequest permissionRequest)?, @Deprecated('Use onGeolocationPermissionsShowPrompt instead') Future<GeolocationPermissionShowPromptResponse?> androidOnGeolocationPermissionsShowPrompt(InAppWebViewController controller, String origin)?, Future<GeolocationPermissionShowPromptResponse?> onGeolocationPermissionsShowPrompt(InAppWebViewController controller, String origin)?, @Deprecated('Use onGeolocationPermissionsHidePrompt instead') void androidOnGeolocationPermissionsHidePrompt(InAppWebViewController controller)?, void onGeolocationPermissionsHidePrompt(InAppWebViewController controller)?, @Deprecated('Use shouldInterceptRequest instead') Future<WebResourceResponse?> androidShouldInterceptRequest(InAppWebViewController controller, WebResourceRequest request)?, Future<WebResourceResponse?> shouldInterceptRequest(InAppWebViewController controller, WebResourceRequest request)?, @Deprecated('Use onRenderProcessGone instead') void androidOnRenderProcessGone(InAppWebViewController controller, RenderProcessGoneDetail detail)?, void onRenderProcessGone(InAppWebViewController controller, RenderProcessGoneDetail detail)?, @Deprecated('Use onRenderProcessResponsive instead') Future<WebViewRenderProcessAction?> androidOnRenderProcessResponsive(InAppWebViewController controller, Uri? url)?, Future<WebViewRenderProcessAction?> onRenderProcessResponsive(InAppWebViewController controller, WebUri? url)?, @Deprecated('Use onRenderProcessUnresponsive instead') Future<WebViewRenderProcessAction?> androidOnRenderProcessUnresponsive(InAppWebViewController controller, Uri? url)?, Future<WebViewRenderProcessAction?> onRenderProcessUnresponsive(InAppWebViewController controller, WebUri? url)?, @Deprecated('Use onFormResubmission instead') Future<FormResubmissionAction?> androidOnFormResubmission(InAppWebViewController controller, Uri? url)?, Future<FormResubmissionAction?> onFormResubmission(InAppWebViewController controller, WebUri? url)?, @Deprecated('Use onZoomScaleChanged instead') void androidOnScaleChanged(InAppWebViewController controller, double oldScale, double newScale)?, @Deprecated('Use onReceivedIcon instead') void androidOnReceivedIcon(InAppWebViewController controller, Uint8List icon)?, void onReceivedIcon(InAppWebViewController controller, Uint8List icon)?, @Deprecated('Use onReceivedTouchIconUrl instead') void androidOnReceivedTouchIconUrl(InAppWebViewController controller, Uri url, bool precomposed)?, void onReceivedTouchIconUrl(InAppWebViewController controller, WebUri url, bool precomposed)?, @Deprecated('Use onJsBeforeUnload instead') Future<JsBeforeUnloadResponse?> androidOnJsBeforeUnload(InAppWebViewController controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?, Future<JsBeforeUnloadResponse?> onJsBeforeUnload(InAppWebViewController controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?, @Deprecated('Use onReceivedLoginRequest instead') void androidOnReceivedLoginRequest(InAppWebViewController controller, LoginRequest loginRequest)?, void onReceivedLoginRequest(InAppWebViewController controller, LoginRequest loginRequest)?, void onPermissionRequestCanceled(InAppWebViewController controller, PermissionRequest permissionRequest)?, void onRequestFocus(InAppWebViewController controller)?, @Deprecated('Use onWebContentProcessDidTerminate instead') void iosOnWebContentProcessDidTerminate(InAppWebViewController controller)?, void onWebContentProcessDidTerminate(InAppWebViewController controller)?, @Deprecated('Use shouldAllowDeprecatedTLS instead') Future<IOSShouldAllowDeprecatedTLSAction?> iosShouldAllowDeprecatedTLS(InAppWebViewController controller, URLAuthenticationChallenge challenge)?, Future<ShouldAllowDeprecatedTLSAction?> shouldAllowDeprecatedTLS(InAppWebViewController controller, URLAuthenticationChallenge challenge)?, Future<void> onCameraCaptureStateChanged(InAppWebViewController controller, MediaCaptureState? oldState, MediaCaptureState? newState)?, Future<void> onMicrophoneCaptureStateChanged(InAppWebViewController controller, MediaCaptureState? oldState, MediaCaptureState? newState)?, void onContentSizeChanged(InAppWebViewController controller, Size oldContentSize, Size newContentSize)?}) -
Class that represents a WebView in headless mode.
It can be used to run a WebView in background without attaching an
InAppWebView
to the widget tree.
Properties
-
androidOnFormResubmission
↔ (Future<
FormResubmissionAction?> Function(InAppWebViewController controller, Uri? url)?) -
Use onFormResubmission instead.
getter/setter pairoverride-getter
- androidOnGeolocationPermissionsHidePrompt ↔ (void Function(InAppWebViewController controller)?)
-
Use onGeolocationPermissionsHidePrompt instead.
getter/setter pairoverride-getter
-
androidOnGeolocationPermissionsShowPrompt
↔ (Future<
GeolocationPermissionShowPromptResponse?> Function(InAppWebViewController controller, String origin)?) -
Use onGeolocationPermissionsShowPrompt instead.
getter/setter pairoverride-getter
-
androidOnJsBeforeUnload
↔ (Future<
JsBeforeUnloadResponse?> Function(InAppWebViewController controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?) -
Use onJsBeforeUnload instead.
getter/setter pairoverride-getter
-
androidOnPermissionRequest
↔ (Future<
PermissionRequestResponse?> Function(InAppWebViewController controller, String origin, List<String> resources)?) -
Use onPermissionRequest instead.
getter/setter pairoverride-getter
- androidOnReceivedIcon ↔ (void Function(InAppWebViewController controller, Uint8List icon)?)
-
Use onReceivedIcon instead
getter/setter pairoverride-getter
- androidOnReceivedLoginRequest ↔ (void Function(InAppWebViewController controller, LoginRequest loginRequest)?)
-
Use onReceivedLoginRequest instead.
getter/setter pairoverride-getter
- androidOnReceivedTouchIconUrl ↔ (void Function(InAppWebViewController controller, Uri url, bool precomposed)?)
-
Use onReceivedTouchIconUrl instead
getter/setter pairoverride-getter
- androidOnRenderProcessGone ↔ (void Function(InAppWebViewController controller, RenderProcessGoneDetail detail)?)
-
Use onRenderProcessGone instead.
getter/setter pairoverride-getter
-
androidOnRenderProcessResponsive
↔ (Future<
WebViewRenderProcessAction?> Function(InAppWebViewController controller, Uri? url)?) -
Use onRenderProcessResponsive instead.
getter/setter pairoverride-getter
-
androidOnRenderProcessUnresponsive
↔ (Future<
WebViewRenderProcessAction?> Function(InAppWebViewController controller, Uri? url)?) -
Use onRenderProcessUnresponsive instead.
getter/setter pairoverride-getter
-
androidOnSafeBrowsingHit
↔ (Future<
SafeBrowsingResponse?> Function(InAppWebViewController controller, Uri url, SafeBrowsingThreat? threatType)?) -
Use onSafeBrowsingHit instead.
getter/setter pairoverride-getter
- androidOnScaleChanged ↔ (void Function(InAppWebViewController controller, double oldScale, double newScale)?)
-
Use onZoomScaleChanged instead.
getter/setter pairoverride-getter
-
androidShouldInterceptRequest
↔ (Future<
WebResourceResponse?> Function(InAppWebViewController controller, WebResourceRequest request)?) -
Use shouldInterceptRequest instead.
getter/setter pairoverride-getter
- contextMenu → ContextMenu?
-
Context menu which contains custom menu items to be shown when ContextMenu is presented.
final
- findInteractionController → FindInteractionController?
-
Represents the find interaction feature controller.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String
-
View ID.
latefinal
- implementation → WebViewImplementation
-
Represents the WebView native implementation to be used.
The default value is WebViewImplementation.NATIVE.
final
- initialData → InAppWebViewInitialData?
-
Initial InAppWebViewInitialData that will be loaded.
final
- initialFile → String?
-
Initial asset file that will be loaded. See InAppWebViewController.loadFile for explanation.
final
- initialOptions → InAppWebViewGroupOptions?
-
Use initialSettings instead.
final
- initialSettings → InAppWebViewSettings?
-
Initial settings that will be used.
final
- initialSize → Size
-
The WebView initial size in pixels.
final
- initialUrlRequest → URLRequest?
-
Initial url request that will be loaded.
final
-
initialUserScripts
→ UnmodifiableListView<
UserScript> ? -
Initial list of user scripts to be loaded at start or end of a page loading.
To add or remove user scripts, you have to use the InAppWebViewController's methods such as InAppWebViewController.addUserScript,
InAppWebViewController.removeUserScript, InAppWebViewController.removeAllUserScripts, etc.
final
-
Use onDidReceiveServerRedirectForProvisionalNavigation instead.
getter/setter pairoverride-getter
-
Use onNavigationResponse instead.
getter/setter pairoverride-getter
- iosOnWebContentProcessDidTerminate ↔ (void Function(InAppWebViewController controller)?)
-
Use onWebContentProcessDidTerminate instead.
getter/setter pairoverride-getter
-
iosShouldAllowDeprecatedTLS
↔ (Future<
IOSShouldAllowDeprecatedTLSAction?> Function(InAppWebViewController controller, URLAuthenticationChallenge challenge)?) -
Use shouldAllowDeprecatedTLS instead.
getter/setter pairoverride-getter
-
onAjaxProgress
↔ (Future<
AjaxRequestAction> Function(InAppWebViewController controller, AjaxRequest ajaxRequest)?) -
Event fired as an
XMLHttpRequest
progress. It gives the host application a chance to abort the request.getter/setter pairoverride-getter -
onAjaxReadyStateChange
↔ (Future<
AjaxRequestAction?> Function(InAppWebViewController controller, AjaxRequest ajaxRequest)?) -
Event fired whenever the
readyState
attribute of anXMLHttpRequest
changes. It gives the host application a chance to abort the request.getter/setter pairoverride-getter -
onCameraCaptureStateChanged
↔ (Future<
void> Function(InAppWebViewController controller, MediaCaptureState? oldState, MediaCaptureState? newState)?) -
Event fired when a change in the camera capture state occurred.
getter/setter pairoverride-getter
- onCloseWindow ↔ (void Function(InAppWebViewController controller)?)
-
Event fired when the host application should close the given WebView and remove it from the view system if necessary.
At this point, WebCore has stopped any loading in this window and has removed any cross-scripting ability in javascript.
getter/setter pairoverride-getter
- onConsoleMessage ↔ (void Function(InAppWebViewController controller, ConsoleMessage consoleMessage)?)
-
Event fired when the WebView receives a ConsoleMessage.
getter/setter pairoverride-getter
- onContentSizeChanged ↔ (void Function(InAppWebViewController controller, Size oldContentSize, Size newContentSize)?)
-
Event fired when the content size of the WebView changes.
getter/setter pairoverride-getter
-
onCreateWindow
↔ (Future<
bool?> Function(InAppWebViewController controller, CreateWindowAction createWindowAction)?) -
Event fired when the WebView requests the host application to create a new window,
for example when trying to open a link with
target="_blank"
or whenwindow.open()
is called by JavaScript side. If the host application chooses to honor this request, it should returntrue
from this method, create a new WebView to host the window. If the host application chooses not to honor the request, it should returnfalse
from this method. The default implementation of this method does nothing and hence returnsfalse
.getter/setter pairoverride-getter -
Called when a web view receives a server redirect.
getter/setter pairoverride-getter
- onDownloadStart ↔ (void Function(InAppWebViewController controller, Uri url)?)
-
Use onDownloadStartRequest instead
getter/setter pairoverride-getter
- onDownloadStartRequest ↔ (void Function(InAppWebViewController controller, DownloadStartRequest downloadStartRequest)?)
-
Event fired when WebView recognizes a downloadable file.
To download the file, you can use the flutter_downloader plugin.
getter/setter pairoverride-getter
- onEnterFullscreen ↔ (void Function(InAppWebViewController controller)?)
-
Event fired when the current page has entered full screen mode.
getter/setter pairoverride-getter
- onExitFullscreen ↔ (void Function(InAppWebViewController controller)?)
-
Event fired when the current page has exited full screen mode.
getter/setter pairoverride-getter
- onFindResultReceived ↔ (void Function(InAppWebViewController controller, int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?)
-
Use FindInteractionController.onFindResultReceived instead.
getter/setter pairoverride-getter
-
onFormResubmission
↔ (Future<
FormResubmissionAction?> Function(InAppWebViewController controller, WebUri? url)?) -
As the host application if the browser should resend data as the requested page was a result of a POST. The default is to not resend the data.
getter/setter pairoverride-getter
- onGeolocationPermissionsHidePrompt ↔ (void Function(InAppWebViewController controller)?)
-
Notify the host application that a request for Geolocation permissions, made with a previous call to onGeolocationPermissionsShowPrompt has been canceled.
Any related UI should therefore be hidden.
getter/setter pairoverride-getter
-
onGeolocationPermissionsShowPrompt
↔ (Future<
GeolocationPermissionShowPromptResponse?> Function(InAppWebViewController controller, String origin)?) -
Event that notifies the host application that web content from the specified origin is attempting to use the Geolocation API, but no permission state is currently set for that origin.
Note that for applications targeting Android N and later SDKs (API level >
Build.VERSION_CODES.M
) this method is only called for requests originating from secure origins such as https. On non-secure origins geolocation requests are automatically denied.getter/setter pairoverride-getter -
onJsAlert
↔ (Future<
JsAlertResponse?> Function(InAppWebViewController controller, JsAlertRequest jsAlertRequest)?) -
Event fired when javascript calls the
alert()
method to display an alert dialog. If JsAlertResponse.handledByClient istrue
, the webview will assume that the client will handle the dialog.getter/setter pairoverride-getter -
onJsBeforeUnload
↔ (Future<
JsBeforeUnloadResponse?> Function(InAppWebViewController controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?) -
Event fired when the client should display a dialog to confirm navigation away from the current page.
This is the result of the
onbeforeunload
javascript event. If JsBeforeUnloadResponse.handledByClient istrue
, WebView will assume that the client will handle the confirm dialog. If JsBeforeUnloadResponse.handledByClient isfalse
, a default value oftrue
will be returned to javascript to accept navigation away from the current page. The default behavior is to returnfalse
. Setting the JsBeforeUnloadResponse.action to JsBeforeUnloadResponseAction.CONFIRM will navigate away from the current page, JsBeforeUnloadResponseAction.CANCEL will cancel the navigation.getter/setter pairoverride-getter -
onJsConfirm
↔ (Future<
JsConfirmResponse?> Function(InAppWebViewController controller, JsConfirmRequest jsConfirmRequest)?) -
Event fired when javascript calls the
confirm()
method to display a confirm dialog. If JsConfirmResponse.handledByClient istrue
, the webview will assume that the client will handle the dialog.getter/setter pairoverride-getter -
onJsPrompt
↔ (Future<
JsPromptResponse?> Function(InAppWebViewController controller, JsPromptRequest jsPromptRequest)?) -
Event fired when javascript calls the
prompt()
method to display a prompt dialog. If JsPromptResponse.handledByClient istrue
, the webview will assume that the client will handle the dialog.getter/setter pairoverride-getter - onLoadError ↔ (void Function(InAppWebViewController controller, Uri? url, int code, String message)?)
-
Use onReceivedError instead.
getter/setter pairoverride-getter
- onLoadHttpError ↔ (void Function(InAppWebViewController controller, Uri? url, int statusCode, String description)?)
-
Use onReceivedHttpError instead.
getter/setter pairoverride-getter
- onLoadResource ↔ (void Function(InAppWebViewController controller, LoadedResource resource)?)
-
Event fired when the WebView loads a resource.
getter/setter pairoverride-getter
-
onLoadResourceCustomScheme
↔ (Future<
CustomSchemeResponse?> Function(InAppWebViewController controller, Uri url)?) -
Use onLoadResourceWithCustomScheme instead.
getter/setter pairoverride-getter
-
onLoadResourceWithCustomScheme
↔ (Future<
CustomSchemeResponse?> Function(InAppWebViewController controller, WebResourceRequest request)?) -
Event fired when the WebView finds the
custom-scheme
while loading a resource. Here you can handle the urlrequest
and return a CustomSchemeResponse to load a specific resource encoded tobase64
.getter/setter pairoverride-getter - onLoadStart ↔ (void Function(InAppWebViewController controller, WebUri? url)?)
-
Event fired when the WebView starts to load an
url
.getter/setter pairoverride-getter - onLoadStop ↔ (void Function(InAppWebViewController controller, WebUri? url)?)
-
Event fired when the WebView finishes loading an
url
.getter/setter pairoverride-getter - onLongPressHitTestResult ↔ (void Function(InAppWebViewController controller, InAppWebViewHitTestResult hitTestResult)?)
-
Event fired when an HTML element of the webview has been clicked and held.
getter/setter pairoverride-getter
-
onMicrophoneCaptureStateChanged
↔ (Future<
void> Function(InAppWebViewController controller, MediaCaptureState? oldState, MediaCaptureState? newState)?) -
Event fired when a change in the microphone capture state occurred.
getter/setter pairoverride-getter
-
Called when a web view asks for permission to navigate to new content after the response to the navigation request is known.
getter/setter pairoverride-getter
- onOverScrolled ↔ (void Function(InAppWebViewController controller, int x, int y, bool clampedX, bool clampedY)?)
-
Event fired to respond to the results of an over-scroll operation.
getter/setter pairoverride-getter
- onPageCommitVisible ↔ (void Function(InAppWebViewController controller, WebUri? url)?)
-
Called when the web view begins to receive web content.
getter/setter pairoverride-getter
-
onPermissionRequest
↔ (Future<
PermissionResponse?> Function(InAppWebViewController controller, PermissionRequest permissionRequest)?) -
Event fired when the WebView is requesting permission to access the specified resources and the permission currently isn't granted or denied.
getter/setter pairoverride-getter
- onPermissionRequestCanceled ↔ (void Function(InAppWebViewController controller, PermissionRequest permissionRequest)?)
-
Notify the host application that the given permission request has been canceled. Any related UI should therefore be hidden.
getter/setter pairoverride-getter
- onPrint ↔ (void Function(InAppWebViewController controller, Uri? url)?)
-
Use onPrintRequest instead
getter/setter pairoverride-getter
-
onPrintRequest
↔ (Future<
bool?> Function(InAppWebViewController controller, WebUri? url, PrintJobController? printJobController)?) -
Event fired when
window.print()
is called from JavaScript side. Returntrue
if you want to handle the print job. Otherwise returnfalse
, so the PrintJobController will be handled and disposed automatically by the system.getter/setter pairoverride-getter - onProgressChanged ↔ (void Function(InAppWebViewController controller, int progress)?)
-
Event fired when the current
progress
of loading a page is changed.getter/setter pairoverride-getter -
onReceivedClientCertRequest
↔ (Future<
ClientCertResponse?> Function(InAppWebViewController controller, URLAuthenticationChallenge challenge)?) -
Notify the host application to handle an SSL client certificate request.
Webview stores the response in memory (for the life of the application) if ClientCertResponseAction.PROCEED or ClientCertResponseAction.CANCEL
is called and does not call onReceivedClientCertRequest again for the same host and port pair.
Note that, multiple layers in chromium network stack might be caching the responses.
getter/setter pairoverride-getter
- onReceivedError ↔ (void Function(InAppWebViewController controller, WebResourceRequest request, WebResourceError error)?)
-
Event fired when the WebView encounters an
error
loading arequest
.getter/setter pairoverride-getter -
onReceivedHttpAuthRequest
↔ (Future<
HttpAuthResponse?> Function(InAppWebViewController controller, URLAuthenticationChallenge challenge)?) -
Event fired when the WebView received an HTTP authentication request. The default behavior is to cancel the request.
getter/setter pairoverride-getter
- onReceivedHttpError ↔ (void Function(InAppWebViewController controller, WebResourceRequest request, WebResourceResponse errorResponse)?)
-
Event fired when the WebView receives an HTTP error.
getter/setter pairoverride-getter
- onReceivedIcon ↔ (void Function(InAppWebViewController controller, Uint8List icon)?)
-
Event fired when there is new favicon for the current page.
getter/setter pairoverride-getter
- onReceivedLoginRequest ↔ (void Function(InAppWebViewController controller, LoginRequest loginRequest)?)
-
Event fired when a request to automatically log in the user has been processed.
getter/setter pairoverride-getter
-
onReceivedServerTrustAuthRequest
↔ (Future<
ServerTrustAuthResponse?> Function(InAppWebViewController controller, URLAuthenticationChallenge challenge)?) -
Event fired when the WebView need to perform server trust authentication (certificate validation).
The host application must return either ServerTrustAuthResponse instance with ServerTrustAuthResponseAction.CANCEL or ServerTrustAuthResponseAction.PROCEED.
getter/setter pairoverride-getter
- onReceivedTouchIconUrl ↔ (void Function(InAppWebViewController controller, WebUri url, bool precomposed)?)
-
Event fired when there is an url for an apple-touch-icon.
getter/setter pairoverride-getter
- onRenderProcessGone ↔ (void Function(InAppWebViewController controller, RenderProcessGoneDetail detail)?)
-
Event fired when the given WebView's render process has exited.
The application's implementation of this callback should only attempt to clean up the WebView.
The WebView should be removed from the view hierarchy, all references to it should be cleaned up.
getter/setter pairoverride-getter
-
onRenderProcessResponsive
↔ (Future<
WebViewRenderProcessAction?> Function(InAppWebViewController controller, WebUri? url)?) -
Event called once when an unresponsive renderer currently associated with the WebView becomes responsive.
getter/setter pairoverride-getter
-
onRenderProcessUnresponsive
↔ (Future<
WebViewRenderProcessAction?> Function(InAppWebViewController controller, WebUri? url)?) -
Event called when the renderer currently associated with the WebView becomes unresponsive as a result of a long running blocking task such as the execution of JavaScript.
getter/setter pairoverride-getter
- onRequestFocus ↔ (void Function(InAppWebViewController controller)?)
-
Request display and focus for this WebView.
This may happen due to another WebView opening a link in this WebView and requesting that this WebView be displayed.
getter/setter pairoverride-getter
-
onSafeBrowsingHit
↔ (Future<
SafeBrowsingResponse?> Function(InAppWebViewController controller, WebUri url, SafeBrowsingThreat? threatType)?) -
Event fired when the webview notifies that a loading URL has been flagged by Safe Browsing.
The default behavior is to show an interstitial to the user, with the reporting checkbox visible.
getter/setter pairoverride-getter
- onScrollChanged ↔ (void Function(InAppWebViewController controller, int x, int y)?)
-
Event fired when the WebView scrolls.
getter/setter pairoverride-getter
- onTitleChanged ↔ (void Function(InAppWebViewController controller, String? title)?)
-
Event fired when a change in the document title occurred.
getter/setter pairoverride-getter
- onUpdateVisitedHistory ↔ (void Function(InAppWebViewController controller, WebUri? url, bool? isReload)?)
-
Event fired when the host application updates its visited links database.
This event is also fired when the navigation state of the WebView changes through the usage of
javascript History API functions (
pushState()
,replaceState()
) andonpopstate
event or, also, when the javascriptwindow.location
changes without reloading the webview (for example appending or modifying a hash to the url).getter/setter pairoverride-getter - onWebContentProcessDidTerminate ↔ (void Function(InAppWebViewController controller)?)
-
Invoked when the web view's web content process is terminated.
getter/setter pairoverride-getter
- onWebViewCreated ↔ (void Function(InAppWebViewController controller)?)
-
Event fired when the WebView is created.
getter/setter pairoverride-getter
- onWindowBlur ↔ (void Function(InAppWebViewController controller)?)
-
Event fired when the JavaScript
window
object of the WebView has lost focus. This is the result of theblur
JavaScript event applied to thewindow
object.getter/setter pairoverride-getter - onWindowFocus ↔ (void Function(InAppWebViewController controller)?)
-
Event fired when the JavaScript
window
object of the WebView has received focus. This is the result of thefocus
JavaScript event applied to thewindow
object.getter/setter pairoverride-getter - onZoomScaleChanged ↔ (void Function(InAppWebViewController controller, double oldScale, double newScale)?)
-
Event fired when the zoom scale of the WebView has changed.
getter/setter pairoverride-getter
- pullToRefreshController → PullToRefreshController?
-
Represents the pull-to-refresh feature controller.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shouldAllowDeprecatedTLS
↔ (Future<
ShouldAllowDeprecatedTLSAction?> Function(InAppWebViewController controller, URLAuthenticationChallenge challenge)?) -
Called when a web view asks whether to continue with a connection that uses a deprecated version of TLS (v1.0 and v1.1).
getter/setter pairoverride-getter
-
shouldInterceptAjaxRequest
↔ (Future<
AjaxRequest?> Function(InAppWebViewController controller, AjaxRequest ajaxRequest)?) -
Event fired when an
XMLHttpRequest
is sent to a server. It gives the host application a chance to take control over the request before sending it.getter/setter pairoverride-getter -
shouldInterceptFetchRequest
↔ (Future<
FetchRequest?> Function(InAppWebViewController controller, FetchRequest fetchRequest)?) -
Event fired when a request is sent to a server through Fetch API.
It gives the host application a chance to take control over the request before sending it.
getter/setter pairoverride-getter
-
shouldInterceptRequest
↔ (Future<
WebResourceResponse?> Function(InAppWebViewController controller, WebResourceRequest request)?) -
Notify the host application of a resource request and allow the application to return the data.
If the return value is
null
, the WebView will continue to load the resource as usual. Otherwise, the return response and data will be used.getter/setter pairoverride-getter -
shouldOverrideUrlLoading
↔ (Future<
NavigationActionPolicy?> Function(InAppWebViewController controller, )?) -
Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
getter/setter pairoverride-getter
- webViewController ↔ InAppWebViewController
-
WebView Controller that can be used to access the InAppWebViewController API.
latefinal
- windowId → int?
-
The window id of a CreateWindowAction.windowId.
final
Methods
-
dispose(
) → Future< void> - Disposes the headless WebView.
-
getSize(
) → Future< Size?> - Gets the current size in pixels of the WebView.
-
handleMethod(
MethodCall call) → Future -
isRunning(
) → bool - Indicates if the headless WebView is running or not.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
) → Future< void> - Runs the headless WebView.
-
setSize(
Size size) → Future< void> - Set the size of the WebView in pixels.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited