AndroidWebViewController class
Implementation of the PlatformWebViewController with the Android WebView API.
- Inheritance
-
- Object
- PlatformInterface
- PlatformWebViewController
- AndroidWebViewController
Constructors
- AndroidWebViewController.new(PlatformWebViewControllerCreationParams params)
- Creates a new AndroidWebViewController.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- params → PlatformWebViewControllerCreationParams
-
The parameters used to initialize the PlatformWebViewController.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- webViewIdentifier → int
-
Identifier used to retrieve the underlying native
WebView
.no setter
Methods
-
addJavaScriptChannel(
JavaScriptChannelParams javaScriptChannelParams) → Future< void> -
Adds a new JavaScript channel 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 -
clearLocalStorage(
) → Future< void> -
Clears the local storage used by the
WebView
.override -
currentUrl(
) → Future< String?> -
Accessor to the current URL that the WebView is displaying.
override
-
enableZoom(
bool enabled) → Future< void> -
Whether to support zooming using its on-screen zoom controls and gestures.
override
-
getScrollPosition(
) → Future< Offset> -
Return the current scroll position of this view.
override
-
getTitle(
) → Future< String?> -
Returns the title of the currently loaded page.
override
-
getUserAgent(
) → Future< String?> -
Gets the value used for the HTTP
User-Agent:
request header.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(
LoadRequestParams params) → Future< void> -
Makes a specific HTTP request ands loads the response in the webview.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reload(
) → Future< void> -
Reloads the current URL.
override
-
removeJavaScriptChannel(
String javaScriptChannelName) → Future< void> -
Removes the JavaScript channel with the matching name 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< Object> -
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
-
setAllowContentAccess(
bool enabled) → Future< void> - Enables or disables content URL access.
-
setAllowFileAccess(
bool allow) → Future< void> - Sets the file access permission for the web view.
-
setBackgroundColor(
Color color) → Future< void> -
Set the current background color of this view.
override
-
setCustomWidgetCallbacks(
{required OnShowCustomWidgetCallback? onShowCustomWidget, required OnHideCustomWidgetCallback? onHideCustomWidget}) → Future< void> - Sets the callbacks that are invoked when the host application wants to show or hide a custom widget.
-
setGeolocationEnabled(
bool enabled) → Future< void> - Sets whether Geolocation is enabled.
-
setGeolocationPermissionsPromptCallbacks(
{OnGeolocationPermissionsShowPrompt? onShowPrompt, OnGeolocationPermissionsHidePrompt? onHidePrompt}) → Future< void> - Sets the callback that is invoked when the client request handle geolocation permissions.
-
setHorizontalScrollBarEnabled(
bool enabled) → Future< void> -
Whether the horizontal scrollbar should be drawn or not.
override
-
setJavaScriptMode(
JavaScriptMode javaScriptMode) → Future< void> -
Sets the JavaScript execution mode to be used by the webview.
override
-
setMediaPlaybackRequiresUserGesture(
bool require) → Future< void> - Sets the restrictions that apply on automatic media playback.
-
setOnConsoleMessage(
void onConsoleMessage(JavaScriptConsoleMessage consoleMessage)) → Future< void> -
Sets a callback that notifies the host application of any log messages
written to the JavaScript console.
override
-
setOnJavaScriptAlertDialog(
Future< void> onJavaScriptAlertDialog(JavaScriptAlertDialogRequest request)) → Future<void> -
Sets a callback that notifies the host application that the web page
wants to display a JavaScript alert() dialog.
override
-
setOnJavaScriptConfirmDialog(
Future< bool> onJavaScriptConfirmDialog(JavaScriptConfirmDialogRequest request)) → Future<void> -
Sets a callback that notifies the host application that the web page
wants to display a JavaScript confirm() dialog.
override
-
setOnJavaScriptTextInputDialog(
Future< String> onJavaScriptTextInputDialog(JavaScriptTextInputDialogRequest request)) → Future<void> -
Sets a callback that notifies the host application that the web page
wants to display a JavaScript prompt() dialog.
override
-
setOnPlatformPermissionRequest(
void onPermissionRequest(PlatformWebViewPermissionRequest request)) → Future< void> -
Sets a callback that notifies the host application that web content is
requesting permission to access the specified resources.
override
-
setOnScrollPositionChange(
void onScrollPositionChange(ScrollPositionChange scrollPositionChange)?) → Future< void> -
Sets the listener for content offset changes.
override
-
setOnShowFileSelector(
Future< List< onShowFileSelector(FileSelectorParams params)?) → Future<String> >void> - Sets the callback that is invoked when the client should show a file selector.
-
setOverScrollMode(
WebViewOverScrollMode mode) → Future< void> -
Sets the over-scroll mode for the WebView.
override
-
Sets the PlatformNavigationDelegate containing the callback methods that
are called during navigation events.
override
-
setTextZoom(
int textZoom) → Future< void> - Sets the text zoom of the page in percent.
-
setUserAgent(
String? userAgent) → Future< void> -
Sets the value used for the HTTP
User-Agent:
request header.override -
setUseWideViewPort(
bool use) → Future< void> - Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport.
-
setVerticalScrollBarEnabled(
bool enabled) → Future< void> -
Whether the vertical scrollbar should be drawn or not.
override
-
supportsSetScrollBarsEnabled(
) → bool -
Returns true if the current platform supports setting whether scrollbars
should be drawn or not.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
enableDebugging(
bool enabled, {AndroidWebViewProxy webViewProxy = const AndroidWebViewProxy()}) → Future< void> - Whether to enable the platform's webview content debugging tools.