Web3WebView class
InAppWebViewEIP1193 wrap InAppWebView(https://pub.dev/packages/flutter_inappwebview) and config communicate between web app and wallet via standard EIP-1193 Flutter widget wrapping InAppWebView with EIP-1193 bridge.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Web3WebView
Constructors
-
Web3WebView({Key? key, required Web3WalletConfig? web3WalletConfig, int? windowId, URLRequest? initialUrlRequest, String? initialFile, InAppWebViewInitialData? initialData, InAppWebViewSettings? initialSettings, UnmodifiableListView<
UserScript> ? initialUserScripts, PullToRefreshController? pullToRefreshController, ContextMenu? contextMenu, void onWebViewCreated(InAppWebViewController controller)?, void onLoadStart(InAppWebViewController controller, Uri? url)?, void onLoadStop(InAppWebViewController controller, Uri? url)?, void onReceivedError(InAppWebViewController controller, WebResourceRequest request, WebResourceError error)?, void onReceivedHttpError(InAppWebViewController controller, WebResourceRequest request, WebResourceResponse response)?, void onConsoleMessage(InAppWebViewController controller, ConsoleMessage consoleMessage)?, void onProgressChanged(InAppWebViewController controller, int progress)?, Future<NavigationActionPolicy?> shouldOverrideUrlLoading(InAppWebViewController controller, )?, void onLoadResource(InAppWebViewController controller, LoadedResource resource)?, void onScrollChanged(InAppWebViewController controller, int x, int y)?, void onDownloadStartRequest(InAppWebViewController controller, DownloadStartRequest downloadStartRequest)?, Future<CustomSchemeResponse?> onLoadResourceWithCustomScheme(InAppWebViewController controller, WebResourceRequest webResourceRequest)?, 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)?, 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, Uri? url, bool? androidIsReload)?, Future<bool?> onPrintRequest(InAppWebViewController controller, WebUri? webUri, PlatformPrintJobController? platformPrintJobController)?, void onLongPressHitTestResult(InAppWebViewController controller, InAppWebViewHitTestResult hitTestResult)?, void onEnterFullscreen(InAppWebViewController controller)?, void onExitFullscreen(InAppWebViewController controller)?, void onPageCommitVisible(InAppWebViewController controller, Uri? 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)?, void onZoomScaleChanged(InAppWebViewController controller, double oldScale, double newScale)?, Future<SafeBrowsingResponse?> onSafeBrowsingHit(InAppWebViewController controller, Uri url, SafeBrowsingThreat? threatType)?, Future<PermissionResponse?> onPermissionRequest(InAppWebViewController controller, PermissionRequest permissionRequest)?, Future<GeolocationPermissionShowPromptResponse?> onGeolocationPermissionsShowPrompt(InAppWebViewController controller, String origin)?, void onGeolocationPermissionsHidePrompt(InAppWebViewController controller)?, Future<WebResourceResponse?> shouldInterceptRequest(InAppWebViewController controller, WebResourceRequest request)?, void onRenderProcessGone(InAppWebViewController controller, RenderProcessGoneDetail detail)?, Future<WebViewRenderProcessAction?> onRenderProcessResponsive(InAppWebViewController controller, Uri? url)?, Future<WebViewRenderProcessAction?> onRenderProcessUnresponsive(InAppWebViewController controller, Uri? url)?, Future<FormResubmissionAction?> onFormResubmission(InAppWebViewController controller, Uri? url)?, void onReceivedIcon(InAppWebViewController controller, Uint8List icon)?, void onReceivedTouchIconUrl(InAppWebViewController controller, Uri url, bool precomposed)?, Future<JsBeforeUnloadResponse?> onJsBeforeUnload(InAppWebViewController controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?, void onReceivedLoginRequest(InAppWebViewController controller, LoginRequest loginRequest)?, void onWebContentProcessDidTerminate(InAppWebViewController controller)?, Future<ShouldAllowDeprecatedTLSAction?> shouldAllowDeprecatedTLS(InAppWebViewController controller, URLAuthenticationChallenge challenge)?, Set<Factory< ? gestureRecognizers})OneSequenceGestureRecognizer> > -
const
Properties
- contextMenu → ContextMenu?
-
Context menu which contains custom menu items to be shown when ContextMenu is presented.
final
-
gestureRecognizers
→ Set<
Factory< ?OneSequenceGestureRecognizer> > -
gestureRecognizersspecifies which gestures should be consumed by the WebView. It is possible for other gesture recognizers to be competing with the web view on pointer events, e.g if the web view is inside a ListView the ListView will want to handle vertical drags. The web view will claim gestures that are recognized by any of the recognizers on this list. WhengestureRecognizersis empty or null, the web view will only handle pointer events for gestures that were not claimed by any other gesture recognizer.final - hashCode → int
-
The hash code for this object.
no setterinherited
- initialData → InAppWebViewInitialData?
-
Initial InAppWebViewInitialData that will be loaded.
final
- initialFile → String?
-
Initial asset file that will be loaded. See InAppWebViewController.loadFile for explanation.
final
- initialSettings → InAppWebViewSettings?
-
Initial options that will be used.
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
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onAjaxProgress
→ Future<
AjaxRequestAction> Function(InAppWebViewController controller, AjaxRequest ajaxRequest)? -
Event fired as an
XMLHttpRequestprogress. It gives the host application a chance to abort the request.final -
onAjaxReadyStateChange
→ Future<
AjaxRequestAction?> Function(InAppWebViewController controller, AjaxRequest ajaxRequest)? -
Event fired whenever the
readyStateattribute of anXMLHttpRequestchanges. It gives the host application a chance to abort the request.final - 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.
final
- onConsoleMessage → void Function(InAppWebViewController controller, ConsoleMessage consoleMessage)?
-
Event fired when the
WebViewreceives a ConsoleMessage.final -
onCreateWindow
→ Future<
bool?> Function(InAppWebViewController controller, CreateWindowAction createWindowAction)? -
Event fired when the
WebViewrequests the host application to create a new window, for example when trying to open a link withtarget="_blank"or whenwindow.open()is called by JavaScript side. If the host application chooses to honor this request, it should returntruefrom this method, create a new WebView to host the window. If the host application chooses not to honor the request, it should returnfalsefrom this method. The default implementation of this method does nothing and hence returnsfalse.final -
Called when a web view receives a server redirect.
final
- onDownloadStartRequest → void Function(InAppWebViewController controller, DownloadStartRequest downloadStartRequest)?
-
Event fired when
WebViewrecognizes a downloadable file. To download the file, you can use the flutter_downloader plugin.final - onEnterFullscreen → void Function(InAppWebViewController controller)?
-
Event fired when the current page has entered full screen mode.
final
- onExitFullscreen → void Function(InAppWebViewController controller)?
-
Event fired when the current page has exited full screen mode.
final
- onFindResultReceived → void Function(InAppWebViewController controller, int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?
-
Event fired as find-on-page operations progress.
The listener may be notified multiple times while the operation is underway, and the
numberOfMatchesvalue should not be considered final unlessisDoneCountingis true.final -
onFormResubmission
→ Future<
FormResubmissionAction?> Function(InAppWebViewController controller, Uri? 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.
final
- 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.
final
-
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.final -
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.final -
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
onbeforeunloadjavascript event. If JsBeforeUnloadResponse.handledByClient istrue, WebView will assume that the client will handle the confirm dialog. If JsBeforeUnloadResponse.handledByClient isfalse, a default value oftruewill 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.final -
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.final -
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.final - onLoadResource → void Function(InAppWebViewController controller, LoadedResource resource)?
-
Event fired when the
WebViewloads a resource.final -
onLoadResourceWithCustomScheme
→ Future<
CustomSchemeResponse?> Function(InAppWebViewController controller, WebResourceRequest webResourceRequest)? -
Event fired when the
WebViewfinds thecustom-schemewhile loading a resource. Here you can handle the url request and return a CustomSchemeResponse to load a specific resource encoded tobase64.final - onLoadStart → void Function(InAppWebViewController controller, Uri? url)?
-
Event fired when the
WebViewstarts to load anurl.final - onLoadStop → void Function(InAppWebViewController controller, Uri? url)?
-
Event fired when the
WebViewfinishes loading anurl.final - onLongPressHitTestResult → void Function(InAppWebViewController controller, InAppWebViewHitTestResult hitTestResult)?
-
Event fired when an HTML element of the webview has been clicked and held.
final
-
Called when a web view asks for permission to navigate to new content after the response to the navigation request is known.
final
- 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.
final
- onPageCommitVisible → void Function(InAppWebViewController controller, Uri? url)?
-
Called when the web view begins to receive web content.
final
-
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.
final
-
onPrintRequest
→ Future<
bool?> Function(InAppWebViewController controller, WebUri? webUri, PlatformPrintJobController? platformPrintJobController)? -
Event fired when
window.print()is called from JavaScript side.final - onProgressChanged → void Function(InAppWebViewController controller, int progress)?
-
Event fired when the current
progressof loading a page is changed.final -
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.
final
- onReceivedError → void Function(InAppWebViewController controller, WebResourceRequest request, WebResourceError error)?
-
Event fired when the
WebViewencounters an error loading anurl.final -
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.
final
- onReceivedHttpError → void Function(InAppWebViewController controller, WebResourceRequest request, WebResourceResponse response)?
-
Event fired when the
WebViewmain page receives an HTTP error.final - onReceivedIcon → void Function(InAppWebViewController controller, Uint8List icon)?
-
Event fired when there is new favicon for the current page.
final
- onReceivedLoginRequest → void Function(InAppWebViewController controller, LoginRequest loginRequest)?
-
Event fired when a request to automatically log in the user has been processed.
final
-
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.
final
- onReceivedTouchIconUrl → void Function(InAppWebViewController controller, Uri url, bool precomposed)?
-
Event fired when there is an url for an apple-touch-icon.
final
- 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.
final
-
onRenderProcessResponsive
→ Future<
WebViewRenderProcessAction?> Function(InAppWebViewController controller, Uri? url)? -
Event called once when an unresponsive renderer currently associated with the WebView becomes responsive.
final
-
onRenderProcessUnresponsive
→ Future<
WebViewRenderProcessAction?> Function(InAppWebViewController controller, Uri? 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.
final
-
onSafeBrowsingHit
→ Future<
SafeBrowsingResponse?> Function(InAppWebViewController controller, Uri 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.
final
- onScrollChanged → void Function(InAppWebViewController controller, int x, int y)?
-
Event fired when the
WebViewscrolls.final - onTitleChanged → void Function(InAppWebViewController controller, String? title)?
-
Event fired when a change in the document title occurred.
final
- onUpdateVisitedHistory → void Function(InAppWebViewController controller, Uri? url, bool? androidIsReload)?
-
Event fired when the host application updates its visited links database.
This event is also fired when the navigation state of the
WebViewchanges through the usage of javascript History API functions (pushState(),replaceState()) andonpopstateevent or, also, when the javascriptwindow.locationchanges without reloading the webview (for example appending or modifying an hash to the url).final - onWebContentProcessDidTerminate → void Function(InAppWebViewController controller)?
-
Invoked when the web view's web content process is terminated.
final
- onWebViewCreated → void Function(InAppWebViewController controller)?
-
Event fired when the
WebViewis created.final - onWindowBlur → void Function(InAppWebViewController controller)?
-
Event fired when the JavaScript
windowobject of the WebView has lost focus. This is the result of theblurJavaScript event applied to thewindowobject.final - onWindowFocus → void Function(InAppWebViewController controller)?
-
Event fired when the JavaScript
windowobject of the WebView has received focus. This is the result of thefocusJavaScript event applied to thewindowobject.final - onZoomScaleChanged → void Function(InAppWebViewController controller, double oldScale, double newScale)?
-
Event fired when the zoom scale of the WebView has changed.
final
- 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).
final
-
shouldInterceptAjaxRequest
→ Future<
AjaxRequest?> Function(InAppWebViewController controller, AjaxRequest ajaxRequest)? -
Event fired when an
XMLHttpRequestis sent to a server. It gives the host application a chance to take control over the request before sending it.final -
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.
final
-
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.final -
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. This event is not called on the initial load of the WebView.
final
- web3WalletConfig → Web3WalletConfig?
-
web3WalletConfig.
final
- windowId → int?
-
The window id of a CreateWindowAction.windowId.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< Web3WebView> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited