updated docs

This commit is contained in:
Lorenzo Pichilli 2023-11-24 17:56:57 +01:00
parent 0b0869ce2a
commit d57af8eb46
197 changed files with 2893 additions and 7656 deletions

View File

@ -66,11 +66,11 @@ abstract class Util {
return """///
${platformNoteList.join("\n///\n")}
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
${platformSupportedList.join("\n")}""";
} else {
return """///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
${platformSupportedList.join("\n")}""";
}
}

View File

@ -26,19 +26,10 @@ class AndroidChromeSafariBrowserCreationParams
}
}
///This class uses native [Chrome Custom Tabs](https://developer.android.com/reference/android/support/customtabs/package-summary) on Android
///and [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) on iOS.
///
///**NOTE**: If you want to use the `ChromeSafariBrowser` class on Android 11+ you need to specify your app querying for
///`android.support.customtabs.action.CustomTabsService` in your `AndroidManifest.xml`
///(you can read more about it here: https://developers.google.com/web/android/custom-tabs/best-practices#applications_targeting_android_11_api_level_30_or_above).
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS
///{@macro flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser}
class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
with ChannelController {
///View ID used internally.
@override
final String id = IdGenerator.generate();
/// Constructs a [AndroidChromeSafariBrowser].
@ -53,6 +44,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
static final AndroidChromeSafariBrowser _staticValue =
AndroidChromeSafariBrowser(AndroidChromeSafariBrowserCreationParams());
/// Provide static access.
factory AndroidChromeSafariBrowser.static() {
return _staticValue;
}
@ -193,25 +185,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
}
}
///Opens the [AndroidChromeSafariBrowser] instance with an [url].
///
///[url] - The [url] to load. On iOS, the [url] is required and must use the `http` or `https` scheme.
///
///[headers] (Supported only on Android) - [whitelisted](https://fetch.spec.whatwg.org/#cors-safelisted-request-header) cross-origin request headers.
///It is possible to attach non-whitelisted headers to cross-origin requests, when the server and client are related using a
///[digital asset link](https://developers.google.com/digital-asset-links/v1/getting-started).
///
///[otherLikelyURLs] - Other likely destinations, sorted in decreasing likelihood order. Supported only on Android.
///
///[referrer] - referrer header. Supported only on Android.
///
///[options] - Deprecated. Use `settings` instead.
///
///[settings] - Settings for the [AndroidChromeSafariBrowser].
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS
@override
Future<void> open(
{WebUri? url,
Map<String, String>? headers,
@ -258,20 +232,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
await _staticChannel.invokeMethod('open', args);
}
///Tells the browser to launch with [url].
///
///[url] - initial url.
///
///[headers] (Supported only on Android) - [whitelisted](https://fetch.spec.whatwg.org/#cors-safelisted-request-header) cross-origin request headers.
///It is possible to attach non-whitelisted headers to cross-origin requests, when the server and client are related using a
///[digital asset link](https://developers.google.com/digital-asset-links/v1/getting-started).
///
///[otherLikelyURLs] - Other likely destinations, sorted in decreasing likelihood order.
///
///[referrer] - referrer header. Supported only on Android.
///
///**Supported Platforms/Implementations**:
///- Android
@override
Future<void> launchUrl({
required WebUri url,
Map<String, String>? headers,
@ -287,18 +248,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
await channel?.invokeMethod("launchUrl", args);
}
///Tells the browser of a likely future navigation to a URL.
///The most likely URL has to be specified first.
///Optionally, a list of other likely URLs can be provided.
///They are treated as less likely than the first one, and have to be sorted in decreasing priority order.
///These additional URLs may be ignored. All previous calls to this method will be deprioritized.
///
///[url] - Most likely URL, may be null if otherLikelyBundles is provided.
///
///[otherLikelyURLs] - Other likely destinations, sorted in decreasing likelihood order.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.mayLaunchUrl](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#mayLaunchUrl(android.net.Uri,android.os.Bundle,java.util.List%3Candroid.os.Bundle%3E)))
@override
Future<bool> mayLaunchUrl(
{WebUri? url, List<WebUri>? otherLikelyURLs}) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -308,22 +258,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
return await channel?.invokeMethod<bool>("mayLaunchUrl", args) ?? false;
}
///Requests to validate a relationship between the application and an origin.
///
///See [here](https://developers.google.com/digital-asset-links/v1/getting-started) for documentation about Digital Asset Links.
///This methods requests the browser to verify a relation with the calling application, to grant the associated rights.
///
///If this method returns `true`, the validation result will be provided through [onRelationshipValidationResult].
///Otherwise the request didn't succeed.
///
///[relation] Relation to check, must be one of the [CustomTabsRelationType] constants.
///
///[origin] Origin.
///
///[extras] Reserved for future use.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.validateRelationship](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#validateRelationship(int,android.net.Uri,android.os.Bundle)))
@override
Future<bool> validateRelationship(
{required CustomTabsRelationType relation,
required WebUri origin}) async {
@ -334,32 +269,18 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
false;
}
///Closes the [AndroidChromeSafariBrowser] instance.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS
@override
Future<void> close() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod("close", args);
}
///Set a custom action button.
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsIntent.Builder.setActionButton](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setActionButton(android.graphics.Bitmap,%20java.lang.String,%20android.app.PendingIntent,%20boolean)))
@override
void setActionButton(ChromeSafariBrowserActionButton actionButton) {
this._actionButton = actionButton;
}
///Updates the [ChromeSafariBrowserActionButton.icon] and [ChromeSafariBrowserActionButton.description].
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.setActionButton](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#setActionButton(android.graphics.Bitmap,java.lang.String)))
@override
Future<void> updateActionButton(
{required Uint8List icon, required String description}) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -370,23 +291,13 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
_actionButton?.description = description;
}
///Sets the remote views displayed in the secondary toolbar in a custom tab.
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsIntent.Builder.setSecondaryToolbarViews](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setSecondaryToolbarViews(android.widget.RemoteViews,int[],android.app.PendingIntent)))
@override
void setSecondaryToolbar(
ChromeSafariBrowserSecondaryToolbar secondaryToolbar) {
this._secondaryToolbar = secondaryToolbar;
}
///Sets or updates (if already present) the Remote Views of the secondary toolbar in an existing custom tab session.
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.setSecondaryToolbarViews](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#setSecondaryToolbarViews(android.widget.RemoteViews,int[],android.app.PendingIntent)))
@override
Future<void> updateSecondaryToolbar(
ChromeSafariBrowserSecondaryToolbar secondaryToolbar) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -395,47 +306,19 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
this._secondaryToolbar = secondaryToolbar;
}
///Adds a [ChromeSafariBrowserMenuItem] to the menu.
///
///**NOTE**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS
@override
void addMenuItem(ChromeSafariBrowserMenuItem menuItem) {
this._menuItems[menuItem.id] = menuItem;
}
///Adds a list of [ChromeSafariBrowserMenuItem] to the menu.
///
///**NOTE**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS
@override
void addMenuItems(List<ChromeSafariBrowserMenuItem> menuItems) {
menuItems.forEach((menuItem) {
this._menuItems[menuItem.id] = menuItem;
});
}
///Sends a request to create a two way postMessage channel between the client
///and the browser.
///If you want to specifying the target origin to communicate with, set the [targetOrigin].
///
///[sourceOrigin] - A origin that the client is requesting to be
///identified as during the postMessage communication.
///It has to either start with http or https.
///
///[targetOrigin] - The target Origin to establish the postMessage communication with.
///This can be the app's package name, it has to either start with http or https.
///
///Returns whether the implementation accepted the request.
///Note that returning true here doesn't mean an origin has already been
///assigned as the validation is asynchronous.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.requestPostMessageChannel](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#requestPostMessageChannel(android.net.Uri,android.net.Uri,android.os.Bundle)))
@override
Future<bool> requestPostMessageChannel(
{required WebUri sourceOrigin, WebUri? targetOrigin}) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -446,16 +329,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
false;
}
///Sends a postMessage request using the origin communicated via [requestPostMessageChannel].
///Fails when called before [onMessageChannelReady] event.
///
///[message] The message that is being sent.
///
///Returns an integer constant about the postMessage request result.
///Will return CustomTabsService.RESULT_SUCCESS if successful.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.postMessage](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#postMessage(java.lang.String,android.os.Bundle)))
@override
Future<CustomTabsPostMessageResultType> postMessage(String message) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("message", () => message);
@ -464,15 +338,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
CustomTabsPostMessageResultType.FAILURE_MESSAGING_ERROR;
}
///Returns whether the Engagement Signals API is available.
///The availability of the Engagement Signals API may change at runtime.
///If an EngagementSignalsCallback has been set, an [onSessionEnded]
///signal will be sent if the API becomes unavailable later.
///
///Returns whether the Engagement Signals API is available.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.isEngagementSignalsApiAvailable](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#isEngagementSignalsApiAvailable(android.os.Bundle)))
@override
Future<bool> isEngagementSignalsApiAvailable() async {
Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<bool>(
@ -480,45 +346,21 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
false;
}
///On Android, returns `true` if Chrome Custom Tabs is available.
///On iOS, returns `true` if SFSafariViewController is available.
///Otherwise returns `false`.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS
@override
Future<bool> isAvailable() async {
Map<String, dynamic> args = <String, dynamic>{};
return await _staticChannel.invokeMethod<bool>("isAvailable", args) ??
false;
}
///The maximum number of allowed secondary toolbar items.
///
///**Supported Platforms/Implementations**:
///- Android
@override
Future<int> getMaxToolbarItems() async {
Map<String, dynamic> args = <String, dynamic>{};
return await _staticChannel.invokeMethod<int>("getMaxToolbarItems", args) ??
0;
}
///Returns the preferred package to use for Custom Tabs.
///The preferred package name is the default VIEW intent handler as long as it supports Custom Tabs.
///To modify this preferred behavior, set [ignoreDefault] to `true` and give a
///non empty list of package names in packages.
///This method queries the `PackageManager` to determine which packages support the Custom Tabs API.
///On apps that target Android 11 and above, this requires adding the following
///package visibility elements to your manifest.
///
///[packages] Ordered list of packages to test for Custom Tabs support, in decreasing order of priority.
///
///[ignoreDefault] If set, the default VIEW handler won't get priority over other browsers.
///
///Returns the preferred package name for handling Custom Tabs, or null.
///
///**Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsClient.getPackageName](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsClient#getPackageName(android.content.Context,java.util.List%3Cjava.lang.String%3E,boolean))))
@override
Future<String?> getPackageName(
{List<String>? packages, bool ignoreDefault = false}) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -527,38 +369,13 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
return await _staticChannel.invokeMethod<String?>("getPackageName", args);
}
///Clear associated website data accrued from browsing activity within your app.
///This includes all local storage, cached resources, and cookies.
///
///**NOTE for iOS**: available on iOS 16.0+.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewController.DataStore.clearWebsiteData](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/datastore/3981117-clearwebsitedata))
@override
Future<void> clearWebsiteData() async {
Map<String, dynamic> args = <String, dynamic>{};
await _staticChannel.invokeMethod("clearWebsiteData", args);
}
///Prewarms a connection to each URL. SFSafariViewController will automatically use a
///prewarmed connection if possible when loading its initial URL.
///
///Returns a token object that corresponds to the requested URLs. You must keep a strong
///reference to this token as long as you expect the prewarmed connections to remain open. If the same
///server is requested in multiple calls to this method, all of the corresponding tokens must be
///invalidated or released to end the prewarmed connection to that server.
///
///This method uses a best-effort approach to prewarming connections, but may delay
///or drop requests based on the volume of requests made by your app. Use this method when you expect
///to present the browser soon. Many HTTP servers time out connections after a few minutes.
///After a timeout, prewarming delivers less performance benefit.
///
///[URLs] - the URLs of servers that the browser should prewarm connections to.
///Only supports URLs with `http://` or `https://` schemes.
///
///**NOTE for iOS**: available on iOS 15.0+.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewController.prewarmConnections](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/3752133-prewarmconnections))
@override
Future<PrewarmingToken?> prewarmConnections(List<WebUri> URLs) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('URLs', () => URLs.map((e) => e.toString()).toList());
@ -568,12 +385,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
return PrewarmingToken.fromMap(result);
}
///Ends all prewarmed connections associated with the token, except for connections that are also kept alive by other tokens.
///
///**NOTE for iOS**: available on iOS 15.0+.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewController.prewarmConnections](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/3752133-prewarmconnections))
@override
Future<void> invalidatePrewarmingToken(
PrewarmingToken prewarmingToken) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -581,16 +393,11 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser
await _staticChannel.invokeMethod("invalidatePrewarmingToken", args);
}
///Returns `true` if the [AndroidChromeSafariBrowser] instance is opened, otherwise `false`.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS
@override
bool isOpened() {
return _isOpened;
}
///Disposes the channel.
@override
@mustCallSuper
void dispose() {

View File

@ -30,19 +30,7 @@ class AndroidCookieManagerCreationParams
}
}
///Class that implements a singleton object (shared instance) which manages the cookies used by WebView instances.
///On Android, it is implemented using [CookieManager](https://developer.android.com/reference/android/webkit/CookieManager).
///On iOS, it is implemented using [WKHTTPCookieStore](https://developer.apple.com/documentation/webkit/wkhttpcookiestore).
///
///**NOTE for iOS below 11.0 and Web platform (LIMITED SUPPORT!)**: in this case, almost all of the methods ([AndroidCookieManager.deleteAllCookies] and [AndroidCookieManager.getAllCookies] are not supported!)
///has been implemented using JavaScript because there is no other way to work with them on iOS below 11.0.
///See https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies for JavaScript restrictions.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///- Web
///{@macro flutter_inappwebview_platform_interface.PlatformCookieManager}
class AndroidCookieManager extends PlatformCookieManager
with ChannelController {
/// Creates a new [AndroidCookieManager].
@ -74,29 +62,6 @@ class AndroidCookieManager extends PlatformCookieManager
Future<dynamic> _handleMethod(MethodCall call) async {}
///Sets a cookie for the given [url]. Any existing cookie with the same [host], [path] and [name] will be replaced with the new cookie.
///The cookie being set will be ignored if it is expired.
///
///The default value of [path] is `"/"`.
///
///[webViewController] could be used if you need to set a session-only cookie using JavaScript (so [isHttpOnly] cannot be set, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
///on the current URL of the [WebView] managed by that controller when you need to target iOS below 11, MacOS below 10.13 and Web platform. In this case the [url] parameter is ignored.
///
///The return value indicates whether the cookie was set successfully.
///Note that it will return always `true` for Web platform, iOS below 11.0 and MacOS below 10.13.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to set the cookie (session-only cookie won't work! In that case, you should set also [expiresDate] or [maxAge]).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to set the cookie (session-only cookie won't work! In that case, you should set also [expiresDate] or [maxAge]).
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - CookieManager.setCookie](https://developer.android.com/reference/android/webkit/CookieManager#setCookie(java.lang.String,%20java.lang.String,%20android.webkit.ValueCallback%3Cjava.lang.Boolean%3E)))
///- iOS ([Official API - WKHTTPCookieStore.setCookie](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882007-setcookie))
///- MacOS ([Official API - WKHTTPCookieStore.setCookie](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882007-setcookie))
///- Web
@override
Future<bool> setCookie(
{required WebUri url,
@ -200,25 +165,6 @@ class AndroidCookieManager extends PlatformCookieManager
await headlessWebView.dispose();
}
///Gets all the cookies for the given [url].
///
///[webViewController] is used for getting the cookies (also session-only cookies) using JavaScript (cookies with `isHttpOnly` enabled cannot be found, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
///from the current context of the [WebView] managed by that controller when you need to target iOS below 11, MacOS below 10.13 and Web platform. JavaScript must be enabled in order to work.
///In this case the [url] parameter is ignored.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: All the cookies returned this way will have all the properties to `null` except for [Cookie.name] and [Cookie.value].
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to get the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be found!).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to get the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be found!).
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - CookieManager.getCookie](https://developer.android.com/reference/android/webkit/CookieManager#getCookie(java.lang.String)))
///- iOS ([Official API - WKHTTPCookieStore.getAllCookies](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882005-getallcookies))
///- MacOS ([Official API - WKHTTPCookieStore.getAllCookies](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882005-getallcookies))
///- Web
@override
Future<List<Cookie>> getCookies(
{required WebUri url,
@ -316,25 +262,6 @@ class AndroidCookieManager extends PlatformCookieManager
return cookies;
}
///Gets a cookie by its [name] for the given [url].
///
///[webViewController] is used for getting the cookie (also session-only cookie) using JavaScript (cookie with `isHttpOnly` enabled cannot be found, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
///from the current context of the [WebView] managed by that controller when you need to target iOS below 11, MacOS below 10.13 and Web platform. JavaScript must be enabled in order to work.
///In this case the [url] parameter is ignored.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: All the cookies returned this way will have all the properties to `null` except for [Cookie.name] and [Cookie.value].
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to get the cookie (session-only cookie and cookie with `isHttpOnly` enabled won't be found!).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to get the cookie (session-only cookie and cookie with `isHttpOnly` enabled won't be found!).
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///- Web
@override
Future<Cookie?> getCookie(
{required WebUri url,
@ -378,26 +305,6 @@ class AndroidCookieManager extends PlatformCookieManager
return null;
}
///Removes a cookie by its [name] for the given [url], [domain] and [path].
///
///The default value of [path] is `"/"`.
///
///[webViewController] is used for deleting the cookie (also session-only cookie) using JavaScript (cookie with `isHttpOnly` enabled cannot be deleted, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
///from the current context of the [WebView] managed by that controller when you need to target iOS below 11, MacOS below 10.13 and Web platform. JavaScript must be enabled in order to work.
///In this case the [url] parameter is ignored.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to delete the cookie (session-only cookie and cookie with `isHttpOnly` enabled won't be deleted!).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to delete the cookie (session-only cookie and cookie with `isHttpOnly` enabled won't be deleted!).
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - WKHTTPCookieStore.delete](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882009-delete)
///- MacOS ([Official API - WKHTTPCookieStore.delete](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882009-delete)
///- Web
@override
Future<void> deleteCookie(
{required WebUri url,
@ -432,26 +339,6 @@ class AndroidCookieManager extends PlatformCookieManager
await channel?.invokeMethod('deleteCookie', args);
}
///Removes all cookies for the given [url], [domain] and [path].
///
///The default value of [path] is `"/"`.
///
///[webViewController] is used for deleting the cookies (also session-only cookies) using JavaScript (cookies with `isHttpOnly` enabled cannot be deleted, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
///from the current context of the [WebView] managed by that controller when you need to target iOS below 11, MacOS below 10.13 and Web platform. JavaScript must be enabled in order to work.
///In this case the [url] parameter is ignored.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to delete the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be deleted!).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [AndroidHeadlessInAppWebView]
///to delete the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be deleted!).
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///- Web
@override
Future<void> deleteCookies(
{required WebUri url,
@ -487,31 +374,12 @@ class AndroidCookieManager extends PlatformCookieManager
await channel?.invokeMethod('deleteCookies', args);
}
///Removes all cookies.
///
///**NOTE for iOS**: available from iOS 11.0+.
///
///**NOTE for MacOS**: available from iOS 10.13+.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - CookieManager.removeAllCookies](https://developer.android.com/reference/android/webkit/CookieManager#removeAllCookies(android.webkit.ValueCallback%3Cjava.lang.Boolean%3E)))
///- iOS ([Official API - WKWebsiteDataStore.removeData](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532938-removedata))
///- MacOS ([Official API - WKWebsiteDataStore.removeData](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532938-removedata))
@override
Future<void> deleteAllCookies() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('deleteAllCookies', args);
}
///Fetches all stored cookies.
///
///**NOTE for iOS**: available on iOS 11.0+.
///
///**NOTE for MacOS**: available from iOS 10.13+.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - WKHTTPCookieStore.getAllCookies](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882005-getallcookies))
///- MacOS ([Official API - WKHTTPCookieStore.getAllCookies](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882005-getallcookies))
@override
Future<List<Cookie>> getAllCookies() async {
List<Cookie> cookies = [];

View File

@ -24,10 +24,7 @@ class AndroidFindInteractionControllerCreationParams
}
}
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController}
class AndroidFindInteractionController extends PlatformFindInteractionController
with ChannelController {
/// Constructs a [AndroidFindInteractionController].
@ -68,138 +65,64 @@ class AndroidFindInteractionController extends PlatformFindInteractionController
return null;
}
///Finds all instances of find on the page and highlights them. Notifies [AndroidFindInteractionController.onFindResultReceived] listener.
///
///[find] represents the string to find.
///
///**NOTE**: on Android native WebView, it finds all instances asynchronously. Successive calls to this will cancel any pending searches.
///
///**NOTE**: on iOS, if [InAppWebViewSettings.isFindInteractionEnabled] is `true`,
///it uses the built-in find interaction native UI,
///otherwise this is implemented using CSS and Javascript.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.findAllAsync](https://developer.android.com/reference/android/webkit/WebView#findAllAsync(java.lang.String)))
///- iOS (if [InAppWebViewSettings.isFindInteractionEnabled] is `true`: [Official API - UIFindInteraction.presentFindNavigator](https://developer.apple.com/documentation/uikit/uifindinteraction/3975832-presentfindnavigator?changes=_2) with [Official API - UIFindInteraction.searchText](https://developer.apple.com/documentation/uikit/uifindinteraction/3975834-searchtext?changes=_2))
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.findAll}
Future<void> findAll({String? find}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('find', () => find);
await channel?.invokeMethod('findAll', args);
}
///Highlights and scrolls to the next match found by [findAll]. Notifies [AndroidFindInteractionController.onFindResultReceived] listener.
///
///[forward] represents the direction to search. The default value is `true`, meaning forward.
///
///**NOTE**: on iOS, if [InAppWebViewSettings.isFindInteractionEnabled] is `true`,
///it uses the built-in find interaction native UI,
///otherwise this is implemented using CSS and Javascript.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.findNext](https://developer.android.com/reference/android/webkit/WebView#findNext(boolean)))
///- iOS (if [InAppWebViewSettings.isFindInteractionEnabled] is `true`: [Official API - UIFindInteraction.findNext](https://developer.apple.com/documentation/uikit/uifindinteraction/3975829-findnext?changes=_2) and ([Official API - UIFindInteraction.findPrevious](https://developer.apple.com/documentation/uikit/uifindinteraction/3975830-findprevious?changes=_2)))
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.findNext}
Future<void> findNext({bool forward = true}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('forward', () => forward);
await channel?.invokeMethod('findNext', args);
}
///Clears the highlighting surrounding text matches created by [findAll].
///
///**NOTE**: on iOS, if [InAppWebViewSettings.isFindInteractionEnabled] is `true`,
///it uses the built-in find interaction native UI,
///otherwise this is implemented using CSS and Javascript.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.clearMatches](https://developer.android.com/reference/android/webkit/WebView#clearMatches()))
///- iOS (if [InAppWebViewSettings.isFindInteractionEnabled] is `true`: [Official API - UIFindInteraction.dismissFindNavigator](https://developer.apple.com/documentation/uikit/uifindinteraction/3975827-dismissfindnavigator?changes=_2))
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.clearMatches}
Future<void> clearMatches() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('clearMatches', args);
}
///Pre-populate the search text to be used.
///
///On iOS, if [InAppWebViewSettings.isFindInteractionEnabled] is `true,
///it will pre-populate the system find panel's search text field with a search query.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - UIFindInteraction.searchText](https://developer.apple.com/documentation/uikit/uifindinteraction/3975834-searchtext?changes=_2))
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.setSearchText}
Future<void> setSearchText(String? searchText) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('searchText', () => searchText);
await channel?.invokeMethod('setSearchText', args);
}
///Get the search text used.
///
///On iOS, if [InAppWebViewSettings.isFindInteractionEnabled] is `true,
///it will get the system find panel's search text field value.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - UIFindInteraction.searchText](https://developer.apple.com/documentation/uikit/uifindinteraction/3975834-searchtext?changes=_2))
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.getSearchText}
Future<String?> getSearchText() async {
Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<String?>('getSearchText', args);
}
///A Boolean value that indicates when the find panel displays onscreen.
///
///**NOTE**: available only on iOS and only if [InAppWebViewSettings.isFindInteractionEnabled] is `true`.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - UIFindInteraction.isFindNavigatorVisible](https://developer.apple.com/documentation/uikit/uifindinteraction/3975828-isfindnavigatorvisible?changes=_2))
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.isFindNavigatorVisible}
Future<bool?> isFindNavigatorVisible() async {
Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<bool?>('isFindNavigatorVisible', args);
}
///Updates the results the interface displays for the active search.
///
///**NOTE**: available only on iOS and only if [InAppWebViewSettings.isFindInteractionEnabled] is `true`.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - UIFindInteraction.updateResultCount](https://developer.apple.com/documentation/uikit/uifindinteraction/3975835-updateresultcount?changes=_2))
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.updateResultCount}
Future<void> updateResultCount() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('updateResultCount', args);
}
///Begins a search, displaying the find panel.
///
///**NOTE**: available only on iOS and only if [InAppWebViewSettings.isFindInteractionEnabled] is `true`.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - UIFindInteraction.presentFindNavigator](https://developer.apple.com/documentation/uikit/uifindinteraction/3975832-presentfindnavigator?changes=_2))
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.presentFindNavigator}
Future<void> presentFindNavigator() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('presentFindNavigator', args);
}
///Dismisses the find panel, if present.
///
///**NOTE**: available only on iOS and only if [InAppWebViewSettings.isFindInteractionEnabled] is `true`.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - UIFindInteraction.dismissFindNavigator](https://developer.apple.com/documentation/uikit/uifindinteraction/3975827-dismissfindnavigator?changes=_2))
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.dismissFindNavigator}
Future<void> dismissFindNavigator() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('dismissFindNavigator', args);
}
///If there's a currently active find session, returns the active find session.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - UIFindInteraction.activeFindSession](https://developer.apple.com/documentation/uikit/uifindinteraction/3975825-activefindsession?changes=_7____4_8&language=objc))
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.getActiveFindSession}
Future<FindSession?> getActiveFindSession() async {
Map<String, dynamic> args = <String, dynamic>{};
Map<String, dynamic>? result =
@ -208,7 +131,7 @@ class AndroidFindInteractionController extends PlatformFindInteractionController
return FindSession.fromMap(result);
}
///Disposes the controller.
///{@macro flutter_inappwebview_platform_interface.PlatformFindInteractionController.dispose}
@override
void dispose({bool isKeepAlive = false}) {
disposeChannel(removeMethodCallHandler: !isKeepAlive);

View File

@ -25,16 +25,7 @@ class AndroidHttpAuthCredentialDatabaseCreationParams
}
}
///Class that implements a singleton object (shared instance) which manages the shared HTTP auth credentials cache.
///On iOS and MacOS, this class uses the [URLCredentialStorage](https://developer.apple.com/documentation/foundation/urlcredentialstorage) class.
///On Android, this class has a custom implementation using `android.database.sqlite.SQLiteDatabase` because
///[WebViewDatabase](https://developer.android.com/reference/android/webkit/WebViewDatabase)
///doesn't offer the same functionalities as iOS `URLCredentialStorage`.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformHttpAuthCredentialDatabase}
class AndroidHttpAuthCredentialDatabase
extends PlatformHttpAuthCredentialDatabase with ChannelController {
/// Creates a new [AndroidHttpAuthCredentialDatabase].
@ -68,14 +59,7 @@ class AndroidHttpAuthCredentialDatabase
Future<dynamic> _handleMethod(MethodCall call) async {}
///Gets a map list of all HTTP auth credentials saved.
///Each map contains the key `protectionSpace` of type [URLProtectionSpace]
///and the key `credentials` of type List<[URLCredential]> that contains all the HTTP auth credentials saved for that `protectionSpace`.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - URLCredentialStorage.allCredentials](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1413859-allcredentials))
///- MacOS ([Official API - URLCredentialStorage.allCredentials](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1413859-allcredentials))
@override
Future<List<URLProtectionSpaceHttpAuthCredentials>>
getAllAuthCredentials() async {
Map<String, dynamic> args = <String, dynamic>{};
@ -94,12 +78,7 @@ class AndroidHttpAuthCredentialDatabase
return result;
}
///Gets all the HTTP auth credentials saved for that [protectionSpace].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<List<URLCredential>> getHttpAuthCredentials(
{required URLProtectionSpace protectionSpace}) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -119,12 +98,7 @@ class AndroidHttpAuthCredentialDatabase
return credentials;
}
///Saves an HTTP auth [credential] for that [protectionSpace].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - URLCredentialStorage.set](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set))
///- MacOS ([Official API - URLCredentialStorage.set](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set))
@override
Future<void> setHttpAuthCredential(
{required URLProtectionSpace protectionSpace,
required URLCredential credential}) async {
@ -138,12 +112,7 @@ class AndroidHttpAuthCredentialDatabase
await channel?.invokeMethod('setHttpAuthCredential', args);
}
///Removes an HTTP auth [credential] for that [protectionSpace].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - URLCredentialStorage.remove](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1408664-remove))
///- MacOS ([Official API - URLCredentialStorage.remove](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1408664-remove))
@override
Future<void> removeHttpAuthCredential(
{required URLProtectionSpace protectionSpace,
required URLCredential credential}) async {
@ -157,12 +126,7 @@ class AndroidHttpAuthCredentialDatabase
await channel?.invokeMethod('removeHttpAuthCredential', args);
}
///Removes all the HTTP auth credentials saved for that [protectionSpace].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> removeHttpAuthCredentials(
{required URLProtectionSpace protectionSpace}) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -173,12 +137,7 @@ class AndroidHttpAuthCredentialDatabase
await channel?.invokeMethod('removeHttpAuthCredentials', args);
}
///Removes all the HTTP auth credentials saved in the database.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> clearAllAuthCredentials() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('clearAllAuthCredentials', args);

View File

@ -46,15 +46,9 @@ class AndroidInAppBrowserCreationParams
final AndroidPullToRefreshController? pullToRefreshController;
}
///This class uses the native WebView of the platform.
///The [webViewController] field can be used to access the [InAppWebViewController] API.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformInAppBrowser}
class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
///View ID used internally.
@override
final String id = IdGenerator.generate();
/// Constructs a [AndroidInAppBrowser].
@ -71,6 +65,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
static final AndroidInAppBrowser _staticValue =
AndroidInAppBrowser(AndroidInAppBrowserCreationParams());
/// Provide static access.
factory AndroidInAppBrowser.static() {
return _staticValue;
}
@ -83,14 +78,14 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
ContextMenu? _contextMenu;
@override
ContextMenu? get contextMenu => _contextMenu;
Map<int, InAppBrowserMenuItem> _menuItems = HashMap();
bool _isOpened = false;
AndroidInAppWebViewController? _webViewController;
///WebView Controller that can be used to access the [AndroidInAppWebViewController] API.
///When [onExit] is fired, this will be `null` and cannot be used anymore.
@override
AndroidInAppWebViewController? get webViewController {
return _isOpened ? _webViewController : null;
}
@ -177,18 +172,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
return args;
}
///Opens the [PlatformInAppBrowser] instance with an [urlRequest].
///
///[urlRequest]: The [urlRequest] to load.
///
///[options]: Options for the [PlatformInAppBrowser].
///
///[settings]: Settings for the [PlatformInAppBrowser].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> openUrlRequest(
{required URLRequest urlRequest,
// ignore: deprecated_member_use_from_same_package
@ -202,48 +186,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
await _staticChannel.invokeMethod('open', args);
}
///Opens the [PlatformInAppBrowser] instance with the given [assetFilePath] file.
///
///[options]: Options for the [PlatformInAppBrowser].
///
///To be able to load your local files (assets, js, css, etc.), you need to add them in the `assets` section of the `pubspec.yaml` file, otherwise they cannot be found!
///
///Example of a `pubspec.yaml` file:
///```yaml
///...
///
///# The following section is specific to Flutter.
///flutter:
///
/// # The following line ensures that the Material Icons font is
/// # included with your application, so that you can use the icons in
/// # the material Icons class.
/// uses-material-design: true
///
/// assets:
/// - assets/index.html
/// - assets/css/
/// - assets/images/
///
///...
///```
///Example of a `main.dart` file:
///```dart
///...
///inAppBrowser.openFile(assetFilePath: "assets/index.html");
///...
///```
///
///[headers]: The additional headers to be used in the HTTP request for this URL, specified as a map from name to value.
///
///[options]: Options for the [PlatformInAppBrowser].
///
///[settings]: Settings for the [PlatformInAppBrowser].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> openFile(
{required String assetFilePath,
// ignore: deprecated_member_use_from_same_package
@ -257,22 +200,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
await _staticChannel.invokeMethod('open', args);
}
///Opens the [PlatformInAppBrowser] instance with [data] as a content, using [baseUrl] as the base URL for it.
///
///The [mimeType] parameter specifies the format of the data. The default value is `"text/html"`.
///
///The [encoding] parameter specifies the encoding of the data. The default value is `"utf8"`.
///
///The [androidHistoryUrl] parameter is the URL to use as the history entry. The default value is `about:blank`. If non-null, this must be a valid URL. This parameter is used only on Android.
///
///The [options] parameter specifies the options for the [PlatformInAppBrowser].
///
///[settings]: Settings for the [PlatformInAppBrowser].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> openData(
{required String data,
String mimeType = "text/html",
@ -294,12 +222,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
await _staticChannel.invokeMethod('open', args);
}
///This is a static method that opens an [url] in the system browser. You wont be able to use the [PlatformInAppBrowser] methods here!
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> openWithSystemBrowser({required WebUri url}) async {
assert(url.toString().isNotEmpty);
@ -308,81 +231,41 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
return await _staticChannel.invokeMethod('openWithSystemBrowser', args);
}
///Adds a [InAppBrowserMenuItem] to the menu.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
@override
void addMenuItem(InAppBrowserMenuItem menuItem) {
_menuItems[menuItem.id] = menuItem;
}
///Adds a list of [InAppBrowserMenuItem] to the menu.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
@override
void addMenuItems(List<InAppBrowserMenuItem> menuItems) {
menuItems.forEach((menuItem) {
_menuItems[menuItem.id] = menuItem;
});
}
///Removes the [menuItem] from the list.
///Returns `true` if it was in the list, `false` otherwise.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
@override
bool removeMenuItem(InAppBrowserMenuItem menuItem) {
return _menuItems.remove(menuItem.id) != null;
}
///Removes a list of [menuItems] from the list.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
@override
void removeMenuItems(List<InAppBrowserMenuItem> menuItems) {
for (final menuItem in menuItems) {
removeMenuItem(menuItem);
}
}
///Removes all the menu items from the list.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
@override
void removeAllMenuItem() {
_menuItems.clear();
}
///Returns `true` if the [menuItem] has been already added, otherwise `false`.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS 14.0+
@override
bool hasMenuItem(InAppBrowserMenuItem menuItem) {
return _menuItems.containsKey(menuItem.id);
}
///Displays an [PlatformInAppBrowser] window that was opened hidden. Calling this has no effect if the [PlatformInAppBrowser] was already visible.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> show() async {
assert(_isOpened, 'The browser is not opened.');
@ -390,12 +273,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
await channel?.invokeMethod('show', args);
}
///Hides the [PlatformInAppBrowser] window. Calling this has no effect if the [PlatformInAppBrowser] was already hidden.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> hide() async {
assert(_isOpened, 'The browser is not opened.');
@ -403,12 +281,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
await channel?.invokeMethod('hide', args);
}
///Closes the [PlatformInAppBrowser] window.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> close() async {
assert(_isOpened, 'The browser is not opened.');
@ -416,12 +289,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
await channel?.invokeMethod('close', args);
}
///Check if the Web View of the [PlatformInAppBrowser] instance is hidden.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<bool> isHidden() async {
assert(_isOpened, 'The browser is not opened.');
@ -429,7 +297,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
return await channel?.invokeMethod<bool>('isHidden', args) ?? false;
}
///Use [setSettings] instead.
@override
@Deprecated('Use setSettings instead')
Future<void> setOptions({required InAppBrowserClassOptions options}) async {
assert(_isOpened, 'The browser is not opened.');
@ -439,7 +307,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
await channel?.invokeMethod('setSettings', args);
}
///Use [getSettings] instead.
@override
@Deprecated('Use getSettings instead')
Future<InAppBrowserClassOptions?> getOptions() async {
assert(_isOpened, 'The browser is not opened.');
@ -455,12 +323,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
return null;
}
///Sets the [PlatformInAppBrowser] settings with the new [settings] and evaluates them.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> setSettings(
{required InAppBrowserClassSettings settings}) async {
assert(_isOpened, 'The browser is not opened.');
@ -470,12 +333,7 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
await channel?.invokeMethod('setSettings', args);
}
///Gets the current [PlatformInAppBrowser] settings. Returns `null` if it wasn't able to get them.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<InAppBrowserClassSettings?> getSettings() async {
assert(_isOpened, 'The browser is not opened.');
@ -492,17 +350,11 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController {
return null;
}
///Returns `true` if the [PlatformInAppBrowser] instance is opened, otherwise `false`.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
bool isOpened() {
return this._isOpened;
}
///Disposes the channel and controllers.
@override
@mustCallSuper
void dispose() {

View File

@ -249,21 +249,9 @@ class AndroidHeadlessInAppWebViewCreationParams
final AndroidPullToRefreshController? pullToRefreshController;
}
///{@template flutter_inappwebview.HeadlessInAppWebView}
///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
///{@endtemplate}
///{@macro flutter_inappwebview_platform_interface.PlatformHeadlessInAppWebView}
class AndroidHeadlessInAppWebView extends PlatformHeadlessInAppWebView
with ChannelController {
///View ID.
@override
late final String id;
@ -286,7 +274,6 @@ class AndroidHeadlessInAppWebView extends PlatformHeadlessInAppWebView
id = IdGenerator.generate();
}
///WebView Controller that can be used to access the [InAppWebViewController] API.
@override
AndroidInAppWebViewController? get webViewController => _webViewController;
@ -324,15 +311,6 @@ class AndroidHeadlessInAppWebView extends PlatformHeadlessInAppWebView
return null;
}
///Runs the headless WebView.
///
///**NOTE for Web**: it will append a new `iframe` to the body.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
Future<void> run() async {
if (_started) {
return;
@ -408,32 +386,11 @@ class AndroidHeadlessInAppWebView extends PlatformHeadlessInAppWebView
}
}
///Indicates if the headless WebView is running or not.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
@override
bool isRunning() {
return _running;
}
///Set the size of the WebView in pixels.
///
///Set `-1` to match the corresponding width or height of the current device screen size.
///`Size(-1, -1)` will match both width and height of the current device screen size.
///
///Note that if the [AndroidHeadlessInAppWebView] is not running, this method won't have effect.
///
///**NOTE for Android**: `Size` width and height values will be converted to `int` values because they cannot have `double` values.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
@override
Future<void> setSize(Size size) async {
if (!_running) {
@ -445,15 +402,6 @@ class AndroidHeadlessInAppWebView extends PlatformHeadlessInAppWebView
await channel?.invokeMethod('setSize', args);
}
///Gets the current size in pixels of the WebView.
///
///Note that if the [AndroidHeadlessInAppWebView] is not running, this method will return `null`.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
@override
Future<Size?> getSize() async {
if (!_running) {
@ -466,13 +414,6 @@ class AndroidHeadlessInAppWebView extends PlatformHeadlessInAppWebView
return MapSize.fromMap(sizeMap);
}
///Disposes the headless WebView.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
@override
Future<void> dispose() async {
if (!_running) {

View File

@ -475,7 +475,7 @@ class AndroidInAppWebViewWidget extends PlatformInAppWebViewWidget {
@override
T controllerFromPlatform<T>(PlatformInAppWebViewController controller) {
// TODO: implement controllerFromPlatform
// unused
throw UnimplementedError();
}
}

View File

@ -24,12 +24,7 @@ class AndroidPrintJobControllerCreationParams
}
}
///Class representing a print job eventually returned by [InAppWebViewController.printCurrentPage].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformPrintJobController}
class AndroidPrintJobController extends PlatformPrintJobController
with ChannelController {
/// Constructs a [AndroidPrintJobController].
@ -60,51 +55,26 @@ class AndroidPrintJobController extends PlatformPrintJobController
}
}
///Cancels this print job.
///You can request cancellation of a queued, started, blocked, or failed print job.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - PrintJob.cancel](https://developer.android.com/reference/android/print/PrintJob#cancel()))
@override
Future<void> cancel() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('cancel', args);
}
///Restarts this print job.
///You can request restart of a failed print job.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - PrintJob.restart](https://developer.android.com/reference/android/print/PrintJob#restart()))
@override
Future<void> restart() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('restart', args);
}
///Dismisses the printing-options sheet or popover.
///
///You should dismiss the printing options when they are presented in a sheet or
///animated from a rectangle and the user changes the orientation of the device.
///(This, of course, assumes your application responds to orientation changes.)
///You should then present the printing options again once the new orientation takes effect.
///
///**Supported Platforms/Implementations**:
///- iOS
@override
Future<void> dismiss({bool animated: true}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("animated", () => animated);
await channel?.invokeMethod('dismiss', args);
}
///Gets the [PrintJobInfo] that describes this job.
///
///**NOTE**: The returned info object is a snapshot of the
///current print job state. Every call to this method returns a fresh
///info object that reflects the current print job state.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - PrintJob.getInfo](https://developer.android.com/reference/android/print/PrintJob#getInfo()))
///- iOS
///- MacOS
@override
Future<PrintJobInfo?> getInfo() async {
Map<String, dynamic> args = <String, dynamic>{};
Map<String, dynamic>? infoMap =
@ -112,12 +82,6 @@ class AndroidPrintJobController extends PlatformPrintJobController
return PrintJobInfo.fromMap(infoMap);
}
///Disposes the print job.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@override
Future<void> dispose() async {
Map<String, dynamic> args = <String, dynamic>{};

View File

@ -25,28 +25,7 @@ class AndroidProcessGlobalConfigCreationParams
}
}
///Process Global Configuration for [WebView].
///WebView has some process-global configuration parameters
///that cannot be changed once WebView has been loaded.
///This class allows apps to set these parameters.
///
///If it is used, the configuration should be set and apply should
///be called prior to loading WebView into the calling process.
///Most of the methods in `android.webkit` and `androidx.webkit` packages load WebView,
///so the configuration should be applied before calling any of these methods.
///
///The following code configures the data directory suffix that WebView uses and
///then applies the configuration. WebView uses this configuration when it is loaded.
///
///[apply] can only be called once.
///
///Only a single thread should access this class at a given time.
///
///The configuration should be set up as early as possible during application startup,
///to ensure that it happens before any other thread can call a method that loads [WebView].
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProcessGlobalConfig](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig))
///{@macro flutter_inappwebview_platform_interface.PlatformProcessGlobalConfig}
class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig
with ChannelController {
/// Creates a new [AndroidProcessGlobalConfig].
@ -79,13 +58,7 @@ class AndroidProcessGlobalConfig extends PlatformProcessGlobalConfig
Future<dynamic> _handleMethod(MethodCall call) async {}
///Applies the configuration to be used by [WebView] on loading.
///This method can only be called once.
///
///Calling this method will not cause [WebView] to be loaded and will not block the calling thread.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProcessGlobalConfig.apply](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#apply(androidx.webkit.ProcessGlobalConfig)))
@override
Future<void> apply({required ProcessGlobalConfigSettings settings}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("settings", () => settings.toMap());

View File

@ -25,16 +25,7 @@ class AndroidProxyControllerCreationParams
}
}
///Manages setting and clearing a process-specific override for the Android system-wide proxy settings that govern network requests made by [WebView].
///
///[WebView] may make network requests in order to fetch content that is not otherwise read from the file system or provided directly by application code.
///In this case by default the system-wide Android network proxy settings are used to redirect requests to appropriate proxy servers.
///
///In the rare case that it is necessary for an application to explicitly specify its proxy configuration,
///this API may be used to explicitly specify the proxy rules that govern WebView initiated network requests.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyController](https://developer.android.com/reference/androidx/webkit/ProxyController))
///{@macro flutter_inappwebview_platform_interface.PlatformProxyController}
class AndroidProxyController extends PlatformProxyController
with ChannelController {
/// Creates a new [AndroidProxyController].
@ -66,24 +57,14 @@ class AndroidProxyController extends PlatformProxyController
Future<dynamic> _handleMethod(MethodCall call) async {}
///Sets [ProxySettings] which will be used by all [WebView]s in the app.
///URLs that match patterns in the bypass list will not be directed to any proxy.
///Instead, the request will be made directly to the origin specified by the URL.
///Network connections are not guaranteed to immediately use the new proxy setting; wait for the method to return before loading a page.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyController.setProxyOverride](https://developer.android.com/reference/androidx/webkit/ProxyController#setProxyOverride(androidx.webkit.ProxyConfig,%20java.util.concurrent.Executor,%20java.lang.Runnable)))
@override
Future<void> setProxyOverride({required ProxySettings settings}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("settings", () => settings.toMap());
await channel?.invokeMethod('setProxyOverride', args);
}
///Clears the proxy settings.
///Network connections are not guaranteed to immediately use the new proxy setting; wait for the method to return before loading a page.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyController.clearProxyOverride](https://developer.android.com/reference/androidx/webkit/ProxyController#clearProxyOverride(java.util.concurrent.Executor,%20java.lang.Runnable)))
@override
Future<void> clearProxyOverride() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('clearProxyOverride', args);

View File

@ -26,17 +26,7 @@ class AndroidPullToRefreshControllerCreationParams
}
}
///A standard controller that can initiate the refreshing of a scroll views contents.
///This should be used whenever the user can refresh the contents of a WebView via a vertical swipe gesture.
///
///All the methods should be called only when the WebView has been created or is already running
///(for example [WebView.onWebViewCreated] or [InAppBrowser.onBrowserCreated]).
///
///**NOTE for Android**: to be able to use the "pull-to-refresh" feature, [InAppWebViewSettings.useHybridComposition] must be `true`.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///{@macro flutter_inappwebview_platform_interface.PlatformPullToRefreshController}
class AndroidPullToRefreshController extends PlatformPullToRefreshController
with ChannelController {
/// Constructs a [AndroidPullToRefreshController].
@ -71,11 +61,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
return null;
}
///Sets whether the pull-to-refresh feature is enabled or not.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setEnabled](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setEnabled(boolean)))
///- iOS ([Official API - UIScrollView.refreshControl](https://developer.apple.com/documentation/uikit/uiscrollview/2127691-refreshcontrol))
@override
Future<void> setEnabled(bool enabled) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -83,11 +68,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setEnabled', args);
}
///Returns `true` is pull-to-refresh feature is enabled, otherwise `false`.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - View.isEnabled](https://developer.android.com/reference/android/view/View#isEnabled()))
///- iOS ([Official API - UIScrollView.refreshControl](https://developer.apple.com/documentation/uikit/uiscrollview/2127691-refreshcontrol))
@override
Future<bool> isEnabled() async {
Map<String, dynamic> args = <String, dynamic>{};
@ -100,51 +80,22 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setRefreshing', args);
}
///Tells the controller that a refresh operation was started programmatically.
///
///Call this method when an external event source triggers a programmatic refresh of your scrolling view.
///This method updates the state of the refresh control to reflect the in-progress refresh operation.
///When the refresh operation ends, be sure to call the [endRefreshing] method to return the controller to its default state.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
@override
Future<void> beginRefreshing() async {
return await _setRefreshing(true);
}
///Tells the controller that a refresh operation has ended.
///
///Call this method at the end of any refresh operation (whether it was initiated programmatically or by the user)
///to return the refresh control to its default state.
///If the refresh control is at least partially visible, calling this method also hides it.
///If animations are also enabled, the control is hidden using an animation.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
@override
Future<void> endRefreshing() async {
await _setRefreshing(false);
}
///Returns whether a refresh operation has been triggered and is in progress.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.isRefreshing](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#isRefreshing()))
///- iOS ([Official API - UIRefreshControl.isRefreshing](https://developer.apple.com/documentation/uikit/uirefreshcontrol/1624844-isrefreshing))
@override
Future<bool> isRefreshing() async {
Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<bool>('isRefreshing', args) ?? false;
}
///Sets the color of the refresh control.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setColorSchemeColors](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setColorSchemeColors(int...)))
///- iOS ([Official API - UIRefreshControl.tintColor](https://developer.apple.com/documentation/uikit/uirefreshcontrol/1624847-tintcolor))
@override
Future<void> setColor(Color color) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -152,11 +103,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setColor', args);
}
///Sets the background color of the refresh control.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setProgressBackgroundColorSchemeColor](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setProgressBackgroundColorSchemeColor(int)))
///- iOS ([Official API - UIView.backgroundColor](https://developer.apple.com/documentation/uikit/uiview/1622591-backgroundcolor))
@override
Future<void> setBackgroundColor(Color color) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -164,10 +110,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setBackgroundColor', args);
}
///Set the distance to trigger a sync in dips.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setDistanceToTriggerSync](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setDistanceToTriggerSync(int)))
@override
Future<void> setDistanceToTriggerSync(int distanceToTriggerSync) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -175,10 +117,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setDistanceToTriggerSync', args);
}
///Sets the distance that the refresh indicator can be pulled beyond its resting position during a swipe gesture.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setSlingshotDistance](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setSlingshotDistance(int)))
@override
Future<void> setSlingshotDistance(int slingshotDistance) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -186,10 +124,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setSlingshotDistance', args);
}
///Gets the default distance that the refresh indicator can be pulled beyond its resting position during a swipe gesture.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.DEFAULT_SLINGSHOT_DISTANCE](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#DEFAULT_SLINGSHOT_DISTANCE()))
@override
Future<int> getDefaultSlingshotDistance() async {
Map<String, dynamic> args = <String, dynamic>{};
@ -198,7 +132,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
0;
}
///Use [setIndicatorSize] instead.
@Deprecated("Use setIndicatorSize instead")
@override
Future<void> setSize(AndroidPullToRefreshSize size) async {
@ -207,10 +140,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setSize', args);
}
///Sets the size of the refresh indicator. One of [PullToRefreshSize.DEFAULT], or [PullToRefreshSize.LARGE].
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setSize](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setSize(int)))
@override
Future<void> setIndicatorSize(PullToRefreshSize size) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -218,7 +147,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setSize', args);
}
///Use [setStyledTitle] instead.
@Deprecated("Use setStyledTitle instead")
@override
Future<void> setAttributedTitle(IOSNSAttributedString attributedTitle) async {
@ -227,10 +155,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setStyledTitle', args);
}
///Sets the styled title text to display in the refresh control.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - UIRefreshControl.attributedTitle](https://developer.apple.com/documentation/uikit/uirefreshcontrol/1624845-attributedtitle))
@override
Future<void> setStyledTitle(AttributedString attributedTitle) async {
Map<String, dynamic> args = <String, dynamic>{};
@ -238,7 +162,6 @@ class AndroidPullToRefreshController extends PlatformPullToRefreshController
await channel?.invokeMethod('setStyledTitle', args);
}
///Disposes the controller.
@override
void dispose({bool isKeepAlive = false}) {
disposeChannel(removeMethodCallHandler: !isKeepAlive);

View File

@ -25,12 +25,7 @@ class AndroidServiceWorkerControllerCreationParams
}
}
///Class that manages Service Workers used by [WebView].
///
///**NOTE**: available on Android 24+.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ServiceWorkerControllerCompat](https://developer.android.com/reference/androidx/webkit/ServiceWorkerControllerCompat))
///{@macro flutter_inappwebview_platform_interface.PlatformServiceWorkerController}
class AndroidServiceWorkerController extends PlatformServiceWorkerController
with ChannelController {
/// Creates a new [AndroidServiceWorkerController].
@ -68,13 +63,10 @@ class AndroidServiceWorkerController extends PlatformServiceWorkerController
ServiceWorkerClient? _serviceWorkerClient;
@override
ServiceWorkerClient? get serviceWorkerClient => _serviceWorkerClient;
///Sets the client to capture service worker related callbacks.
///A [ServiceWorkerClient] should be set before any service workers are active, e.g. a safe place is before any WebView instances are created or pages loaded.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ServiceWorkerControllerCompat.setServiceWorkerClient](https://developer.android.com/reference/androidx/webkit/ServiceWorkerControllerCompat#setServiceWorkerClient(androidx.webkit.ServiceWorkerClientCompat)))
@override
Future<void> setServiceWorkerClient(ServiceWorkerClient? value) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('isNull', () => value == null);
@ -106,96 +98,56 @@ class AndroidServiceWorkerController extends PlatformServiceWorkerController
return null;
}
///Gets whether Service Workers support content URL access.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_CONTENT_ACCESS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getAllowContentAccess()
@override
Future<bool> getAllowContentAccess() async {
Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<bool>('getAllowContentAccess', args) ??
false;
}
///Gets whether Service Workers support file access.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_FILE_ACCESS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getAllowFileAccess()
@override
Future<bool> getAllowFileAccess() async {
Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<bool>('getAllowFileAccess', args) ??
false;
}
///Gets whether Service Workers are prohibited from loading any resources from the network.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getBlockNetworkLoads()
@override
Future<bool> getBlockNetworkLoads() async {
Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<bool>('getBlockNetworkLoads', args) ??
false;
}
///Gets the current setting for overriding the cache mode.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_CACHE_MODE].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getCacheMode()
@override
Future<CacheMode?> getCacheMode() async {
Map<String, dynamic> args = <String, dynamic>{};
return CacheMode.fromNativeValue(
await channel?.invokeMethod<int?>('getCacheMode', args));
}
///Enables or disables content URL access from Service Workers.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_CONTENT_ACCESS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setAllowContentAccess(boolean)
@override
Future<void> setAllowContentAccess(bool allow) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("allow", () => allow);
await channel?.invokeMethod('setAllowContentAccess', args);
}
///Enables or disables file access within Service Workers.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_FILE_ACCESS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setAllowFileAccess(boolean)
@override
Future<void> setAllowFileAccess(bool allow) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("allow", () => allow);
await channel?.invokeMethod('setAllowFileAccess', args);
}
///Sets whether Service Workers should not load resources from the network.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setBlockNetworkLoads(boolean)
@override
Future<void> setBlockNetworkLoads(bool flag) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("flag", () => flag);
await channel?.invokeMethod('setBlockNetworkLoads', args);
}
///Overrides the way the cache is used.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_CACHE_MODE].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setCacheMode(int)
@override
Future<void> setCacheMode(CacheMode mode) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("mode", () => mode.toNativeValue());

View File

@ -25,15 +25,7 @@ class AndroidTracingControllerCreationParams
}
}
///Manages tracing of [WebView]s.
///In particular provides functionality for the app to enable/disable tracing of parts of code and to collect tracing data.
///This is useful for profiling performance issues, debugging and memory usage analysis in production and real life scenarios.
///
///The resulting trace data is sent back as a byte sequence in json format.
///This file can be loaded in "chrome://tracing" for further analysis.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController](https://developer.android.com/reference/androidx/webkit/TracingController))
///{@macro flutter_inappwebview_platform_interface.PlatformTracingController}
class AndroidTracingController extends PlatformTracingController
with ChannelController {
/// Creates a new [AndroidTracingController].
@ -65,39 +57,21 @@ class AndroidTracingController extends PlatformTracingController
Future<dynamic> _handleMethod(MethodCall call) async {}
///Starts tracing all [WebView]s.
///Depending on the trace mode in trace config specifies how the trace events are recorded.
///For tracing modes [TracingMode.RECORD_UNTIL_FULL] and [TracingMode.RECORD_CONTINUOUSLY]
///the events are recorded using an internal buffer and flushed to the outputStream
///when [stop] is called.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController.start](https://developer.android.com/reference/android/webkit/TracingController#start(android.webkit.TracingConfig)))
@override
Future<void> start({required TracingSettings settings}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("settings", () => settings.toMap());
await channel?.invokeMethod('start', args);
}
///Stops tracing and flushes tracing data to the specified output stream.
///The data is sent to the specified output stream in json format typically in
///chunks.
///
///Returns `false` if the WebView framework was not tracing at the time of the call,
///`true` otherwise.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController.stop](https://developer.android.com/reference/android/webkit/TracingController#stop(java.io.OutputStream,%20java.util.concurrent.Executor)))
@override
Future<bool> stop({String? filePath}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("filePath", () => filePath);
return await channel?.invokeMethod<bool>('stop', args) ?? false;
}
///Returns whether the WebView framework is tracing.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController.isTracing](https://developer.android.com/reference/android/webkit/TracingController#isTracing()))
@override
Future<bool> isTracing() async {
Map<String, dynamic> args = <String, dynamic>{};
return await channel?.invokeMethod<bool>('isTracing', args) ?? false;

View File

@ -30,12 +30,7 @@ class AndroidWebMessageChannelCreationParams
}
}
///The representation of the [HTML5 message channels](https://html.spec.whatwg.org/multipage/web-messaging.html#message-channels).
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformWebMessageChannel}
class AndroidWebMessageChannel extends PlatformWebMessageChannel
with ChannelController {
/// Constructs a [AndroidWebMessageChannel].
@ -60,6 +55,7 @@ class AndroidWebMessageChannel extends PlatformWebMessageChannel
port2: AndroidWebMessagePort(
AndroidWebMessagePortCreationParams(index: 1))));
/// Provide static access.
factory AndroidWebMessageChannel.static() {
return _staticValue;
}
@ -108,7 +104,6 @@ class AndroidWebMessageChannel extends PlatformWebMessageChannel
return _fromMap(map);
}
///Disposes the web message channel.
@override
void dispose() {
disposeChannel();

View File

@ -36,12 +36,7 @@ class AndroidWebMessageListenerCreationParams
}
}
///This listener receives messages sent on the JavaScript object which was injected by [InAppWebViewController.addWebMessageListener].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformWebMessageListener}
class AndroidWebMessageListener extends PlatformWebMessageListener
with ChannelController {
/// Constructs a [AndroidWebMessageListener].
@ -99,6 +94,7 @@ class AndroidWebMessageListener extends PlatformWebMessageListener
disposeChannel();
}
@override
Map<String, dynamic> toMap() {
return {
"id": _id,
@ -107,6 +103,7 @@ class AndroidWebMessageListener extends PlatformWebMessageListener
};
}
@override
Map<String, dynamic> toJson() {
return this.toMap();
}
@ -139,11 +136,7 @@ class AndroidJavaScriptReplyProxyCreationParams
}
}
///This class represents the JavaScript object injected by [InAppWebViewController.addWebMessageListener].
///An instance will be given by [AndroidWebMessageListener.onPostMessage].
///The app can use `postMessage(String)` to talk to the JavaScript context.
///
///There is a 1:1 relationship between this object and the JavaScript object in a frame.
///{@macro flutter_inappwebview_platform_interface.JavaScriptReplyProxy}
class AndroidJavaScriptReplyProxy extends PlatformJavaScriptReplyProxy {
/// Constructs a [AndroidWebMessageListener].
AndroidJavaScriptReplyProxy(PlatformJavaScriptReplyProxyCreationParams params)
@ -157,11 +150,7 @@ class AndroidJavaScriptReplyProxy extends PlatformJavaScriptReplyProxy {
AndroidWebMessageListener get _androidWebMessageListener =>
params.webMessageListener as AndroidWebMessageListener;
///Post a [message] to the injected JavaScript object which sent this [AndroidJavaScriptReplyProxy].
///
///If [message] is of type [WebMessageType.ARRAY_BUFFER], be aware that large byte buffers can lead to out-of-memory crashes on low-end devices.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/JavaScriptReplyProxy#postMessage(java.lang.String)
@override
Future<void> postMessage(WebMessage message) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('message', () => message.toMap());

View File

@ -28,24 +28,7 @@ class AndroidWebMessagePortCreationParams
}
}
///The representation of the [HTML5 message ports](https://html.spec.whatwg.org/multipage/comms.html#messageport).
///
///A Message port represents one endpoint of a Message Channel. In Android webview, there is no separate Message Channel object.
///When a message channel is created, both ports are tangled to each other and started.
///See [InAppWebViewController.createWebMessageChannel] for creating a message channel.
///
///When a message port is first created or received via transfer, it does not have a [WebMessageCallback] to receive web messages.
///On Android, the messages are queued until a [WebMessageCallback] is set.
///
///A message port should be closed when it is not used by the embedder application anymore.
///A closed port cannot be transferred or cannot be reopened to send messages.
///Close can be called multiple times.
///
///When a port is transferred to JavaScript, it cannot be used to send or receive messages at the Dart side anymore.
///Different from HTML5 Spec, a port cannot be transferred if one of these has ever happened: i. a message callback was set, ii. a message was posted on it.
///A transferred port cannot be closed by the application, since the ownership is also transferred.
///
///It is possible to transfer both ports of a channel to JavaScript, for example for communication between subframes.
///{@macro flutter_inappwebview_platform_interface.PlatformWebMessagePort}
class AndroidWebMessagePort extends PlatformWebMessagePort {
WebMessageCallback? _onMessage;
late AndroidWebMessageChannel _webMessageChannel;
@ -59,7 +42,7 @@ class AndroidWebMessagePort extends PlatformWebMessagePort {
.fromPlatformWebMessagePortCreationParams(params),
);
///Sets a callback to receive message events on the main thread.
@override
Future<void> setWebMessageCallback(WebMessageCallback? onMessage) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('index', () => params.index);
@ -68,7 +51,7 @@ class AndroidWebMessagePort extends PlatformWebMessagePort {
this._onMessage = onMessage;
}
///Post a WebMessage to the entangled port.
@override
Future<void> postMessage(WebMessage message) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('index', () => params.index);
@ -76,13 +59,14 @@ class AndroidWebMessagePort extends PlatformWebMessagePort {
await _webMessageChannel.internalChannel?.invokeMethod('postMessage', args);
}
///Close the message port and free any resources associated with it.
@override
Future<void> close() async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('index', () => params.index);
await _webMessageChannel.internalChannel?.invokeMethod('close', args);
}
@override
Map<String, dynamic> toMap() {
return {
"index": params.index,
@ -90,6 +74,7 @@ class AndroidWebMessagePort extends PlatformWebMessagePort {
};
}
@override
Map<String, dynamic> toJson() {
return toMap();
}

View File

@ -25,14 +25,7 @@ class AndroidWebStorageCreationParams extends PlatformWebStorageCreationParams {
}
}
///Class that provides access to the JavaScript [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API): `window.sessionStorage` and `window.localStorage`.
///It used by [InAppWebViewController.webStorage].
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///- Web
///{@macro flutter_inappwebview_platform_interface.PlatformWebStorage}
class AndroidWebStorage extends PlatformWebStorage {
/// Constructs a [AndroidWebStorage].
AndroidWebStorage(PlatformWebStorageCreationParams params)
@ -43,11 +36,12 @@ class AndroidWebStorage extends PlatformWebStorage {
.fromPlatformWebStorageCreationParams(params),
);
@override
PlatformLocalStorage get localStorage => params.localStorage;
@override
PlatformSessionStorage get sessionStorage => params.sessionStorage;
///Disposes the web storage.
@override
void dispose() {
localStorage.dispose();
@ -73,8 +67,7 @@ class AndroidStorageCreationParams extends PlatformStorageCreationParams {
}
}
///Class that provides methods to manage the JavaScript [Storage](https://developer.mozilla.org/en-US/docs/Web/API/Storage) object.
///It is used by [AndroidLocalStorage] and [AndroidSessionStorage].
///{@macro flutter_inappwebview_platform_interface.PlatformStorage}
class AndroidStorage extends PlatformStorage {
/// Constructs a [AndroidStorage].
AndroidStorage(PlatformStorageCreationParams params)
@ -87,14 +80,7 @@ class AndroidStorage extends PlatformStorage {
AndroidInAppWebViewController? _controller;
///Returns an integer representing the number of data items stored in the Storage object.
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@override
Future<int?> length() async {
var result = await _controller?.evaluateJavascript(source: """
window.$webStorageType.length;
@ -102,14 +88,7 @@ class AndroidStorage extends PlatformStorage {
return result != null ? int.parse(json.decode(result)) : null;
}
///When passed a [key] name and [value], will add that key to the storage, or update that key's value if it already exists.
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@override
Future<void> setItem({required String key, required dynamic value}) async {
var encodedValue = json.encode(value);
await _controller?.evaluateJavascript(source: """
@ -117,14 +96,7 @@ class AndroidStorage extends PlatformStorage {
""");
}
///When passed a [key] name, will return that key's value, or `null` if the key does not exist, in the given Storage object.
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@override
Future<dynamic> getItem({required String key}) async {
var itemValue = await _controller?.evaluateJavascript(source: """
window.$webStorageType.getItem("$key");
@ -141,28 +113,14 @@ class AndroidStorage extends PlatformStorage {
return itemValue;
}
///When passed a [key] name, will remove that key from the given Storage object if it exists.
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@override
Future<void> removeItem({required String key}) async {
await _controller?.evaluateJavascript(source: """
window.$webStorageType.removeItem("$key");
""");
}
///Returns the list of all items from the given Storage object.
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@override
Future<List<WebStorageItem>> getItems() async {
var webStorageItems = <WebStorageItem>[];
@ -195,29 +153,14 @@ class AndroidStorage extends PlatformStorage {
return webStorageItems;
}
///Clears all keys stored in a given Storage object.
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@override
Future<void> clear() async {
await _controller?.evaluateJavascript(source: """
window.$webStorageType.clear();
""");
}
///When passed a number [index], returns the name of the nth key in a given Storage object.
///The order of keys is user-agent defined, so you should not rely on it.
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@override
Future<String> key({required int index}) async {
var result = await _controller?.evaluateJavascript(source: """
window.$webStorageType.key($index);
@ -225,7 +168,6 @@ class AndroidStorage extends PlatformStorage {
return result != null ? json.decode(result) : null;
}
///Disposes the storage.
@override
void dispose() {
_controller = null;
@ -251,8 +193,7 @@ class AndroidLocalStorageCreationParams
}
}
///Class that provides methods to manage the JavaScript `window.localStorage` object.
///It used by [AndroidWebStorage].
///{@macro flutter_inappwebview_platform_interface.PlatformLocalStorage}
class AndroidLocalStorage extends AndroidStorage
implements PlatformLocalStorage {
/// Constructs a [AndroidLocalStorage].
@ -291,8 +232,7 @@ class AndroidSessionStorageCreationParams
}
}
///Class that provides methods to manage the JavaScript `window.sessionStorage` object.
///It used by [AndroidWebStorage].
///{@macro flutter_inappwebview_platform_interface.PlatformSessionStorage}
class AndroidSessionStorage extends AndroidStorage
implements PlatformSessionStorage {
/// Constructs a [AndroidSessionStorage].

View File

@ -26,16 +26,7 @@ class AndroidWebStorageManagerCreationParams
}
}
///Class that implements a singleton object (shared instance) which manages the web storage used by WebView instances.
///On Android, it is implemented using [WebStorage](https://developer.android.com/reference/android/webkit/WebStorage.html).
///On iOS and MacOS, it is implemented using [WKWebsiteDataStore.default()](https://developer.apple.com/documentation/webkit/wkwebsitedatastore).
///
///**NOTE for iOS**: available from iOS 9.0+.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformWebStorageManager}
class AndroidWebStorageManager extends PlatformWebStorageManager
with ChannelController {
/// Creates a new [AndroidWebStorageManager].
@ -67,10 +58,7 @@ class AndroidWebStorageManager extends PlatformWebStorageManager
Future<dynamic> _handleMethod(MethodCall call) async {}
///Gets the origins currently using either the Application Cache or Web SQL Database APIs.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebStorage.getOrigins](https://developer.android.com/reference/android/webkit/WebStorage#getOrigins(android.webkit.ValueCallback%3Cjava.util.Map%3E)))
@override
Future<List<WebStorageOrigin>> getOrigins() async {
List<WebStorageOrigin> originsList = [];
@ -90,57 +78,34 @@ class AndroidWebStorageManager extends PlatformWebStorageManager
return originsList;
}
///Clears all storage currently being used by the JavaScript storage APIs.
///This includes the Application Cache, Web SQL Database and the HTML5 Web Storage APIs.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebStorage.deleteAllData](https://developer.android.com/reference/android/webkit/WebStorage#deleteAllData()))
@override
Future<void> deleteAllData() async {
Map<String, dynamic> args = <String, dynamic>{};
await channel?.invokeMethod('deleteAllData', args);
}
///Clears the storage currently being used by both the Application Cache and Web SQL Database APIs by the given [origin].
///The origin is specified using its string representation.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebStorage.deleteOrigin](https://developer.android.com/reference/android/webkit/WebStorage#deleteOrigin(java.lang.String)))
@override
Future<void> deleteOrigin({required String origin}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("origin", () => origin);
await channel?.invokeMethod('deleteOrigin', args);
}
///Gets the storage quota for the Web SQL Database API for the given [origin].
///The quota is given in bytes and the origin is specified using its string representation.
///Note that a quota is not enforced on a per-origin basis for the Application Cache API.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebStorage.getQuotaForOrigin](https://developer.android.com/reference/android/webkit/WebStorage#getQuotaForOrigin(java.lang.String,%20android.webkit.ValueCallback%3Cjava.lang.Long%3E)))
@override
Future<int> getQuotaForOrigin({required String origin}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("origin", () => origin);
return await channel?.invokeMethod<int>('getQuotaForOrigin', args) ?? 0;
}
///Gets the amount of storage currently being used by both the Application Cache and Web SQL Database APIs by the given [origin].
///The amount is given in bytes and the origin is specified using its string representation.
///
///**Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebStorage.getUsageForOrigin](https://developer.android.com/reference/android/webkit/WebStorage#getUsageForOrigin(java.lang.String,%20android.webkit.ValueCallback%3Cjava.lang.Long%3E)))
@override
Future<int> getUsageForOrigin({required String origin}) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("origin", () => origin);
return await channel?.invokeMethod<int>('getUsageForOrigin', args) ?? 0;
}
///Fetches data records containing the given website data types.
///
///[dataTypes] represents the website data types to fetch records for.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - WKWebsiteDataStore.fetchDataRecords](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532932-fetchdatarecords))
///- MacOS ([Official API - WKWebsiteDataStore.fetchDataRecords](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532932-fetchdatarecords))
@override
Future<List<WebsiteDataRecord>> fetchDataRecords(
{required Set<WebsiteDataType> dataTypes}) async {
List<WebsiteDataRecord> recordList = [];
@ -169,15 +134,7 @@ class AndroidWebStorageManager extends PlatformWebStorageManager
return recordList;
}
///Removes website data of the given types for the given data records.
///
///[dataTypes] represents the website data types that should be removed.
///
///[dataRecords] represents the website data records to delete website data for.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - WKWebsiteDataStore.removeData](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532936-removedata))
///- MacOS ([Official API - WKWebsiteDataStore.removeData](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532936-removedata))
@override
Future<void> removeDataFor(
{required Set<WebsiteDataType> dataTypes,
required List<WebsiteDataRecord> dataRecords}) async {
@ -197,15 +154,7 @@ class AndroidWebStorageManager extends PlatformWebStorageManager
await channel?.invokeMethod('removeDataFor', args);
}
///Removes all website data of the given types that has been modified since the given date.
///
///[dataTypes] represents the website data types that should be removed.
///
///[date] represents a date. All website data modified after this date will be removed.
///
///**Supported Platforms/Implementations**:
///- iOS ([Official API - WKWebsiteDataStore.removeData](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532938-removedata))
///- MacOS ([Official API - WKWebsiteDataStore.removeData](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532938-removedata))
@override
Future<void> removeDataModifiedSince(
{required Set<WebsiteDataType> dataTypes, required DateTime date}) async {
List<String> dataTypesList = [];

View File

@ -24,9 +24,7 @@ class AndroidPathHandlerCreationParams
}
}
///A handler that produces responses for a registered path.
///
///Implement this interface to handle other use-cases according to your app's needs.
///{@macro flutter_inappwebview_platform_interface.PlatformPathHandler}
class AndroidPathHandler extends PlatformPathHandler with ChannelController {
/// Creates a new [AndroidPathHandler].
AndroidPathHandler(PlatformPathHandlerCreationParams params)
@ -57,12 +55,12 @@ class AndroidPathHandler extends PlatformPathHandler with ChannelController {
}
}
///Converts instance to a map.
@override
Map<String, dynamic> toMap() {
return {"path": path, "type": _type, "id": _id};
}
///Converts instance to a map.
@override
Map<String, dynamic> toJson() {
return toMap();
}
@ -101,19 +99,7 @@ class AndroidAssetsPathHandlerCreationParams
}
}
///Handler class to open a file from assets directory in the application APK.
///
///Opens the requested file from the application's assets directory.
///
///The matched prefix path used shouldn't be a prefix of a real web path.
///Thus, if the requested file cannot be found a [WebResourceResponse] object with a `null` data will be returned instead of `null`.
///This saves the time of falling back to network and trying to resolve a path that doesn't exist.
///A [WebResourceResponse] with `null` data will be received as an HTTP response with status code `404` and no body.
///
///The MIME type for the file will be determined from the file's extension using
///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-).
///Developers should ensure that asset files are named using standard file extensions.
///If the file does not have a recognised extension, `text/plain` will be used by default.
///{@macro flutter_inappwebview_platform_interface.PlatformAssetsPathHandler}
class AndroidAssetsPathHandler extends AndroidPathHandler
implements PlatformAssetsPathHandler {
/// Constructs a [AndroidAssetsPathHandler].
@ -148,19 +134,7 @@ class AndroidResourcesPathHandlerCreationParams
}
}
///Handler class to open a file from resources directory in the application APK.
///
///Opens the requested file from application's resources directory.
///
///The matched prefix path used shouldn't be a prefix of a real web path.
///Thus, if the requested file cannot be found a [WebResourceResponse] object with a `null` data will be returned instead of `null`.
///This saves the time of falling back to network and trying to resolve a path that doesn't exist.
///A [WebResourceResponse] with `null` data will be received as an HTTP response with status code `404` and no body.
///
///The MIME type for the file will be determined from the file's extension using
///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-).
///Developers should ensure that asset files are named using standard file extensions.
///If the file does not have a recognised extension, `text/plain` will be used by default.
///{@macro flutter_inappwebview_platform_interface.PlatformResourcesPathHandler}
class AndroidResourcesPathHandler extends AndroidPathHandler
implements PlatformResourcesPathHandler {
/// Constructs a [AndroidResourcesPathHandler].
@ -195,24 +169,7 @@ class AndroidInternalStoragePathHandlerCreationParams
}
}
///Handler class to open files from application internal storage.
///For more information about android storage please refer to
///[Android Developers Docs: Data and file storage overview](https://developer.android.com/guide/topics/data/data-storage).
///
///To avoid leaking user or app data to the web, make sure to choose [directory] carefully,
///and assume any file under this directory could be accessed by any web page subject to same-origin rules.
///
///Opens the requested file from the exposed data directory.
///
///The matched prefix path used shouldn't be a prefix of a real web path.
///Thus, if the requested file cannot be found a [WebResourceResponse] object with a `null` data will be returned instead of `null`.
///This saves the time of falling back to network and trying to resolve a path that doesn't exist.
///A [WebResourceResponse] with `null` data will be received as an HTTP response with status code `404` and no body.
///
///The MIME type for the file will be determined from the file's extension using
///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-).
///Developers should ensure that asset files are named using standard file extensions.
///If the file does not have a recognised extension, `text/plain` will be used by default.
///{@macro flutter_inappwebview_platform_interface.PlatformInternalStoragePathHandler}
class AndroidInternalStoragePathHandler extends AndroidPathHandler
implements PlatformInternalStoragePathHandler {
/// Constructs a [AndroidInternalStoragePathHandler].

View File

@ -25,10 +25,7 @@ class AndroidWebViewFeatureCreationParams
}
}
///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///{@macro flutter_inappwebview_platform_interface.PlatformWebViewFeature}
class AndroidWebViewFeature extends PlatformWebViewFeature
with ChannelController {
/// Creates a new [AndroidWebViewFeature].
@ -64,19 +61,7 @@ class AndroidWebViewFeature extends PlatformWebViewFeature
Future<dynamic> _handleMethod(MethodCall call) async {}
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`.
///
///**Note**: This method is different from [isStartupFeatureSupported] and this
///method only accepts certain features.
///Please verify that the correct feature checking method is used for a particular feature.
///
///**Note**: If this method returns `false`, it is not safe to invoke the methods
///requiring the desired feature.
///Furthermore, if this method returns `false` for a particular feature, any callback guarded by that feature will not be invoked.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)
@override
Future<bool> isFeatureSupported(WebViewFeature feature) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("feature", () => feature.toNativeValue());
@ -84,21 +69,7 @@ class AndroidWebViewFeature extends PlatformWebViewFeature
false;
}
///Return whether a startup feature is supported at run-time.
///On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a startup feature is supported,
///depending on the combination of the desired feature,
///the Android version of device, and the WebView APK on the device.
///If running on a device with a lower API level, this will always return `false`.
///
///**Note**: This method is different from [isFeatureSupported] and this method only accepts startup features.
///Please verify that the correct feature checking method is used for a particular feature.
///
///**Note**: If this method returns `false`, it is not safe to invoke the methods requiring the desired feature.
///Furthermore, if this method returns `false` for a particular feature,
///any callback guarded by that feature will not be invoked.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)
@override
Future<bool> isStartupFeatureSupported(WebViewFeature startupFeature) async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("startupFeature", () => startupFeature.toNativeValue());

View File

@ -10,7 +10,7 @@ part of 'chrome_safari_action_button.dart';
///
///**NOTE for Android native WebView**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
class ChromeSafariBrowserActionButton {
///Use onClick instead.
@ -35,7 +35,7 @@ class ChromeSafariBrowserActionButton {
///
///**NOTE for Android native WebView**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
ChromeSafariBrowserActionButton(
{required this.id,

View File

@ -10,7 +10,7 @@ part of 'chrome_safari_browser_menu_item.dart';
///
///**NOTE for Android native WebView**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
class ChromeSafariBrowserMenuItem {
@ -33,7 +33,7 @@ class ChromeSafariBrowserMenuItem {
///
///**NOTE for Android native WebView**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
ChromeSafariBrowserMenuItem(

View File

@ -17,7 +17,7 @@ part of 'chrome_safari_browser_secondary_toolbar.dart';
///
///**NOTE for Android native WebView**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
class ChromeSafariBrowserSecondaryToolbar {
///The IDs of clickable views. The `onClick` event of these views will be handled by custom tabs.
@ -29,7 +29,7 @@ class ChromeSafariBrowserSecondaryToolbar {
///
///**NOTE for Android native WebView**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
ChromeSafariBrowserSecondaryToolbar(
{this.clickableIDs = const [], required this.layout});
@ -74,7 +74,7 @@ class ChromeSafariBrowserSecondaryToolbar {
///
///**NOTE for Android native WebView**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
class ChromeSafariBrowserSecondaryToolbarClickableID {
///The android id resource
@ -86,7 +86,7 @@ class ChromeSafariBrowserSecondaryToolbarClickableID {
///
///**NOTE for Android native WebView**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
ChromeSafariBrowserSecondaryToolbarClickableID(
{required this.id, this.onClick});

View File

@ -62,7 +62,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
CustomTabsShareState_? shareState;
@ -70,31 +70,31 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? showTitle;
///Set the custom background color of the toolbar.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
Color_? toolbarBackgroundColor;
///Sets the navigation bar color. Has no effect on Android API versions below L.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
Color_? navigationBarColor;
///Sets the navigation bar divider color. Has no effect on Android API versions below P.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
Color_? navigationBarDividerColor;
///Sets the color of the secondary toolbar.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
Color_? secondaryToolbarColor;
@ -102,7 +102,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? enableUrlBarHiding;
@ -110,7 +110,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? instantAppsEnabled;
@ -120,31 +120,31 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///If non-null, the Intent can only match the components in the given
///application package.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
String? packageName;
///Set to `true` to enable Keep Alive. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? keepAliveEnabled;
///Set to `true` to launch the Android activity in `singleInstance` mode. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? isSingleInstance;
///Set to `true` to launch the Android intent with the flag `FLAG_ACTIVITY_NO_HISTORY`. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? noHistory;
///Set to `true` to launch the Custom Tab as a Trusted Web Activity. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? isTrustedWebActivity;
@ -152,7 +152,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: Available only in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
List<String>? additionalTrustedOrigins;
@ -160,7 +160,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: Available only in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
@ExchangeableObjectProperty(deserializer: _deserializeDisplayMode)
TrustedWebActivityDisplayMode_? displayMode;
@ -169,7 +169,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: Available only in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
TrustedWebActivityScreenOrientation_? screenOrientation;
@ -177,7 +177,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///It must contain 2 [AndroidResource], where the first one represents the "enter" animation for the browser
///and the second one represents the "exit" animation for the application.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
List<AndroidResource_>? startAnimations;
@ -185,7 +185,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///It must contain 2 [AndroidResource], where the first one represents the "enter" animation for the application
///and the second one represents the "exit" animation for the browser.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
List<AndroidResource_>? exitAnimations;
@ -194,19 +194,19 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///Calling this with an intent will override any custom tabs related customizations.
///The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? alwaysUseBrowserUI;
///Set to `true` if Reader mode should be entered automatically when it is available for the webpage. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? entersReaderIfAvailable;
///Set to `true` to enable bar collapsing. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? barCollapsingEnabled;
@ -214,7 +214,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 11.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
DismissButtonStyle_? dismissButtonStyle;
@ -222,7 +222,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 10.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color_? preferredBarTintColor;
@ -230,19 +230,19 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 10.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color_? preferredControlTintColor;
///Set the custom modal presentation style when presenting the WebView. The default value is [ModalPresentationStyle.FULL_SCREEN].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ModalPresentationStyle_? presentationStyle;
///Set to the custom transition style when presenting the WebView. The default value is [ModalTransitionStyle.COVER_VERTICAL].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ModalTransitionStyle_? transitionStyle;
@ -251,7 +251,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 15.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ActivityButton_? activityButton;
@ -260,7 +260,7 @@ class ChromeSafariBrowserSettings_ implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 15.2+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
UIEventAttribution_? eventAttribution;

View File

@ -13,7 +13,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 15.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ActivityButton? activityButton;
@ -21,7 +21,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: Available only in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
List<String>? additionalTrustedOrigins;
@ -30,13 +30,13 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///Calling this with an intent will override any custom tabs related customizations.
///The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? alwaysUseBrowserUI;
///Set to `true` to enable bar collapsing. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? barCollapsingEnabled;
@ -44,7 +44,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 11.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
DismissButtonStyle? dismissButtonStyle;
@ -52,7 +52,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: Available only in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
TrustedWebActivityDisplayMode? displayMode;
@ -60,13 +60,13 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? enableUrlBarHiding;
///Set to `true` if Reader mode should be entered automatically when it is available for the webpage. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? entersReaderIfAvailable;
@ -75,7 +75,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 15.2+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
UIEventAttribution? eventAttribution;
@ -83,7 +83,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///It must contain 2 [AndroidResource], where the first one represents the "enter" animation for the application
///and the second one represents the "exit" animation for the browser.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
List<AndroidResource>? exitAnimations;
@ -91,43 +91,43 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? instantAppsEnabled;
///Set to `true` to launch the Android activity in `singleInstance` mode. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? isSingleInstance;
///Set to `true` to launch the Custom Tab as a Trusted Web Activity. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? isTrustedWebActivity;
///Set to `true` to enable Keep Alive. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? keepAliveEnabled;
///Sets the navigation bar color. Has no effect on Android API versions below L.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
Color? navigationBarColor;
///Sets the navigation bar divider color. Has no effect on Android API versions below P.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
Color? navigationBarDividerColor;
///Set to `true` to launch the Android intent with the flag `FLAG_ACTIVITY_NO_HISTORY`. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? noHistory;
@ -137,7 +137,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///If non-null, the Intent can only match the components in the given
///application package.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
String? packageName;
@ -145,7 +145,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 10.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color? preferredBarTintColor;
@ -153,13 +153,13 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: available on iOS 10.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color? preferredControlTintColor;
///Set the custom modal presentation style when presenting the WebView. The default value is [ModalPresentationStyle.FULL_SCREEN].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ModalPresentationStyle? presentationStyle;
@ -167,13 +167,13 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: Available only in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
TrustedWebActivityScreenOrientation? screenOrientation;
///Sets the color of the secondary toolbar.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
Color? secondaryToolbarColor;
@ -181,7 +181,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
CustomTabsShareState? shareState;
@ -189,7 +189,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
bool? showTitle;
@ -197,19 +197,19 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
///It must contain 2 [AndroidResource], where the first one represents the "enter" animation for the browser
///and the second one represents the "exit" animation for the application.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
List<AndroidResource>? startAnimations;
///Set the custom background color of the toolbar.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
Color? toolbarBackgroundColor;
///Set to the custom transition style when presenting the WebView. The default value is [ModalTransitionStyle.COVER_VERTICAL].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ModalTransitionStyle? transitionStyle;
ChromeSafariBrowserSettings(

View File

@ -14,6 +14,12 @@ class PlatformChromeSafariBrowserCreationParams {
const PlatformChromeSafariBrowserCreationParams();
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser}
///Class that provides a visible standard interface for browsing the web.
///It presents a self-contained web interface inside your app.
///
///If you need to customize or interact with the web content, use the `InAppWebView` widget.
///
///This class uses native [Chrome Custom Tabs](https://developer.android.com/reference/android/support/customtabs/package-summary) on Android
///and [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) on iOS.
///
@ -21,9 +27,10 @@ class PlatformChromeSafariBrowserCreationParams {
///`android.support.customtabs.action.CustomTabsService` in your `AndroidManifest.xml`
///(you can read more about it here: https://developers.google.com/web/android/custom-tabs/best-practices#applications_targeting_android_11_api_level_30_or_above).
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS
///{@endtemplate}
abstract class PlatformChromeSafariBrowser extends PlatformInterface
implements Disposable {
///Debug settings.
@ -85,6 +92,7 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
/// The parameters used to initialize the [PlatformChromeSafariBrowser].
final PlatformChromeSafariBrowserCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.open}
///Opens the [PlatformChromeSafariBrowser] instance with an [url].
///
///[url] - The [url] to load. On iOS, the [url] is required and must use the `http` or `https` scheme.
@ -101,9 +109,10 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
///
///[settings] - Settings for the [PlatformChromeSafariBrowser].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS
///{@endtemplate}
Future<void> open(
{WebUri? url,
Map<String, String>? headers,
@ -116,6 +125,7 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
throw UnimplementedError('open is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.launchUrl}
///Tells the browser to launch with [url].
///
///[url] - initial url.
@ -128,8 +138,9 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
///
///[referrer] - referrer header. Supported only on Android.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///{@endtemplate}
Future<void> launchUrl({
required WebUri url,
Map<String, String>? headers,
@ -140,6 +151,7 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
'launchUrl is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.mayLaunchUrl}
///Tells the browser of a likely future navigation to a URL.
///The most likely URL has to be specified first.
///Optionally, a list of other likely URLs can be provided.
@ -150,19 +162,21 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
///
///[otherLikelyURLs] - Other likely destinations, sorted in decreasing likelihood order.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.mayLaunchUrl](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#mayLaunchUrl(android.net.Uri,android.os.Bundle,java.util.List%3Candroid.os.Bundle%3E)))
///{@endtemplate}
Future<bool> mayLaunchUrl({WebUri? url, List<WebUri>? otherLikelyURLs}) {
throw UnimplementedError(
'mayLaunchUrl is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.validateRelationship}
///Requests to validate a relationship between the application and an origin.
///
///See [here](https://developers.google.com/digital-asset-links/v1/getting-started) for documentation about Digital Asset Links.
///This methods requests the browser to verify a relation with the calling application, to grant the associated rights.
///
///If this method returns `true`, the validation result will be provided through [onRelationshipValidationResult].
///If this method returns `true`, the validation result will be provided through [PlatformChromeSafariBrowserEvents.onRelationshipValidationResult].
///Otherwise the request didn't succeed.
///
///[relation] Relation to check, must be one of the [CustomTabsRelationType] constants.
@ -171,95 +185,111 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
///
///[extras] Reserved for future use.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.validateRelationship](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#validateRelationship(int,android.net.Uri,android.os.Bundle)))
///{@endtemplate}
Future<bool> validateRelationship(
{required CustomTabsRelationType relation, required WebUri origin}) {
throw UnimplementedError(
'validateRelationship is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.close}
///Closes the [PlatformChromeSafariBrowser] instance.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS
///{@endtemplate}
Future<void> close() {
throw UnimplementedError(
'close is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.setActionButton}
///Set a custom action button.
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsIntent.Builder.setActionButton](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setActionButton(android.graphics.Bitmap,%20java.lang.String,%20android.app.PendingIntent,%20boolean)))
///{@endtemplate}
void setActionButton(ChromeSafariBrowserActionButton actionButton) {
throw UnimplementedError(
'setActionButton is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.updateActionButton}
///Updates the [ChromeSafariBrowserActionButton.icon] and [ChromeSafariBrowserActionButton.description].
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.setActionButton](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#setActionButton(android.graphics.Bitmap,java.lang.String)))
///{@endtemplate}
Future<void> updateActionButton(
{required Uint8List icon, required String description}) {
throw UnimplementedError(
'updateActionButton is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.setSecondaryToolbar}
///Sets the remote views displayed in the secondary toolbar in a custom tab.
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsIntent.Builder.setSecondaryToolbarViews](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setSecondaryToolbarViews(android.widget.RemoteViews,int[],android.app.PendingIntent)))
///{@endtemplate}
void setSecondaryToolbar(
ChromeSafariBrowserSecondaryToolbar secondaryToolbar) {
throw UnimplementedError(
'setSecondaryToolbar is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.updateSecondaryToolbar}
///Sets or updates (if already present) the Remote Views of the secondary toolbar in an existing custom tab session.
///
///**NOTE**: Not available in a Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.setSecondaryToolbarViews](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#setSecondaryToolbarViews(android.widget.RemoteViews,int[],android.app.PendingIntent)))
///{@endtemplate}
Future<void> updateSecondaryToolbar(
ChromeSafariBrowserSecondaryToolbar secondaryToolbar) {
throw UnimplementedError(
'updateSecondaryToolbar is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.addMenuItem}
///Adds a [ChromeSafariBrowserMenuItem] to the menu.
///
///**NOTE**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS
///{@endtemplate}
void addMenuItem(ChromeSafariBrowserMenuItem menuItem) {
throw UnimplementedError(
'addMenuItem is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.addMenuItems}
///Adds a list of [ChromeSafariBrowserMenuItem] to the menu.
///
///**NOTE**: Not available in an Android Trusted Web Activity.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS
///{@endtemplate}
void addMenuItems(List<ChromeSafariBrowserMenuItem> menuItems) {
throw UnimplementedError(
'addMenuItems is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.requestPostMessageChannel}
///Sends a request to create a two way postMessage channel between the client
///and the browser.
///If you want to specifying the target origin to communicate with, set the [targetOrigin].
@ -275,74 +305,86 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
///Note that returning true here doesn't mean an origin has already been
///assigned as the validation is asynchronous.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.requestPostMessageChannel](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#requestPostMessageChannel(android.net.Uri,android.net.Uri,android.os.Bundle)))
///{@endtemplate}
Future<bool> requestPostMessageChannel(
{required WebUri sourceOrigin, WebUri? targetOrigin}) {
throw UnimplementedError(
'requestPostMessageChannel is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.postMessage}
///Sends a postMessage request using the origin communicated via [requestPostMessageChannel].
///Fails when called before [onMessageChannelReady] event.
///Fails when called before [PlatformChromeSafariBrowserEvents.onMessageChannelReady] event.
///
///[message] The message that is being sent.
///
///Returns an integer constant about the postMessage request result.
///Will return CustomTabsService.RESULT_SUCCESS if successful.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.postMessage](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#postMessage(java.lang.String,android.os.Bundle)))
///{@endtemplate}
Future<CustomTabsPostMessageResultType> postMessage(String message) {
throw UnimplementedError(
'postMessage is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.isEngagementSignalsApiAvailable}
///Returns whether the Engagement Signals API is available.
///The availability of the Engagement Signals API may change at runtime.
///If an EngagementSignalsCallback has been set, an [onSessionEnded]
///If an EngagementSignalsCallback has been set, an [PlatformChromeSafariBrowserEvents.onSessionEnded]
///signal will be sent if the API becomes unavailable later.
///
///Returns whether the Engagement Signals API is available.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsSession.isEngagementSignalsApiAvailable](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#isEngagementSignalsApiAvailable(android.os.Bundle)))
///{@endtemplate}
Future<bool> isEngagementSignalsApiAvailable() {
throw UnimplementedError(
'isEngagementSignalsApiAvailable is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.isOpened}
///Returns `true` if the [PlatformChromeSafariBrowser] instance is opened, otherwise `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS
///{@endtemplate}
bool isOpened() {
throw UnimplementedError(
'isOpened is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.isAvailable}
///On Android, returns `true` if Chrome Custom Tabs is available.
///On iOS, returns `true` if SFSafariViewController is available.
///Otherwise returns `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS
///{@endtemplate}
Future<bool> isAvailable() {
throw UnimplementedError(
'isAvailable is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.getMaxToolbarItems}
///The maximum number of allowed secondary toolbar items.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///{@endtemplate}
Future<int> getMaxToolbarItems() {
throw UnimplementedError(
'getMaxToolbarItems is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.getPackageName}
///Returns the preferred package to use for Custom Tabs.
///The preferred package name is the default VIEW intent handler as long as it supports Custom Tabs.
///To modify this preferred behavior, set [ignoreDefault] to `true` and give a
@ -357,26 +399,30 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
///
///Returns the preferred package name for handling Custom Tabs, or null.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsClient.getPackageName](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsClient#getPackageName(android.content.Context,java.util.List%3Cjava.lang.String%3E,boolean))))
///{@endtemplate}
Future<String?> getPackageName(
{List<String>? packages, bool ignoreDefault = false}) {
throw UnimplementedError(
'getPackageName is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.clearWebsiteData}
///Clear associated website data accrued from browsing activity within your app.
///This includes all local storage, cached resources, and cookies.
///
///**NOTE for iOS**: available on iOS 16.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewController.DataStore.clearWebsiteData](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/datastore/3981117-clearwebsitedata))
///{@endtemplate}
Future<void> clearWebsiteData() {
throw UnimplementedError(
'clearWebsiteData is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.prewarmConnections}
///Prewarms a connection to each URL. SFSafariViewController will automatically use a
///prewarmed connection if possible when loading its initial URL.
///
@ -395,25 +441,30 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
///
///**NOTE for iOS**: available on iOS 15.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewController.prewarmConnections](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/3752133-prewarmconnections))
///{@endtemplate}
Future<PrewarmingToken?> prewarmConnections(List<WebUri> URLs) {
throw UnimplementedError(
'prewarmConnections is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.invalidatePrewarmingToken}
///Ends all prewarmed connections associated with the token, except for connections that are also kept alive by other tokens.
///
///**NOTE for iOS**: available on iOS 15.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewController.prewarmConnections](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/3752133-prewarmconnections))
///{@endtemplate}
Future<void> invalidatePrewarmingToken(PrewarmingToken prewarmingToken) {
throw UnimplementedError(
'invalidatePrewarmingToken is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.dispose}
///Disposes the channel.
///{@endtemplate}
@override
void dispose() {
throw UnimplementedError(
@ -422,87 +473,108 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface
}
abstract class PlatformChromeSafariBrowserEvents {
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onServiceConnected}
///Event fired when the when connecting from Android Custom Tabs Service.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///{@endtemplate}
void onServiceConnected() {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onOpened}
///Event fired when the [PlatformChromeSafariBrowser] is opened.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS
///{@endtemplate}
void onOpened() {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onCompletedInitialLoad}
///Event fired when the initial URL load is complete.
///
///[didLoadSuccessfully] - `true` if loading completed successfully; otherwise, `false`. Supported only on iOS.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS ([Official API - SFSafariViewControllerDelegate.safariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontrollerdelegate/1621215-safariviewcontroller))
///{@endtemplate}
void onCompletedInitialLoad(bool? didLoadSuccessfully) {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onInitialLoadDidRedirect}
///Event fired when the initial URL load is complete.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewControllerDelegate.safariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontrollerdelegate/2923545-safariviewcontroller))
///{@endtemplate}
void onInitialLoadDidRedirect(WebUri? url) {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onNavigationEvent}
///Event fired when a navigation event happens.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsCallback.onNavigationEvent](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsCallback#onNavigationEvent(int,android.os.Bundle)))
///{@endtemplate}
void onNavigationEvent(CustomTabsNavigationEventType? navigationEvent) {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onRelationshipValidationResult}
///Event fired when a relationship validation result is available.
///
///[relation] - Relation for which the result is available. Value previously passed to [validateRelationship].
///[relation] - Relation for which the result is available. Value previously passed to [PlatformChromeSafariBrowser.validateRelationship].
///
///[requestedOrigin] - Origin requested. Value previously passed to [validateRelationship].
///[requestedOrigin] - Origin requested. Value previously passed to [PlatformChromeSafariBrowser.validateRelationship].
///
///[result] - Whether the relation was validated.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsCallback.onRelationshipValidationResult](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsCallback#onRelationshipValidationResult(int,android.net.Uri,boolean,android.os.Bundle)))
///{@endtemplate}
void onRelationshipValidationResult(
CustomTabsRelationType? relation, WebUri? requestedOrigin, bool result) {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onWillOpenInBrowser}
///Event fired when the user opens the current page in the default browser by tapping the toolbar button.
///
///**NOTE for iOS**: available on iOS 14.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - SFSafariViewControllerDelegate.safariViewControllerWillOpenInBrowser](https://developer.apple.com/documentation/safariservices/sfsafariviewcontrollerdelegate/3650426-safariviewcontrollerwillopeninbr))
///{@endtemplate}
void onWillOpenInBrowser() {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onMessageChannelReady}
///Called when the [PlatformChromeSafariBrowser] has requested a postMessage channel through
///[requestPostMessageChannel] and the channel is ready for sending and receiving messages on both ends.
///[PlatformChromeSafariBrowser.requestPostMessageChannel] and the channel is ready for sending and receiving messages on both ends.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsCallback.onMessageChannelReady](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsCallback#onMessageChannelReady(android.os.Bundle)))
///{@endtemplate}
void onMessageChannelReady() {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onPostMessage}
///Called when a tab controlled by this [PlatformChromeSafariBrowser] has sent a postMessage.
///If [postMessage] is called from a single thread, then the messages will be posted in the same order.
///If [PlatformChromeSafariBrowser.postMessage] is called from a single thread, then the messages will be posted in the same order.
///When received on the client side, it is the client's responsibility to preserve the ordering further.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - CustomTabsCallback.onPostMessage](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsCallback#onPostMessage(java.lang.String,android.os.Bundle)))
///{@endtemplate}
void onPostMessage(String message) {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onVerticalScrollEvent}
///Called when a user scrolls the tab.
///
///[isDirectionUp] - `false` when the user scrolls farther down the page,
///and `true` when the user scrolls back up toward the top of the page.
///
///**NOTE**: available only if [isEngagementSignalsApiAvailable] returns `true`.
///**NOTE**: available only if [PlatformChromeSafariBrowser.isEngagementSignalsApiAvailable] returns `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - EngagementSignalsCallback.onVerticalScrollEvent](https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback#onVerticalScrollEvent(boolean,android.os.Bundle)))
///{@endtemplate}
void onVerticalScrollEvent(bool isDirectionUp) {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onGreatestScrollPercentageIncreased}
///Called when a user has reached a greater scroll percentage on the page. The greatest scroll
///percentage is reset if the user navigates to a different page. If the current page's total
///height changes, this method will be called again only if the scroll progress reaches a
@ -511,27 +583,32 @@ abstract class PlatformChromeSafariBrowserEvents {
///[scrollPercentage] - An integer indicating the percent of scrollable progress
///the user hasmade down the current page.
///
///**NOTE**: available only if [isEngagementSignalsApiAvailable] returns `true`.
///**NOTE**: available only if [PlatformChromeSafariBrowser.isEngagementSignalsApiAvailable] returns `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - EngagementSignalsCallback.onGreatestScrollPercentageIncreased](https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback#onGreatestScrollPercentageIncreased(int,android.os.Bundle)))
///{@endtemplate}
void onGreatestScrollPercentageIncreased(int scrollPercentage) {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onSessionEnded}
///Called when a `CustomTabsSession` is ending or when no further Engagement Signals
///callbacks are expected to report whether any user action has occurred during the session.
///
///[didUserInteract] - Whether the user has interacted with the page in any way, e.g. scrolling.
///
///**NOTE**: available only if [isEngagementSignalsApiAvailable] returns `true`.
///**NOTE**: available only if [PlatformChromeSafariBrowser.isEngagementSignalsApiAvailable] returns `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android ([Official API - EngagementSignalsCallback.onSessionEnded](https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback#onSessionEnded(boolean,android.os.Bundle)))
///{@endtemplate}
void onSessionEnded(bool didUserInteract) {}
///{@template flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.onClosed}
///Event fired when the [PlatformChromeSafariBrowser] is closed.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS
///{@endtemplate}
void onClosed() {}
}

View File

@ -44,7 +44,7 @@ class ContentBlockerTrigger {
///A list of regular expressions to match iframes URL against.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
List<String> ifFrameUrl;
@ -52,7 +52,7 @@ class ContentBlockerTrigger {
///A Boolean value indicating if the URL matching should be case-sensitive.
///The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -62,7 +62,7 @@ class ContentBlockerTrigger {
///(how the browser intends to use the resource) that the rule should match.
///If not specified, the rule matches all resource types.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -72,7 +72,7 @@ class ContentBlockerTrigger {
///Values must be lowercase ASCII, or punycode for non-ASCII.
///Add * in front to match domain and subdomains. Can't be used with [ContentBlockerTrigger.unlessDomain].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -82,7 +82,7 @@ class ContentBlockerTrigger {
///Values must be lowercase ASCII, or punycode for non-ASCII.
///Add * in front to match domain and subdomains. Can't be used with [ContentBlockerTrigger.ifDomain].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -91,7 +91,7 @@ class ContentBlockerTrigger {
///A list of [ContentBlockerTriggerLoadType] that can include one of two mutually exclusive values.
///If not specified, the rule matches all load types.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -100,7 +100,7 @@ class ContentBlockerTrigger {
///A list of strings matched to the entire main document URL; limits the action to a specific list of URL patterns.
///Values must be lowercase ASCII, or punycode for non-ASCII. Can't be used with [ContentBlockerTrigger.unlessTopUrl].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -109,7 +109,7 @@ class ContentBlockerTrigger {
///An array of strings matched to the entire main document URL; acts on any site except URL patterns in provided list.
///Values must be lowercase ASCII, or punycode for non-ASCII. Can't be used with [ContentBlockerTrigger.ifTopUrl].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -117,7 +117,7 @@ class ContentBlockerTrigger {
///An array of strings that specify loading contexts.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
List<ContentBlockerTriggerLoadContext> loadContext;

View File

@ -10,7 +10,7 @@ part of 'context_menu.dart';
///
///**NOTE for Android native WebView**: To make it work properly on Android, JavaScript should be enabled!
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
class ContextMenu {
@ -40,7 +40,7 @@ class ContextMenu {
///
///**NOTE for Android native WebView**: To make it work properly on Android, JavaScript should be enabled!
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
ContextMenu(

View File

@ -24,10 +24,15 @@ class PlatformFindInteractionControllerCreationParams {
bool isDoneCounting)? onFindResultReceived;
}
///**Supported Platforms/Implementations**:
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController}
///This class represents the controller used by the `WebView` to add
///text-finding capabilities, such as the "Find on page" feature.
///
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
abstract class PlatformFindInteractionController extends PlatformInterface
implements Disposable {
///Debug settings.
@ -75,7 +80,7 @@ abstract class PlatformFindInteractionController extends PlatformInterface
///
///**NOTE**: on iOS, if [InAppWebViewSettings.isFindInteractionEnabled] is `true`, this event will not be called.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.FindListener.onFindResultReceived](https://developer.android.com/reference/android/webkit/WebView.FindListener#onFindResultReceived(int,%20int,%20boolean)))
///- iOS
///- MacOS
@ -84,6 +89,7 @@ abstract class PlatformFindInteractionController extends PlatformInterface
int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting)?
get onFindResultReceived => params.onFindResultReceived;
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.findAll}
///Finds all instances of find on the page and highlights them. Notifies [PlatformFindInteractionController.onFindResultReceived] listener.
///
///[find] represents the string to find.
@ -94,15 +100,17 @@ abstract class PlatformFindInteractionController extends PlatformInterface
///it uses the built-in find interaction native UI,
///otherwise this is implemented using CSS and Javascript.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.findAllAsync](https://developer.android.com/reference/android/webkit/WebView#findAllAsync(java.lang.String)))
///- iOS (if [InAppWebViewSettings.isFindInteractionEnabled] is `true`: [Official API - UIFindInteraction.presentFindNavigator](https://developer.apple.com/documentation/uikit/uifindinteraction/3975832-presentfindnavigator?changes=_2) with [Official API - UIFindInteraction.searchText](https://developer.apple.com/documentation/uikit/uifindinteraction/3975834-searchtext?changes=_2))
///- MacOS
///{@endtemplate}
Future<void> findAll({String? find}) {
throw UnimplementedError(
'findAll is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.findNext}
///Highlights and scrolls to the next match found by [findAll]. Notifies [PlatformFindInteractionController.onFindResultReceived] listener.
///
///[forward] represents the direction to search. The default value is `true`, meaning forward.
@ -111,113 +119,133 @@ abstract class PlatformFindInteractionController extends PlatformInterface
///it uses the built-in find interaction native UI,
///otherwise this is implemented using CSS and Javascript.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.findNext](https://developer.android.com/reference/android/webkit/WebView#findNext(boolean)))
///- iOS (if [InAppWebViewSettings.isFindInteractionEnabled] is `true`: [Official API - UIFindInteraction.findNext](https://developer.apple.com/documentation/uikit/uifindinteraction/3975829-findnext?changes=_2) and ([Official API - UIFindInteraction.findPrevious](https://developer.apple.com/documentation/uikit/uifindinteraction/3975830-findprevious?changes=_2)))
///- MacOS
///{@endtemplate}
Future<void> findNext({bool forward = true}) {
throw UnimplementedError(
'findNext is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.clearMatches}
///Clears the highlighting surrounding text matches created by [findAll].
///
///**NOTE**: on iOS, if [InAppWebViewSettings.isFindInteractionEnabled] is `true`,
///it uses the built-in find interaction native UI,
///otherwise this is implemented using CSS and Javascript.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.clearMatches](https://developer.android.com/reference/android/webkit/WebView#clearMatches()))
///- iOS (if [InAppWebViewSettings.isFindInteractionEnabled] is `true`: [Official API - UIFindInteraction.dismissFindNavigator](https://developer.apple.com/documentation/uikit/uifindinteraction/3975827-dismissfindnavigator?changes=_2))
///- MacOS
///{@endtemplate}
Future<void> clearMatches() {
throw UnimplementedError(
'clearMatches is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.setSearchText}
///Pre-populate the search text to be used.
///
///On iOS, if [InAppWebViewSettings.isFindInteractionEnabled] is `true,
///it will pre-populate the system find panel's search text field with a search query.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - UIFindInteraction.searchText](https://developer.apple.com/documentation/uikit/uifindinteraction/3975834-searchtext?changes=_2))
///- MacOS
///{@endtemplate}
Future<void> setSearchText(String? searchText) {
throw UnimplementedError(
'setSearchText is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.getSearchText}
///Get the search text used.
///
///On iOS, if [InAppWebViewSettings.isFindInteractionEnabled] is `true,
///it will get the system find panel's search text field value.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - UIFindInteraction.searchText](https://developer.apple.com/documentation/uikit/uifindinteraction/3975834-searchtext?changes=_2))
///- MacOS
///{@endtemplate}
Future<String?> getSearchText() {
throw UnimplementedError(
'getSearchText is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.isFindNavigatorVisible}
///A Boolean value that indicates when the find panel displays onscreen.
///
///**NOTE**: available only on iOS and only if [InAppWebViewSettings.isFindInteractionEnabled] is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - UIFindInteraction.isFindNavigatorVisible](https://developer.apple.com/documentation/uikit/uifindinteraction/3975828-isfindnavigatorvisible?changes=_2))
///{@endtemplate}
Future<bool?> isFindNavigatorVisible() {
throw UnimplementedError(
'isFindNavigatorVisible is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.updateResultCount}
///Updates the results the interface displays for the active search.
///
///**NOTE**: available only on iOS and only if [InAppWebViewSettings.isFindInteractionEnabled] is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - UIFindInteraction.updateResultCount](https://developer.apple.com/documentation/uikit/uifindinteraction/3975835-updateresultcount?changes=_2))
///{@endtemplate}
Future<void> updateResultCount() {
throw UnimplementedError(
'updateResultCount is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.presentFindNavigator}
///Begins a search, displaying the find panel.
///
///**NOTE**: available only on iOS and only if [InAppWebViewSettings.isFindInteractionEnabled] is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - UIFindInteraction.presentFindNavigator](https://developer.apple.com/documentation/uikit/uifindinteraction/3975832-presentfindnavigator?changes=_2))
///{@endtemplate}
Future<void> presentFindNavigator() {
throw UnimplementedError(
'presentFindNavigator is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.dismissFindNavigator}
///Dismisses the find panel, if present.
///
///**NOTE**: available only on iOS and only if [InAppWebViewSettings.isFindInteractionEnabled] is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - UIFindInteraction.dismissFindNavigator](https://developer.apple.com/documentation/uikit/uifindinteraction/3975827-dismissfindnavigator?changes=_2))
///{@endtemplate}
Future<void> dismissFindNavigator() {
throw UnimplementedError(
'dismissFindNavigator is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.getActiveFindSession}
///If there's a currently active find session, returns the active find session.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - UIFindInteraction.activeFindSession](https://developer.apple.com/documentation/uikit/uifindinteraction/3975825-activefindsession?changes=_7____4_8&language=objc))
///- MacOS
///{@endtemplate}
Future<FindSession?> getActiveFindSession() {
throw UnimplementedError(
'getActiveFindSession is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformFindInteractionController.dispose}
///Disposes the controller.
///{@endtemplate}
@override
void dispose() {
throw UnimplementedError(

View File

@ -8,7 +8,7 @@ part of 'in_app_browser_menu_item.dart';
///Class that represents a custom menu item for a [PlatformInAppBrowser] instance.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -18,7 +18,7 @@ class InAppBrowserMenuItem {
///Icon color.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS 13.0+
///- MacOS
@ -40,7 +40,7 @@ class InAppBrowserMenuItem {
String title;
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS

View File

@ -100,7 +100,7 @@ class InAppBrowserSettings_
///Set to `true` to create the browser and load the page, but not show it. Omit or set to `false` to have the browser open and load normally.
///The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -108,7 +108,7 @@ class InAppBrowserSettings_
///Set to `true` to hide the toolbar at the top of the WebView. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -116,7 +116,7 @@ class InAppBrowserSettings_
///Set the custom background color of the toolbar at the top.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -124,7 +124,7 @@ class InAppBrowserSettings_
///Set to `true` to hide the url bar on the toolbar at the top. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -132,7 +132,7 @@ class InAppBrowserSettings_
///Set to `true` to hide the progress bar when the WebView is loading a page. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -140,137 +140,137 @@ class InAppBrowserSettings_
///Set to `true` to hide the default menu items. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
bool? hideDefaultMenuItems;
///Set to `true` if you want the title should be displayed. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
bool? hideTitleBar;
///Set the action bar's title.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- MacOS
String? toolbarTopFixedTitle;
///Set to `false` to not close the InAppBrowser when the user click on the Android back button and the WebView cannot go back to the history. The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
bool? closeOnCannotGoBack;
///Set to `false` to block the InAppBrowser WebView going back when the user click on the Android back button. The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
bool? allowGoBackWithBackButton;
///Set to `true` to close the InAppBrowser when the user click on the Android back button. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
bool? shouldCloseOnBackButtonPressed;
///Set to `true` to set the toolbar at the top translucent. The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? toolbarTopTranslucent;
///Set the tint color to apply to the navigation bar background.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color_? toolbarTopBarTintColor;
///Set the tint color to apply to the navigation items and bar button items.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color_? toolbarTopTintColor;
///Set to `true` to hide the toolbar at the bottom of the WebView. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? hideToolbarBottom;
///Set the custom background color of the toolbar at the bottom.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color_? toolbarBottomBackgroundColor;
///Set the tint color to apply to the bar button items.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color_? toolbarBottomTintColor;
///Set to `true` to set the toolbar at the bottom translucent. The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? toolbarBottomTranslucent;
///Set the custom text for the close button.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
String? closeButtonCaption;
///Set the custom color for the close button.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color_? closeButtonColor;
///Set to `true` to hide the close button. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? hideCloseButton;
///Set the custom color for the menu button.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color_? menuButtonColor;
///Set the custom modal presentation style when presenting the WebView. The default value is [ModalPresentationStyle.FULL_SCREEN].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ModalPresentationStyle_? presentationStyle;
///Set to the custom transition style when presenting the WebView. The default value is [ModalTransitionStyle.COVER_VERTICAL].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ModalTransitionStyle_? transitionStyle;
///How the browser window should be added to the main window.
///The default value is [WindowType.CHILD].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
WindowType_? windowType;
///The windows alpha value.
///The default value is `1.0`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
double? windowAlphaValue;
///Flags that describe the windows current style, such as if its resizable or in full-screen mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
WindowStyleMask_? windowStyleMask;
@ -278,14 +278,14 @@ class InAppBrowserSettings_
///
///**NOTE for MacOS**: available on MacOS 11.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
WindowTitlebarSeparatorStyle_? windowTitlebarSeparatorStyle;
///Sets the origin and size of the windows frame rectangle according to a given frame rectangle,
///thereby setting its position and size onscreen.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
InAppWebViewRect_? windowFrame;

View File

@ -11,32 +11,32 @@ class InAppBrowserSettings
implements BrowserOptions, AndroidOptions, IosOptions {
///Set to `false` to block the InAppBrowser WebView going back when the user click on the Android back button. The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
bool? allowGoBackWithBackButton;
///Set the custom text for the close button.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
String? closeButtonCaption;
///Set the custom color for the close button.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color? closeButtonColor;
///Set to `false` to not close the InAppBrowser when the user click on the Android back button and the WebView cannot go back to the history. The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
bool? closeOnCannotGoBack;
///Set to `true` to create the browser and load the page, but not show it. Omit or set to `false` to have the browser open and load normally.
///The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -44,20 +44,20 @@ class InAppBrowserSettings
///Set to `true` to hide the close button. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? hideCloseButton;
///Set to `true` to hide the default menu items. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
bool? hideDefaultMenuItems;
///Set to `true` to hide the progress bar when the WebView is loading a page. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -65,19 +65,19 @@ class InAppBrowserSettings
///Set to `true` if you want the title should be displayed. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
bool? hideTitleBar;
///Set to `true` to hide the toolbar at the bottom of the WebView. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? hideToolbarBottom;
///Set to `true` to hide the toolbar at the top of the WebView. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -85,7 +85,7 @@ class InAppBrowserSettings
///Set to `true` to hide the url bar on the toolbar at the top. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -93,43 +93,43 @@ class InAppBrowserSettings
///Set the custom color for the menu button.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color? menuButtonColor;
///Set the custom modal presentation style when presenting the WebView. The default value is [ModalPresentationStyle.FULL_SCREEN].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ModalPresentationStyle? presentationStyle;
///Set to `true` to close the InAppBrowser when the user click on the Android back button. The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
bool? shouldCloseOnBackButtonPressed;
///Set the custom background color of the toolbar at the bottom.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color? toolbarBottomBackgroundColor;
///Set the tint color to apply to the bar button items.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color? toolbarBottomTintColor;
///Set to `true` to set the toolbar at the bottom translucent. The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? toolbarBottomTranslucent;
///Set the custom background color of the toolbar at the top.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -137,52 +137,52 @@ class InAppBrowserSettings
///Set the tint color to apply to the navigation bar background.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color? toolbarTopBarTintColor;
///Set the action bar's title.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- MacOS
String? toolbarTopFixedTitle;
///Set the tint color to apply to the navigation items and bar button items.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
Color? toolbarTopTintColor;
///Set to `true` to set the toolbar at the top translucent. The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? toolbarTopTranslucent;
///Set to the custom transition style when presenting the WebView. The default value is [ModalTransitionStyle.COVER_VERTICAL].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
ModalTransitionStyle? transitionStyle;
///The windows alpha value.
///The default value is `1.0`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
double? windowAlphaValue;
///Sets the origin and size of the windows frame rectangle according to a given frame rectangle,
///thereby setting its position and size onscreen.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
InAppWebViewRect? windowFrame;
///Flags that describe the windows current style, such as if its resizable or in full-screen mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
WindowStyleMask? windowStyleMask;
@ -190,14 +190,14 @@ class InAppBrowserSettings
///
///**NOTE for MacOS**: available on MacOS 11.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
WindowTitlebarSeparatorStyle? windowTitlebarSeparatorStyle;
///How the browser window should be added to the main window.
///The default value is [WindowType.CHILD].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
WindowType? windowType;
InAppBrowserSettings(

View File

@ -54,13 +54,17 @@ class PlatformInAppBrowserCreationParams {
final int? windowId;
}
///This class uses the native WebView of the platform.
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser}
///This class represents a native WebView displayed on top of the Flutter App,
///so it's not integrated into the Flutter widget tree.
///It uses the native WebView of the platform.
///The [webViewController] field can be used to access the [PlatformInAppWebViewController] API.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///@{endtemplate}
abstract class PlatformInAppBrowser extends PlatformInterface
implements Disposable {
///Debug settings.
@ -72,7 +76,9 @@ abstract class PlatformInAppBrowser extends PlatformInterface
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.id}
///View ID used internally.
///@{endtemplate}
String get id;
String get id {
throw UnimplementedError('id is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.contextMenu}
///Context menu used by the browser. It should be set before opening the browser.
@ -153,6 +159,7 @@ abstract class PlatformInAppBrowser extends PlatformInterface
/// The parameters used to initialize the [PlatformInAppBrowser].
final PlatformInAppBrowserCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.openUrlRequest}
///Opens the [PlatformInAppBrowser] instance with an [urlRequest].
///
///[urlRequest]: The [urlRequest] to load.
@ -161,10 +168,11 @@ abstract class PlatformInAppBrowser extends PlatformInterface
///
///[settings]: Settings for the [PlatformInAppBrowser].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> openUrlRequest(
{required URLRequest urlRequest,
// ignore: deprecated_member_use_from_same_package
@ -174,6 +182,7 @@ abstract class PlatformInAppBrowser extends PlatformInterface
'openUrlRequest is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.openFile}
///Opens the [PlatformInAppBrowser] instance with the given [assetFilePath] file.
///
///[options]: Options for the [PlatformInAppBrowser].
@ -212,10 +221,11 @@ abstract class PlatformInAppBrowser extends PlatformInterface
///
///[settings]: Settings for the [PlatformInAppBrowser].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> openFile(
{required String assetFilePath,
// ignore: deprecated_member_use_from_same_package
@ -225,6 +235,7 @@ abstract class PlatformInAppBrowser extends PlatformInterface
'openFile is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.openData}
///Opens the [PlatformInAppBrowser] instance with [data] as a content, using [baseUrl] as the base URL for it.
///
///The [mimeType] parameter specifies the format of the data. The default value is `"text/html"`.
@ -237,10 +248,11 @@ abstract class PlatformInAppBrowser extends PlatformInterface
///
///[settings]: Settings for the [PlatformInAppBrowser].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> openData(
{required String data,
String mimeType = "text/html",
@ -255,178 +267,212 @@ abstract class PlatformInAppBrowser extends PlatformInterface
'openData is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.openWithSystemBrowser}
///This is a static method that opens an [url] in the system browser. You wont be able to use the [PlatformInAppBrowser] methods here!
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> openWithSystemBrowser({required WebUri url}) {
throw UnimplementedError(
'openWithSystemBrowser is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.addMenuItem}
///Adds a [InAppBrowserMenuItem] to the menu.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
///{@endtemplate}
void addMenuItem(InAppBrowserMenuItem menuItem) {
throw UnimplementedError(
'addMenuItem is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.addMenuItems}
///Adds a list of [InAppBrowserMenuItem] to the menu.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
///{@endtemplate}
void addMenuItems(List<InAppBrowserMenuItem> menuItems) {
throw UnimplementedError(
'addMenuItems is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.removeMenuItem}
///Removes the [menuItem] from the list.
///Returns `true` if it was in the list, `false` otherwise.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
///{@endtemplate}
bool removeMenuItem(InAppBrowserMenuItem menuItem) {
throw UnimplementedError(
'removeMenuItem is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.removeMenuItems}
///Removes a list of [menuItems] from the list.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
///{@endtemplate}
void removeMenuItems(List<InAppBrowserMenuItem> menuItems) {
throw UnimplementedError(
'removeMenuItems is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.removeAllMenuItem}
///Removes all the menu items from the list.
///If the browser is already open,
///it will take effect the next time it is opened.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android
///- iOS 14.0+
///{@endtemplate}
void removeAllMenuItem() {
throw UnimplementedError(
'removeAllMenuItem is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.hasMenuItem}
///Returns `true` if the [menuItem] has been already added, otherwise `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS 14.0+
///{@endtemplate}
bool hasMenuItem(InAppBrowserMenuItem menuItem) {
throw UnimplementedError(
'hasMenuItem is not implemented on the current platform');
}
///Displays an [PlatformInAppBrowser] window that was opened hidden. Calling this has no effect if the [PlatformInAppBrowser] was already visible.
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.show}
///Displays a [PlatformInAppBrowser] window that was opened hidden. Calling this has no effect if the [PlatformInAppBrowser] was already visible.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> show() {
throw UnimplementedError('show is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.hide}
///Hides the [PlatformInAppBrowser] window. Calling this has no effect if the [PlatformInAppBrowser] was already hidden.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> hide() {
throw UnimplementedError('hide is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.close}
///Closes the [PlatformInAppBrowser] window.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> close() {
throw UnimplementedError(
'close is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.isHidden}
///Check if the Web View of the [PlatformInAppBrowser] instance is hidden.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<bool> isHidden() {
throw UnimplementedError(
'isHidden is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.setOptions}
///Use [setSettings] instead.
///{@endtemplate}
@Deprecated('Use setSettings instead')
Future<void> setOptions({required InAppBrowserClassOptions options}) {
throw UnimplementedError(
'setOptions is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.getOptions}
///Use [getSettings] instead.
///{@endtemplate}
@Deprecated('Use getSettings instead')
Future<InAppBrowserClassOptions?> getOptions() {
throw UnimplementedError(
'getOptions is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.setSettings}
///Sets the [PlatformInAppBrowser] settings with the new [settings] and evaluates them.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> setSettings({required InAppBrowserClassSettings settings}) {
throw UnimplementedError(
'setSettings is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.getSettings}
///Gets the current [PlatformInAppBrowser] settings. Returns `null` if it wasn't able to get them.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<InAppBrowserClassSettings?> getSettings() {
throw UnimplementedError(
'getSettings is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.isOpened}
///Returns `true` if the [PlatformInAppBrowser] instance is opened, otherwise `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
bool isOpened() {
throw UnimplementedError(
'isOpened is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppBrowser.dispose}
///Disposes the channel and controllers.
///{@endtemplate}
@override
void dispose() {
throw UnimplementedError(
@ -437,7 +483,7 @@ abstract class PlatformInAppBrowser extends PlatformInterface
abstract class PlatformInAppBrowserEvents {
///Event fired when the [PlatformInAppBrowser] is created.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -445,7 +491,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the [PlatformInAppBrowser] window is closed.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -453,7 +499,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the [PlatformInAppBrowser] starts to load an [url].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onPageStarted](https://developer.android.com/reference/android/webkit/WebViewClient#onPageStarted(android.webkit.WebView,%20java.lang.String,%20android.graphics.Bitmap)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview))
@ -461,7 +507,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the [PlatformInAppBrowser] finishes loading an [url].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onPageFinished](https://developer.android.com/reference/android/webkit/WebViewClient#onPageFinished(android.webkit.WebView,%20java.lang.String)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455629-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455629-webview))
@ -473,7 +519,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the [PlatformInAppBrowser] encounters an [error] loading a [request].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedError](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedError(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20android.webkit.WebResourceError)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview))
@ -491,7 +537,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: available on Android 23+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedHttpError](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedHttpError(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20android.webkit.WebResourceResponse)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
@ -500,7 +546,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the current [progress] (range 0-100) of loading a page is changed.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onProgressChanged](https://developer.android.com/reference/android/webkit/WebChromeClient#onProgressChanged(android.webkit.WebView,%20int)))
///- iOS
///- MacOS
@ -508,7 +554,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the [PlatformInAppBrowser] webview receives a [ConsoleMessage].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onConsoleMessage](https://developer.android.com/reference/android/webkit/WebChromeClient#onConsoleMessage(android.webkit.ConsoleMessage)))
///- iOS
///- MacOS
@ -526,7 +572,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useShouldOverrideUrlLoading] setting to `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.shouldOverrideUrlLoading](https://developer.android.com/reference/android/webkit/WebViewClient#shouldOverrideUrlLoading(android.webkit.WebView,%20java.lang.String)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455641-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455641-webview))
@ -539,7 +585,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useOnLoadResource] and [InAppWebViewSettings.javaScriptEnabled] setting to `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -553,7 +599,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE for MacOS**: this method is implemented with using JavaScript.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.onScrollChanged](https://developer.android.com/reference/android/webkit/WebView#onScrollChanged(int,%20int,%20int,%20int)))
///- iOS ([Official API - UIScrollViewDelegate.scrollViewDidScroll](https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619392-scrollviewdidscroll))
///- MacOS
@ -570,7 +616,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useOnDownloadStart] setting to `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.setDownloadListener](https://developer.android.com/reference/android/webkit/WebView#setDownloadListener(android.webkit.DownloadListener)))
///- iOS
///- MacOS
@ -585,7 +631,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the [PlatformInAppBrowser] webview finds the `custom-scheme` while loading a resource.
///Here you can handle the url [request] and return a [CustomSchemeResponse] to load a specific resource encoded to `base64`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler))
///- MacOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler))
@ -622,7 +668,7 @@ abstract class PlatformInAppBrowserEvents {
///Also, note that calling [PlatformInAppWebViewController.setSettings] method using the controller of the new created WebView,
///it will update also the WebView options of the caller WebView.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onCreateWindow](https://developer.android.com/reference/android/webkit/WebChromeClient#onCreateWindow(android.webkit.WebView,%20boolean,%20boolean,%20android.os.Message)))
///- iOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536907-webview))
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536907-webview))
@ -633,7 +679,7 @@ abstract class PlatformInAppBrowserEvents {
///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.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onCloseWindow](https://developer.android.com/reference/android/webkit/WebChromeClient#onCloseWindow(android.webkit.WebView)))
///- iOS ([Official API - WKUIDelegate.webViewDidClose](https://developer.apple.com/documentation/webkit/wkuidelegate/1537390-webviewdidclose))
///- MacOS ([Official API - WKUIDelegate.webViewDidClose](https://developer.apple.com/documentation/webkit/wkuidelegate/1537390-webviewdidclose))
@ -642,7 +688,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the JavaScript `window` object of the WebView has received focus.
///This is the result of the `focus` javascript event applied to the `window` object.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -651,7 +697,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the JavaScript `window` object of the WebView has lost focus.
///This is the result of the `blur` javascript event applied to the `window` object.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -662,7 +708,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[jsAlertRequest] contains the message to be displayed in the alert dialog and the of the page requesting the dialog.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onJsAlert](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsAlert(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)))
///- iOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1537406-webview))
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1537406-webview))
@ -675,7 +721,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[jsConfirmRequest] contains the message to be displayed in the confirm dialog and the of the page requesting the dialog.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onJsConfirm](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsConfirm(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)))
///- iOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview))
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview))
@ -688,7 +734,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[jsPromptRequest] contains the message to be displayed in the prompt dialog, the default value displayed in the prompt dialog, and the of the page requesting the dialog.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onJsPrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsPrompt(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20android.webkit.JsPromptResult)))
///- iOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1538086-webview))
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1538086-webview))
@ -700,7 +746,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [URLAuthenticationChallenge].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedHttpAuthRequest](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedHttpAuthRequest(android.webkit.WebView,%20android.webkit.HttpAuthHandler,%20java.lang.String,%20java.lang.String)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
@ -714,7 +760,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [ServerTrustChallenge].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedSslError](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedSslError(android.webkit.WebView,%20android.webkit.SslErrorHandler,%20android.net.http.SslError)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
@ -730,7 +776,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [ClientCertChallenge].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedClientCertRequest](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedClientCertRequest(android.webkit.WebView,%20android.webkit.ClientCertRequest)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
@ -755,7 +801,7 @@ abstract class PlatformInAppBrowserEvents {
///used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppWebViewPlatformReady")` event, the ajax requests will be intercept for sure.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -774,7 +820,7 @@ abstract class PlatformInAppBrowserEvents {
///used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppWebViewPlatformReady")` event, the ajax requests will be intercept for sure.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -793,7 +839,7 @@ abstract class PlatformInAppBrowserEvents {
///used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppWebViewPlatformReady")` event, the ajax requests will be intercept for sure.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -812,7 +858,7 @@ abstract class PlatformInAppBrowserEvents {
///used to intercept fetch requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppWebViewPlatformReady")` event, the fetch requests will be intercept for sure.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -830,7 +876,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[isReload] indicates if this url is being reloaded. Available only on Android.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.doUpdateVisitedHistory](https://developer.android.com/reference/android/webkit/WebViewClient#doUpdateVisitedHistory(android.webkit.WebView,%20java.lang.String,%20boolean)))
///- iOS
///- MacOS
@ -848,7 +894,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[printJobController] represents the controller of the print job created.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -861,14 +907,14 @@ abstract class PlatformInAppBrowserEvents {
///
///[hitTestResult] represents the hit result for hitting an HTML elements.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - View.setOnLongClickListener](https://developer.android.com/reference/android/view/View#setOnLongClickListener(android.view.View.OnLongClickListener)))
///- iOS ([Official API - UILongPressGestureRecognizer](https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer))
void onLongPressHitTestResult(InAppWebViewHitTestResult hitTestResult) {}
///Event fired when the current page has entered full screen mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onShowCustomView](https://developer.android.com/reference/android/webkit/WebChromeClient#onShowCustomView(android.view.View,%20android.webkit.WebChromeClient.CustomViewCallback)))
///- iOS ([Official API - UIWindow.didBecomeVisibleNotification](https://developer.apple.com/documentation/uikit/uiwindow/1621621-didbecomevisiblenotification))
///- MacOS ([Official API - NSWindow.didEnterFullScreenNotification](https://developer.apple.com/documentation/appkit/nswindow/1419651-didenterfullscreennotification))
@ -876,7 +922,7 @@ abstract class PlatformInAppBrowserEvents {
///Event fired when the current page has exited full screen mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onHideCustomView](https://developer.android.com/reference/android/webkit/WebChromeClient#onHideCustomView()))
///- iOS ([Official API - UIWindow.didBecomeHiddenNotification](https://developer.apple.com/documentation/uikit/uiwindow/1621617-didbecomehiddennotification))
///- MacOS ([Official API - NSWindow.didExitFullScreenNotification](https://developer.apple.com/documentation/appkit/nswindow/1419177-didexitfullscreennotification))
@ -889,7 +935,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[url] represents the URL corresponding to the page navigation that triggered this callback.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onPageCommitVisible](https://developer.android.com/reference/android/webkit/WebViewClient#onPageCommitVisible(android.webkit.WebView,%20java.lang.String)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview))
@ -899,7 +945,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[title] represents the string containing the new title of the document.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onReceivedTitle](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTitle(android.webkit.WebView,%20java.lang.String)))
///- iOS
///- MacOS
@ -915,7 +961,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[clampedY] is `true` if [y] was clamped to an over-scroll boundary.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.onOverScrolled](https://developer.android.com/reference/android/webkit/WebView#onOverScrolled(int,%20int,%20boolean,%20boolean)))
///- iOS
void onOverScrolled(int x, int y, bool clampedX, bool clampedY) {}
@ -926,7 +972,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[newScale] The new zoom scale factor.ì
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onScaleChanged](https://developer.android.com/reference/android/webkit/WebViewClient#onScaleChanged(android.webkit.WebView,%20float,%20float)))
///- iOS ([Official API - UIScrollViewDelegate.scrollViewDidZoom](https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom))
void onZoomScaleChanged(double oldScale, double newScale) {}
@ -947,7 +993,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: available only on Android 27+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onSafeBrowsingHit](https://developer.android.com/reference/android/webkit/WebViewClient#onSafeBrowsingHit(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20int,%20android.webkit.SafeBrowsingResponse)))
Future<SafeBrowsingResponse?>? onSafeBrowsingHit(
WebUri url, SafeBrowsingThreat? threatType) {
@ -972,7 +1018,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE for MacOS**: available only on iOS 12.0+. The default [PermissionResponse.action] is [PermissionResponseAction.PROMPT].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequest](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequest(android.webkit.PermissionRequest)))
///- iOS
///- MacOS
@ -994,7 +1040,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[origin] represents the origin of the web content attempting to use the Geolocation API.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsShowPrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsShowPrompt(java.lang.String,%20android.webkit.GeolocationPermissions.Callback)))
Future<GeolocationPermissionShowPromptResponse?>?
onGeolocationPermissionsShowPrompt(String origin) {
@ -1008,7 +1054,7 @@ abstract class PlatformInAppBrowserEvents {
///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.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsHidePrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsHidePrompt()))
void onGeolocationPermissionsHidePrompt() {}
@ -1033,7 +1079,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useShouldInterceptRequest] option to `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.shouldInterceptRequest](https://developer.android.com/reference/android/webkit/WebViewClient#shouldInterceptRequest(android.webkit.WebView,%20android.webkit.WebResourceRequest)))
Future<WebResourceResponse?>? shouldInterceptRequest(
WebResourceRequest request) {
@ -1064,7 +1110,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: available only on Android 29+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessUnresponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessUnresponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)))
Future<WebViewRenderProcessAction?>? onRenderProcessUnresponsive(
WebUri? url) {
@ -1088,7 +1134,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: available only on Android 29+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessResponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessResponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)))
Future<WebViewRenderProcessAction?>? onRenderProcessResponsive(WebUri? url) {
return null;
@ -1106,7 +1152,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: available only on Android 26+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onRenderProcessGone](https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)))
void onRenderProcessGone(RenderProcessGoneDetail detail) {}
@ -1118,7 +1164,7 @@ abstract class PlatformInAppBrowserEvents {
///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.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onFormResubmission](https://developer.android.com/reference/android/webkit/WebViewClient#onFormResubmission(android.webkit.WebView,%20android.os.Message,%20android.os.Message)))
Future<FormResubmissionAction?>? onFormResubmission(WebUri? url) {
return null;
@ -1136,7 +1182,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[icon] represents the favicon for the current page.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onReceivedIcon](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedIcon(android.webkit.WebView,%20android.graphics.Bitmap)))
void onReceivedIcon(Uint8List icon) {}
@ -1150,7 +1196,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[precomposed] is `true` if the url is for a precomposed touch icon.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onReceivedTouchIconUrl](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTouchIconUrl(android.webkit.WebView,%20java.lang.String,%20boolean)))
void onReceivedTouchIconUrl(WebUri url, bool precomposed) {}
@ -1171,7 +1217,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[jsBeforeUnloadRequest] contains the message to be displayed in the alert dialog and the of the page requesting the dialog.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onJsBeforeUnload](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsBeforeUnload(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)))
Future<JsBeforeUnloadResponse?>? onJsBeforeUnload(
JsBeforeUnloadRequest jsBeforeUnloadRequest) {
@ -1186,7 +1232,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[loginRequest] contains the realm, account and args of the login request.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedLoginRequest](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedLoginRequest(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20java.lang.String)))
void onReceivedLoginRequest(LoginRequest loginRequest) {}
@ -1198,14 +1244,14 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE for Android**: available only on Android 21+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequestCanceled](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequestCanceled(android.webkit.PermissionRequest)))
void onPermissionRequestCanceled(PermissionRequest permissionRequest) {}
///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.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onRequestFocus](https://developer.android.com/reference/android/webkit/WebChromeClient#onRequestFocus(android.webkit.WebView)))
void onRequestFocus() {}
@ -1215,7 +1261,7 @@ abstract class PlatformInAppBrowserEvents {
///Invoked when the web view's web content process is terminated.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi))
///- MacOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi))
void onWebContentProcessDidTerminate() {}
@ -1226,7 +1272,7 @@ abstract class PlatformInAppBrowserEvents {
///Called when a web view receives a server redirect.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455627-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455627-webview))
void onDidReceiveServerRedirectForProvisionalNavigation() {}
@ -1244,7 +1290,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useOnNavigationResponse] setting to `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
Future<NavigationResponseAction?>? onNavigationResponse(
@ -1267,7 +1313,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE for MacOS**: available only on MacOS 11.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview))
Future<ShouldAllowDeprecatedTLSAction?>? shouldAllowDeprecatedTLS(
@ -1281,7 +1327,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE for MacOS**: available only on MacOS 12.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
void onCameraCaptureStateChanged(
@ -1296,7 +1342,7 @@ abstract class PlatformInAppBrowserEvents {
///
///**NOTE for MacOS**: available only on MacOS 12.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
void onMicrophoneCaptureStateChanged(
@ -1310,7 +1356,7 @@ abstract class PlatformInAppBrowserEvents {
///
///[newContentSize] represents the new content size value.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
void onContentSizeChanged(Size oldContentSize, Size newContentSize) {}
}

View File

@ -30,14 +30,7 @@ class DefaultInAppLocalhostServerCreationParams
}
}
///This class allows you to create a simple server on `http://localhost:[port]/`
///in order to be able to load your assets file on a local server.
///The default `port` value is `8080`.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer}
class DefaultInAppLocalhostServer extends PlatformInAppLocalhostServer {
bool _started = false;
HttpServer? _server;
@ -61,30 +54,19 @@ class DefaultInAppLocalhostServer extends PlatformInAppLocalhostServer {
this._shared = shared;
}
///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.port}
@override
int get port => _port;
///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.directoryIndex}
@override
String get directoryIndex => _directoryIndex;
///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.documentRoot}
@override
String get documentRoot => _documentRoot;
///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.shared}
@override
bool get shared => _shared;
///Starts the server on `http://localhost:[port]/`.
///
///**NOTE for iOS**: For the iOS Platform, you need to add the `NSAllowsLocalNetworking` key with `true` in the `Info.plist` file
///(See [ATS Configuration Basics](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW35)):
///```xml
///<key>NSAppTransportSecurity</key>
///<dict>
/// <key>NSAllowsLocalNetworking</key>
/// <true/>
///</dict>
///```
///The `NSAllowsLocalNetworking` key is available since **iOS 10**.
@override
Future<void> start() async {
if (this._started) {
throw Exception('Server already started on http://localhost:$_port');
@ -142,7 +124,7 @@ class DefaultInAppLocalhostServer extends PlatformInAppLocalhostServer {
return completer.future;
}
///Closes the server.
@override
Future<void> close() async {
if (this._server == null) {
return;
@ -153,7 +135,7 @@ class DefaultInAppLocalhostServer extends PlatformInAppLocalhostServer {
this._server = null;
}
///Indicates if the server is running or not.
@override
bool isRunning() {
return this._server != null;
}

View File

@ -158,10 +158,10 @@ class AndroidInAppWebViewOptions
bool hardwareAcceleration;
///Sets whether the WebView supports multiple windows.
///If set to `true`, [WebView.onCreateWindow] event must be implemented by the host application. The default value is `false`.
///If set to `true`, [PlatformWebViewCreationParams.onCreateWindow] event must be implemented by the host application. The default value is `false`.
bool supportMultipleWindows;
///Regular expression used by [WebView.shouldOverrideUrlLoading] event to cancel navigation requests for frames that are not the main frame.
///Regular expression used by [PlatformWebViewCreationParams.shouldOverrideUrlLoading] event to cancel navigation requests for frames that are not the main frame.
///If the url request of a subframe matches the regular expression, then the request of that subframe is canceled.
String? regexToCancelSubFramesLoading;
@ -172,10 +172,10 @@ class AndroidInAppWebViewOptions
///as it can cause framerate drops on animations in Android 9 and lower (see [Hybrid-Composition#performance](https://github.com/flutter/flutter/wiki/Hybrid-Composition#performance)).
bool useHybridComposition;
///Set to `true` to be able to listen at the [WebView.androidShouldInterceptRequest] event. The default value is `false`.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.androidShouldInterceptRequest] event. The default value is `false`.
bool useShouldInterceptRequest;
///Set to `true` to be able to listen at the [WebView.androidOnRenderProcessGone] event. The default value is `false`.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.androidOnRenderProcessGone] event. The default value is `false`.
bool useOnRenderProcessGone;
///Sets the WebView's over-scroll mode.

View File

@ -152,7 +152,7 @@ class IOSInAppWebViewOptions
///**NOTE**: available on iOS 14.0+.
bool limitsNavigationsToAppBoundDomains;
///Set to `true` to be able to listen to the [WebView.iosOnNavigationResponse] event. The default value is `false`.
///Set to `true` to be able to listen to the [PlatformWebViewCreationParams.iosOnNavigationResponse] event. The default value is `false`.
bool useOnNavigationResponse;
///Set to `true` to enable Apple Pay API for the `WebView` at its first page load or on the next page load (using [PlatformInAppWebViewController.setOptions]). The default value is `false`.
@ -187,7 +187,7 @@ class IOSInAppWebViewOptions
///- [PlatformInAppWebViewController.addWebMessageListener]
///
///Options affected:
///- [WebView.initialUserScripts]
///- [PlatformWebViewCreationParams.initialUserScripts]
///- [InAppWebViewOptions.supportZoom]
///- [InAppWebViewOptions.useOnLoadResource]
///- [InAppWebViewOptions.useShouldInterceptAjaxRequest]
@ -195,26 +195,26 @@ class IOSInAppWebViewOptions
///- [IOSInAppWebViewOptions.enableViewportScale]
///
///Events affected:
///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty
///- the `hitTestResult` argument of [PlatformWebViewCreationParams.onLongPressHitTestResult] will be empty
///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty
///- [WebView.onLoadResource]
///- [WebView.shouldInterceptAjaxRequest]
///- [WebView.onAjaxReadyStateChange]
///- [WebView.onAjaxProgress]
///- [WebView.shouldInterceptFetchRequest]
///- [WebView.onConsoleMessage]
///- [WebView.onPrint]
///- [WebView.onWindowFocus]
///- [WebView.onWindowBlur]
///- [WebView.onFindResultReceived]
///- [PlatformWebViewCreationParams.onLoadResource]
///- [PlatformWebViewCreationParams.shouldInterceptAjaxRequest]
///- [PlatformWebViewCreationParams.onAjaxReadyStateChange]
///- [PlatformWebViewCreationParams.onAjaxProgress]
///- [PlatformWebViewCreationParams.shouldInterceptFetchRequest]
///- [PlatformWebViewCreationParams.onConsoleMessage]
///- [PlatformWebViewCreationParams.onPrint]
///- [PlatformWebViewCreationParams.onWindowFocus]
///- [PlatformWebViewCreationParams.onWindowBlur]
///- [PlatformWebViewCreationParams.onFindResultReceived]
///
///**NOTE**: available on iOS 13.0+.
bool applePayAPIEnabled;
///Used in combination with [WebView.initialUrlRequest] or [WebView.initialData] (using the `file://` scheme), it represents the URL from which to read the web content.
///Used in combination with [PlatformWebViewCreationParams.initialUrlRequest] or [PlatformWebViewCreationParams.initialData] (using the `file://` scheme), it represents the URL from which to read the web content.
///This URL must be a file-based URL (using the `file://` scheme).
///Specify the same value as the [URLRequest.url] if you are using it with the [WebView.initialUrlRequest] parameter or
///the [InAppWebViewInitialData.baseUrl] if you are using it with the [WebView.initialData] parameter to prevent WebView from reading any other content.
///Specify the same value as the [URLRequest.url] if you are using it with the [PlatformWebViewCreationParams.initialUrlRequest] parameter or
///the [InAppWebViewInitialData.baseUrl] if you are using it with the [PlatformWebViewCreationParams.initialData] parameter to prevent WebView from reading any other content.
///Specify a directory to give WebView permission to read additional files in the specified directory.
Uri? allowingReadAccessTo;

View File

@ -32,6 +32,7 @@ import '../platform_webview_feature.dart';
import '../in_app_webview/platform_inappwebview_controller.dart';
import '../context_menu/context_menu.dart';
import '../in_app_browser/platform_in_app_browser.dart';
import 'platform_webview.dart';
part 'in_app_webview_settings.g.dart';
@ -51,27 +52,27 @@ List<ContentBlocker> _deserializeContentBlockers(
///This class represents all the WebView settings available.
@ExchangeableObject(copyMethod: true)
class InAppWebViewSettings_ {
///Set to `true` to be able to listen at the [WebView.shouldOverrideUrlLoading] event.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.shouldOverrideUrlLoading] event.
///
///If the [WebView.shouldOverrideUrlLoading] event is implemented and this value is `null`,
///If the [PlatformWebViewCreationParams.shouldOverrideUrlLoading] event is implemented and this value is `null`,
///it will be automatically inferred as `true`, otherwise, the default value is `false`.
///This logic will not be applied for [PlatformInAppBrowser], where you must set the value manually.
@SupportedPlatforms(
platforms: [AndroidPlatform(), IOSPlatform(), MacOSPlatform()])
bool? useShouldOverrideUrlLoading;
///Set to `true` to be able to listen at the [WebView.onLoadResource] event.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.onLoadResource] event.
///
///If the [WebView.onLoadResource] event is implemented and this value is `null`,
///If the [PlatformWebViewCreationParams.onLoadResource] event is implemented and this value is `null`,
///it will be automatically inferred as `true`, otherwise, the default value is `false`.
///This logic will not be applied for [PlatformInAppBrowser], where you must set the value manually.
@SupportedPlatforms(
platforms: [AndroidPlatform(), IOSPlatform(), MacOSPlatform()])
bool? useOnLoadResource;
///Set to `true` to be able to listen at the [WebView.onDownloadStartRequest] event.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.onDownloadStartRequest] event.
///
///If the [WebView.onDownloadStartRequest] event is implemented and this value is `null`,
///If the [PlatformWebViewCreationParams.onDownloadStartRequest] event is implemented and this value is `null`,
///it will be automatically inferred as `true`, otherwise, the default value is `false`.
///This logic will not be applied for [PlatformInAppBrowser], where you must set the value manually.
@SupportedPlatforms(
@ -219,7 +220,7 @@ class InAppWebViewSettings_ {
])
bool? horizontalScrollBarEnabled;
///List of custom schemes that the WebView must handle. Use the [WebView.onLoadResourceWithCustomScheme] event to intercept resource requests with custom scheme.
///List of custom schemes that the WebView must handle. Use the [PlatformWebViewCreationParams.onLoadResourceWithCustomScheme] event to intercept resource requests with custom scheme.
@SupportedPlatforms(platforms: [
AndroidPlatform(),
IOSPlatform(available: "11.0"),
@ -252,18 +253,18 @@ class InAppWebViewSettings_ {
])
UserPreferredContentMode_? preferredContentMode;
///Set to `true` to be able to listen at the [WebView.shouldInterceptAjaxRequest] event.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.shouldInterceptAjaxRequest] event.
///
///If the [WebView.shouldInterceptAjaxRequest] event is implemented and this value is `null`,
///If the [PlatformWebViewCreationParams.shouldInterceptAjaxRequest] event is implemented and this value is `null`,
///it will be automatically inferred as `true`, otherwise, the default value is `false`.
///This logic will not be applied for [PlatformInAppBrowser], where you must set the value manually.
@SupportedPlatforms(
platforms: [AndroidPlatform(), IOSPlatform(), MacOSPlatform()])
bool? useShouldInterceptAjaxRequest;
///Set to `true` to be able to listen at the [WebView.shouldInterceptFetchRequest] event.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.shouldInterceptFetchRequest] event.
///
///If the [WebView.shouldInterceptFetchRequest] event is implemented and this value is `null`,
///If the [PlatformWebViewCreationParams.shouldInterceptFetchRequest] event is implemented and this value is `null`,
///it will be automatically inferred as `true`, otherwise, the default value is `false`.
///This logic will not be applied for [PlatformInAppBrowser], where you must set the value manually.
@SupportedPlatforms(
@ -605,7 +606,7 @@ because there isn't any way to make the website data store non-persistent for th
note:
"""Please note that in order for the Geolocation API to be usable by a page in the WebView, the following requirements must be met:
- an application must have permission to access the device location, see [Manifest.permission.ACCESS_COARSE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION), [Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION);
- an application must provide an implementation of the [WebView.onGeolocationPermissionsShowPrompt] callback to receive notifications that a page is requesting access to location via the JavaScript Geolocation API.""")
- an application must provide an implementation of the [PlatformWebViewCreationParams.onGeolocationPermissionsShowPrompt] callback to receive notifications that a page is requesting access to location via the JavaScript Geolocation API.""")
])
bool? geolocationEnabled;
@ -745,7 +746,7 @@ because there isn't any way to make the website data store non-persistent for th
bool? hardwareAcceleration;
///Sets whether the WebView supports multiple windows.
///If set to `true`, [WebView.onCreateWindow] event must be implemented by the host application. The default value is `false`.
///If set to `true`, [PlatformWebViewCreationParams.onCreateWindow] event must be implemented by the host application. The default value is `false`.
@SupportedPlatforms(platforms: [
AndroidPlatform(
apiName: "WebSettings.setSupportMultipleWindows",
@ -754,7 +755,7 @@ because there isn't any way to make the website data store non-persistent for th
])
bool? supportMultipleWindows;
///Regular expression used by [WebView.shouldOverrideUrlLoading] event to cancel navigation requests for frames that are not the main frame.
///Regular expression used by [PlatformWebViewCreationParams.shouldOverrideUrlLoading] event to cancel navigation requests for frames that are not the main frame.
///If the url request of a subframe matches the regular expression, then the request of that subframe is canceled.
@SupportedPlatforms(platforms: [AndroidPlatform()])
String? regexToCancelSubFramesLoading;
@ -769,17 +770,17 @@ as it can cause framerate drops on animations in Android 9 and lower (see [Hybri
])
bool? useHybridComposition;
///Set to `true` to be able to listen at the [WebView.shouldInterceptRequest] event.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.shouldInterceptRequest] event.
///
///If the [WebView.shouldInterceptRequest] event is implemented and this value is `null`,
///If the [PlatformWebViewCreationParams.shouldInterceptRequest] event is implemented and this value is `null`,
///it will be automatically inferred as `true`, otherwise, the default value is `false`.
///This logic will not be applied for [PlatformInAppBrowser], where you must set the value manually.
@SupportedPlatforms(platforms: [AndroidPlatform()])
bool? useShouldInterceptRequest;
///Set to `true` to be able to listen at the [WebView.onRenderProcessGone] event.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.onRenderProcessGone] event.
///
///If the [WebView.onRenderProcessGone] event is implemented and this value is `null`,
///If the [PlatformWebViewCreationParams.onRenderProcessGone] event is implemented and this value is `null`,
///it will be automatically inferred as `true`, otherwise, the default value is `false`.
///This logic will not be applied for [PlatformInAppBrowser], where you must set the value manually.
@SupportedPlatforms(platforms: [AndroidPlatform()])
@ -1288,9 +1289,9 @@ as it can cause framerate drops on animations in Android 9 and lower (see [Hybri
])
bool? limitsNavigationsToAppBoundDomains;
///Set to `true` to be able to listen to the [WebView.onNavigationResponse] event.
///Set to `true` to be able to listen to the [PlatformWebViewCreationParams.onNavigationResponse] event.
///
///If the [WebView.onNavigationResponse] event is implemented and this value is `null`,
///If the [PlatformWebViewCreationParams.onNavigationResponse] event is implemented and this value is `null`,
///it will be automatically inferred as `true`, otherwise, the default value is `false`.
///This logic will not be applied for [PlatformInAppBrowser], where you must set the value manually.
@SupportedPlatforms(platforms: [IOSPlatform(), MacOSPlatform()])
@ -1338,7 +1339,7 @@ as it can cause framerate drops on animations in Android 9 and lower (see [Hybri
///- [PlatformInAppWebViewController.canScrollHorizontally]
///
///Settings affected:
///- [WebView.initialUserScripts]
///- [PlatformWebViewCreationParams.initialUserScripts]
///- [InAppWebViewSettings.supportZoom]
///- [InAppWebViewSettings.useOnLoadResource]
///- [InAppWebViewSettings.useShouldInterceptAjaxRequest]
@ -1346,32 +1347,32 @@ as it can cause framerate drops on animations in Android 9 and lower (see [Hybri
///- [InAppWebViewSettings.enableViewportScale]
///
///Events affected:
///- the `hitTestResult` argument of [WebView.onLongPressHitTestResult] will be empty
///- the `hitTestResult` argument of [PlatformWebViewCreationParams.onLongPressHitTestResult] will be empty
///- the `hitTestResult` argument of [ContextMenu.onCreateContextMenu] will be empty
///- [WebView.onLoadResource]
///- [WebView.shouldInterceptAjaxRequest]
///- [WebView.onAjaxReadyStateChange]
///- [WebView.onAjaxProgress]
///- [WebView.shouldInterceptFetchRequest]
///- [WebView.onConsoleMessage]
///- [WebView.onPrintRequest]
///- [WebView.onWindowFocus]
///- [WebView.onWindowBlur]
///- [WebView.onFindResultReceived]
///- [PlatformWebViewCreationParams.onLoadResource]
///- [PlatformWebViewCreationParams.shouldInterceptAjaxRequest]
///- [PlatformWebViewCreationParams.onAjaxReadyStateChange]
///- [PlatformWebViewCreationParams.onAjaxProgress]
///- [PlatformWebViewCreationParams.shouldInterceptFetchRequest]
///- [PlatformWebViewCreationParams.onConsoleMessage]
///- [PlatformWebViewCreationParams.onPrintRequest]
///- [PlatformWebViewCreationParams.onWindowFocus]
///- [PlatformWebViewCreationParams.onWindowBlur]
///- [PlatformWebViewCreationParams.onFindResultReceived]
///- [FindInteractionController.onFindResultReceived]
///
///Also, on MacOS:
///- [WebView.onScrollChanged]
///- [PlatformWebViewCreationParams.onScrollChanged]
@SupportedPlatforms(platforms: [
IOSPlatform(available: "13.0"),
MacOSPlatform(available: "10.15")
])
bool? applePayAPIEnabled;
///Used in combination with [WebView.initialUrlRequest] or [WebView.initialData] (using the `file://` scheme), it represents the URL from which to read the web content.
///Used in combination with [PlatformWebViewCreationParams.initialUrlRequest] or [PlatformWebViewCreationParams.initialData] (using the `file://` scheme), it represents the URL from which to read the web content.
///This URL must be a file-based URL (using the `file://` scheme).
///Specify the same value as the [URLRequest.url] if you are using it with the [WebView.initialUrlRequest] parameter or
///the [InAppWebViewInitialData.baseUrl] if you are using it with the [WebView.initialData] parameter to prevent WebView from reading any other content.
///Specify the same value as the [URLRequest.url] if you are using it with the [PlatformWebViewCreationParams.initialUrlRequest] parameter or
///the [InAppWebViewInitialData.baseUrl] if you are using it with the [PlatformWebViewCreationParams.initialData] parameter to prevent WebView from reading any other content.
///Specify a directory to give WebView permission to read additional files in the specified directory.
@SupportedPlatforms(platforms: [IOSPlatform(), MacOSPlatform()])
WebUri? allowingReadAccessTo;
@ -1854,13 +1855,13 @@ class WebViewOptions {
@Deprecated('Use InAppWebViewSettings instead')
class InAppWebViewOptions
implements WebViewOptions, BrowserOptions, AndroidOptions, IosOptions {
///Set to `true` to be able to listen at the [WebView.shouldOverrideUrlLoading] event. The default value is `false`.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.shouldOverrideUrlLoading] event. The default value is `false`.
bool useShouldOverrideUrlLoading;
///Set to `true` to be able to listen at the [WebView.onLoadResource] event. The default value is `false`.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.onLoadResource] event. The default value is `false`.
bool useOnLoadResource;
///Set to `true` to be able to listen at the [WebView.onDownloadStart] event. The default value is `false`.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.onDownloadStart] event. The default value is `false`.
bool useOnDownloadStart;
///Set to `true` to have all the browser's cache cleared before the new WebView is opened. The default value is `false`.
@ -1896,7 +1897,7 @@ class InAppWebViewOptions
///Define whether the horizontal scrollbar should be drawn or not. The default value is `true`.
bool horizontalScrollBarEnabled;
///List of custom schemes that the WebView must handle. Use the [WebView.onLoadResourceCustomScheme] event to intercept resource requests with custom scheme.
///List of custom schemes that the WebView must handle. Use the [PlatformWebViewCreationParams.onLoadResourceCustomScheme] event to intercept resource requests with custom scheme.
///
///**NOTE**: available on iOS 11.0+.
List<String> resourceCustomSchemes;
@ -1911,10 +1912,10 @@ class InAppWebViewOptions
///**NOTE**: available on iOS 13.0+.
UserPreferredContentMode? preferredContentMode;
///Set to `true` to be able to listen at the [WebView.shouldInterceptAjaxRequest] event. The default value is `false`.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.shouldInterceptAjaxRequest] event. The default value is `false`.
bool useShouldInterceptAjaxRequest;
///Set to `true` to be able to listen at the [WebView.shouldInterceptFetchRequest] event. The default value is `false`.
///Set to `true` to be able to listen at the [PlatformWebViewCreationParams.shouldInterceptFetchRequest] event. The default value is `false`.
bool useShouldInterceptFetchRequest;
///Set to `true` to open a browser window with incognito mode. The default value is `false`.

View File

@ -135,7 +135,7 @@ class PlatformHeadlessInAppWebViewCreationParams
///
///**NOTE for Android**: `Size` width and height values will be converted to `int` values because they cannot have `double` values.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@ -143,13 +143,13 @@ class PlatformHeadlessInAppWebViewCreationParams
final Size initialSize;
}
///{@template flutter_inappwebview.HeadlessInAppWebView}
///{@template flutter_inappwebview_platform_interface.PlatformHeadlessInAppWebView}
///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**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@ -187,40 +187,49 @@ abstract class PlatformHeadlessInAppWebView extends PlatformInterface
/// The parameters used to initialize the [PlatformHeadlessInAppWebView].
final PlatformHeadlessInAppWebViewCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformHeadlessInAppWebView.id}
///View ID.
///{@endtemplate}
String get id =>
throw UnimplementedError('id is not implemented on the current platform');
///{@template flutter_inappwebview_platform_interface.PlatformHeadlessInAppWebView.webViewController}
///WebView Controller that can be used to access the [InAppWebViewController] API.
///{@endtemplate}
PlatformInAppWebViewController? get webViewController =>
throw UnimplementedError(
'webViewController is not implemented on the current platform');
///View ID.
String get id =>
throw UnimplementedError('id is not implemented on the current platform');
///{@template flutter_inappwebview_platform_interface.PlatformHeadlessInAppWebView.run}
///Runs the headless WebView.
///
///**NOTE for Web**: it will append a new `iframe` to the body.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
///{@endtemplate}
Future<void> run() {
throw UnimplementedError('run is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformHeadlessInAppWebView.isRunning}
///Indicates if the headless WebView is running or not.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
///{@endtemplate}
bool isRunning() {
throw UnimplementedError(
'isRunning is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformHeadlessInAppWebView.setSize}
///Set the size of the WebView in pixels.
///
///Set `-1` to match the corresponding width or height of the current device screen size.
@ -230,37 +239,42 @@ abstract class PlatformHeadlessInAppWebView extends PlatformInterface
///
///**NOTE for Android**: `Size` width and height values will be converted to `int` values because they cannot have `double` values.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
///{@endtemplate}
Future<void> setSize(Size size) {
throw UnimplementedError(
'setSize is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformHeadlessInAppWebView.getSize}
///Gets the current size in pixels of the WebView.
///
///Note that if the [PlatformHeadlessInAppWebView] is not running, this method will return `null`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
///{@endtemplate}
Future<Size?> getSize() {
throw UnimplementedError(
'getSize is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformHeadlessInAppWebView.dispose}
///Disposes the headless WebView.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///- MacOS
///{@endtemplate}
Future<void> dispose() {
throw UnimplementedError(
'dispose is not implemented on the current platform');

View File

@ -160,7 +160,7 @@ class PlatformInAppWebViewWidgetCreationParams
///The [PlatformHeadlessInAppWebView] to use to initialize this widget.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
@ -170,7 +170,7 @@ class PlatformInAppWebViewWidgetCreationParams
///Remember to dispose the [InAppWebViewKeepAlive] instance
///using [InAppWebViewController.disposeKeepAlive].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
final InAppWebViewKeepAlive? keepAlive;
@ -178,12 +178,21 @@ class PlatformInAppWebViewWidgetCreationParams
///Used to prevent gesture delay on iOS caused by Flutter's gestures handling
///between native/platform views.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
final bool? preventGestureDelay;
}
/// Interface for a platform implementation of a web view widget.
///
///{@template flutter_inappwebview_platform_interface.PlatformInAppWebViewWidget}
///Flutter Widget for adding an **inline native WebView** integrated in the flutter widget tree.
///
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- Web
///{@endtemplate}
abstract class PlatformInAppWebViewWidget extends PlatformInterface
implements Disposable {
/// Creates a new [PlatformInAppWebViewWidget]
@ -220,6 +229,7 @@ abstract class PlatformInAppWebViewWidget extends PlatformInterface
/// Returns a Widget tree that embeds the created web view.
Widget build(BuildContext context);
/// Gets the `InAppWebViewController` instance controller
T controllerFromPlatform<T>(PlatformInAppWebViewController controller);
@override

View File

@ -13,27 +13,27 @@ import 'in_app_webview_settings.dart';
import 'platform_inappwebview_controller.dart';
import '../print_job/main.dart';
///{@template flutter_inappwebview.WebView}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams}
///Class that represents a WebView. Used by [InAppWebView], [HeadlessInAppWebView] and the WebView of [PlatformInAppBrowser].
///{@endtemplate}
class PlatformWebViewCreationParams<T> {
final T Function(PlatformInAppWebViewController controller)?
controllerFromPlatform;
///{@template flutter_inappwebview.WebView.windowId}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.windowId}
///The window id of a [CreateWindowAction.windowId].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
final int? windowId;
///{@template flutter_inappwebview.WebView.onWebViewCreated}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onWebViewCreated}
///Event fired when the `WebView` is created.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -41,7 +41,7 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final void Function(T controller)? onWebViewCreated;
///{@template flutter_inappwebview.WebView.onLoadStart}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onLoadStart}
///Event fired when the `WebView` starts to load an [url].
///
///**NOTE for Web**: it will be dispatched at the same time of [onLoadStop] event
@ -49,7 +49,7 @@ class PlatformWebViewCreationParams<T> {
///If `window.location.href` isn't accessible inside the iframe,
///the [url] parameter will have the current value of the `iframe.src` attribute.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onPageStarted](https://developer.android.com/reference/android/webkit/WebViewClient#onPageStarted(android.webkit.WebView,%20java.lang.String,%20android.graphics.Bitmap)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview))
@ -57,13 +57,13 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final void Function(T controller, WebUri? url)? onLoadStart;
///{@template flutter_inappwebview.WebView.onLoadStop}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onLoadStop}
///Event fired when the `WebView` finishes loading an [url].
///
///**NOTE for Web**: If `window.location.href` isn't accessible inside the iframe,
///the [url] parameter will have the current value of the `iframe.src` attribute.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onPageFinished](https://developer.android.com/reference/android/webkit/WebViewClient#onPageFinished(android.webkit.WebView,%20java.lang.String)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455629-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455629-webview))
@ -76,10 +76,10 @@ class PlatformWebViewCreationParams<T> {
final void Function(T controller, Uri? url, int code, String message)?
onLoadError;
///{@template flutter_inappwebview.WebView.onReceivedError}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onReceivedError}
///Event fired when the `WebView` encounters an [error] loading a [request].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedError](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedError(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20android.webkit.WebResourceError)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview))
@ -94,7 +94,7 @@ class PlatformWebViewCreationParams<T> {
T controller, Uri? url, int statusCode, String description)?
onLoadHttpError;
///{@template flutter_inappwebview.WebView.onReceivedHttpError}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onReceivedHttpError}
///Event fired when the `WebView` receives an HTTP error.
///
///[request] represents the originating request.
@ -103,7 +103,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE**: available on Android 23+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedHttpError](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedHttpError(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20android.webkit.WebResourceResponse)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
@ -111,22 +111,22 @@ class PlatformWebViewCreationParams<T> {
final void Function(T controller, WebResourceRequest request,
WebResourceResponse errorResponse)? onReceivedHttpError;
///{@template flutter_inappwebview.WebView.onProgressChanged}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onProgressChanged}
///Event fired when the current [progress] of loading a page is changed.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onProgressChanged](https://developer.android.com/reference/android/webkit/WebChromeClient#onProgressChanged(android.webkit.WebView,%20int)))
///- iOS
///- MacOS
///{@endtemplate}
final void Function(T controller, int progress)? onProgressChanged;
///{@template flutter_inappwebview.WebView.onConsoleMessage}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onConsoleMessage}
///Event fired when the `WebView` receives a [ConsoleMessage].
///
///**NOTE for Web**: this event will be called only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onConsoleMessage](https://developer.android.com/reference/android/webkit/WebChromeClient#onConsoleMessage(android.webkit.ConsoleMessage)))
///- iOS
///- MacOS
@ -135,7 +135,7 @@ class PlatformWebViewCreationParams<T> {
final void Function(T controller, ConsoleMessage consoleMessage)?
onConsoleMessage;
///{@template flutter_inappwebview.WebView.shouldOverrideUrlLoading}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.shouldOverrideUrlLoading}
///Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
///
///Note that on Android there isn't any way to load an URL for a frame that is not the main frame, so if the request is not for the main frame, the navigation is allowed by default.
@ -149,7 +149,7 @@ class PlatformWebViewCreationParams<T> {
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useShouldOverrideUrlLoading] setting to `true`.
///Also, on Android this event is not called on the first page load.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.shouldOverrideUrlLoading](https://developer.android.com/reference/android/webkit/WebViewClient#shouldOverrideUrlLoading(android.webkit.WebView,%20java.lang.String)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455641-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455641-webview))
@ -158,19 +158,19 @@ class PlatformWebViewCreationParams<T> {
T controller, NavigationAction navigationAction)?
shouldOverrideUrlLoading;
///{@template flutter_inappwebview.WebView.onLoadResource}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onLoadResource}
///Event fired when the `WebView` loads a resource.
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useOnLoadResource] and [InAppWebViewSettings.javaScriptEnabled] setting to `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
final void Function(T controller, LoadedResource resource)? onLoadResource;
///{@template flutter_inappwebview.WebView.onScrollChanged}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onScrollChanged}
///Event fired when the `WebView` scrolls.
///
///[x] represents the current horizontal scroll origin in pixels.
@ -181,7 +181,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE for MacOS**: this method is implemented with using JavaScript.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.onScrollChanged](https://developer.android.com/reference/android/webkit/WebView#onScrollChanged(int,%20int,%20int,%20int)))
///- iOS ([Official API - UIScrollViewDelegate.scrollViewDidScroll](https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619392-scrollviewdidscroll))
///- Web ([Official API - Window.onscroll](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onscroll))
@ -193,7 +193,7 @@ class PlatformWebViewCreationParams<T> {
@Deprecated('Use onDownloadStartRequest instead')
final void Function(T controller, Uri url)? onDownloadStart;
///{@template flutter_inappwebview.WebView.onDownloadStartRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onDownloadStartRequest}
///Event fired when `WebView` recognizes a downloadable file.
///To download the file, you can use the [flutter_downloader](https://pub.dev/packages/flutter_downloader) plugin.
///
@ -201,7 +201,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useOnDownloadStart] setting to `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.setDownloadListener](https://developer.android.com/reference/android/webkit/WebView#setDownloadListener(android.webkit.DownloadListener)))
///- iOS
///- MacOS
@ -214,11 +214,11 @@ class PlatformWebViewCreationParams<T> {
final Future<CustomSchemeResponse?> Function(T controller, Uri url)?
onLoadResourceCustomScheme;
///{@template flutter_inappwebview.WebView.onLoadResourceWithCustomScheme}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onLoadResourceWithCustomScheme}
///Event fired when the `WebView` finds the `custom-scheme` while loading a resource.
///Here you can handle the url [request] and return a [CustomSchemeResponse] to load a specific resource encoded to `base64`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler))
///- MacOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler))
@ -226,7 +226,7 @@ class PlatformWebViewCreationParams<T> {
final Future<CustomSchemeResponse?> Function(
T controller, WebResourceRequest request)? onLoadResourceWithCustomScheme;
///{@template flutter_inappwebview.WebView.onCreateWindow}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onCreateWindow}
///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 when `window.open()` is called by JavaScript side.
///If the host application chooses to honor this request, it should return `true` from this method, create a new WebView to host the window.
@ -259,7 +259,7 @@ class PlatformWebViewCreationParams<T> {
///**NOTE for Web**: this event will be called only if the iframe has the same origin. It works only for `window.open()` javascript calls.
///Also, there is no way to block the opening the window in a synchronous way, so returning `true` will just close it quickly.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onCreateWindow](https://developer.android.com/reference/android/webkit/WebChromeClient#onCreateWindow(android.webkit.WebView,%20boolean,%20boolean,%20android.os.Message)))
///- iOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536907-webview))
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536907-webview))
@ -268,24 +268,24 @@ class PlatformWebViewCreationParams<T> {
final Future<bool?> Function(
T controller, CreateWindowAction createWindowAction)? onCreateWindow;
///{@template flutter_inappwebview.WebView.onCloseWindow}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onCloseWindow}
///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.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onCloseWindow](https://developer.android.com/reference/android/webkit/WebChromeClient#onCloseWindow(android.webkit.WebView)))
///- iOS ([Official API - WKUIDelegate.webViewDidClose](https://developer.apple.com/documentation/webkit/wkuidelegate/1537390-webviewdidclose))
///- MacOS ([Official API - WKUIDelegate.webViewDidClose](https://developer.apple.com/documentation/webkit/wkuidelegate/1537390-webviewdidclose))
///{@endtemplate}
final void Function(T controller)? onCloseWindow;
///{@template flutter_inappwebview.WebView.onWindowFocus}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onWindowFocus}
///Event fired when the JavaScript `window` object of the WebView has received focus.
///This is the result of the `focus` JavaScript event applied to the `window` object.
///
///**NOTE for Web**: this event will be called only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -293,13 +293,13 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final void Function(T controller)? onWindowFocus;
///{@template flutter_inappwebview.WebView.onWindowBlur}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onWindowBlur}
///Event fired when the JavaScript `window` object of the WebView has lost focus.
///This is the result of the `blur` JavaScript event applied to the `window` object.
///
///**NOTE for Web**: this event will be called only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -307,13 +307,13 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final void Function(T controller)? onWindowBlur;
///{@template flutter_inappwebview.WebView.onJsAlert}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onJsAlert}
///Event fired when javascript calls the `alert()` method to display an alert dialog.
///If [JsAlertResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
///
///[jsAlertRequest] contains the message to be displayed in the alert dialog and the of the page requesting the dialog.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onJsAlert](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsAlert(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)))
///- iOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1537406-webview))
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1537406-webview))
@ -321,13 +321,13 @@ class PlatformWebViewCreationParams<T> {
final Future<JsAlertResponse?> Function(
T controller, JsAlertRequest jsAlertRequest)? onJsAlert;
///{@template flutter_inappwebview.WebView.onJsConfirm}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onJsConfirm}
///Event fired when javascript calls the `confirm()` method to display a confirm dialog.
///If [JsConfirmResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
///
///[jsConfirmRequest] contains the message to be displayed in the confirm dialog and the of the page requesting the dialog.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onJsConfirm](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsConfirm(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)))
///- iOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview))
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview))
@ -335,13 +335,13 @@ class PlatformWebViewCreationParams<T> {
final Future<JsConfirmResponse?> Function(
T controller, JsConfirmRequest jsConfirmRequest)? onJsConfirm;
///{@template flutter_inappwebview.WebView.onJsPrompt}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onJsPrompt}
///Event fired when javascript calls the `prompt()` method to display a prompt dialog.
///If [JsPromptResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
///
///[jsPromptRequest] contains the message to be displayed in the prompt dialog, the default value displayed in the prompt dialog, and the of the page requesting the dialog.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onJsPrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsPrompt(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20android.webkit.JsPromptResult)))
///- iOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1538086-webview))
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1538086-webview))
@ -349,12 +349,12 @@ class PlatformWebViewCreationParams<T> {
final Future<JsPromptResponse?> Function(
T controller, JsPromptRequest jsPromptRequest)? onJsPrompt;
///{@template flutter_inappwebview.WebView.onReceivedHttpAuthRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onReceivedHttpAuthRequest}
///Event fired when the WebView received an HTTP authentication request. The default behavior is to cancel the request.
///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [URLAuthenticationChallenge].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedHttpAuthRequest](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedHttpAuthRequest(android.webkit.WebView,%20android.webkit.HttpAuthHandler,%20java.lang.String,%20java.lang.String)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
@ -363,13 +363,13 @@ class PlatformWebViewCreationParams<T> {
T controller, HttpAuthenticationChallenge challenge)?
onReceivedHttpAuthRequest;
///{@template flutter_inappwebview.WebView.onReceivedServerTrustAuthRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onReceivedServerTrustAuthRequest}
///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].
///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [ServerTrustChallenge].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedSslError](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedSslError(android.webkit.WebView,%20android.webkit.SslErrorHandler,%20android.net.http.SslError)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
@ -378,7 +378,7 @@ class PlatformWebViewCreationParams<T> {
T controller, ServerTrustChallenge challenge)?
onReceivedServerTrustAuthRequest;
///{@template flutter_inappwebview.WebView.onReceivedClientCertRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onReceivedClientCertRequest}
///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.
@ -386,7 +386,7 @@ class PlatformWebViewCreationParams<T> {
///
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [ClientCertChallenge].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedClientCertRequest](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedClientCertRequest(android.webkit.WebView,%20android.webkit.ClientCertRequest)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
@ -399,7 +399,7 @@ class PlatformWebViewCreationParams<T> {
final void Function(T controller, int activeMatchOrdinal, int numberOfMatches,
bool isDoneCounting)? onFindResultReceived;
///{@template flutter_inappwebview.WebView.shouldInterceptAjaxRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.shouldInterceptAjaxRequest}
///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.
///
@ -411,7 +411,7 @@ class PlatformWebViewCreationParams<T> {
///used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppWebViewPlatformReady")` event, the ajax requests will be intercept for sure.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -419,7 +419,7 @@ class PlatformWebViewCreationParams<T> {
final Future<AjaxRequest?> Function(T controller, AjaxRequest ajaxRequest)?
shouldInterceptAjaxRequest;
///{@template flutter_inappwebview.WebView.onAjaxReadyStateChange}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onAjaxReadyStateChange}
///Event fired whenever the `readyState` attribute of an `XMLHttpRequest` changes.
///It gives the host application a chance to abort the request.
///
@ -431,7 +431,7 @@ class PlatformWebViewCreationParams<T> {
///used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppWebViewPlatformReady")` event, the ajax requests will be intercept for sure.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -439,7 +439,7 @@ class PlatformWebViewCreationParams<T> {
final Future<AjaxRequestAction?> Function(
T controller, AjaxRequest ajaxRequest)? onAjaxReadyStateChange;
///{@template flutter_inappwebview.WebView.onAjaxProgress}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onAjaxProgress}
///Event fired as an `XMLHttpRequest` progress.
///It gives the host application a chance to abort the request.
///
@ -451,7 +451,7 @@ class PlatformWebViewCreationParams<T> {
///used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppWebViewPlatformReady")` event, the ajax requests will be intercept for sure.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -459,7 +459,7 @@ class PlatformWebViewCreationParams<T> {
final Future<AjaxRequestAction?> Function(
T controller, AjaxRequest ajaxRequest)? onAjaxProgress;
///{@template flutter_inappwebview.WebView.shouldInterceptFetchRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.shouldInterceptFetchRequest}
///Event fired when a request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API).
///It gives the host application a chance to take control over the request before sending it.
///
@ -471,7 +471,7 @@ class PlatformWebViewCreationParams<T> {
///used to intercept fetch requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms).
///Inside the `window.addEventListener("flutterInAppWebViewPlatformReady")` event, the fetch requests will be intercept for sure.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -479,7 +479,7 @@ class PlatformWebViewCreationParams<T> {
final Future<FetchRequest?> Function(T controller, FetchRequest fetchRequest)?
shouldInterceptFetchRequest;
///{@template flutter_inappwebview.WebView.onUpdateVisitedHistory}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onUpdateVisitedHistory}
///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](https://developer.mozilla.org/en-US/docs/Web/API/History_API)** functions (`pushState()`, `replaceState()`) and `onpopstate` event
@ -491,7 +491,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE for Web**: this event will be called only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.doUpdateVisitedHistory](https://developer.android.com/reference/android/webkit/WebViewClient#doUpdateVisitedHistory(android.webkit.WebView,%20java.lang.String,%20boolean)))
///- iOS
///- MacOS
@ -504,7 +504,7 @@ class PlatformWebViewCreationParams<T> {
@Deprecated("Use onPrintRequest instead")
final void Function(T controller, Uri? url)? onPrint;
///{@template flutter_inappwebview.WebView.onPrintRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onPrintRequest}
///Event fired when `window.print()` is called from JavaScript side.
///Return `true` if you want to handle the print job.
///Otherwise return `false`, so the [PlatformPrintJobController] will be handled and disposed automatically by the system.
@ -516,7 +516,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE for Web**: this event will be called only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -525,22 +525,22 @@ class PlatformWebViewCreationParams<T> {
final Future<bool?> Function(T controller, WebUri? url,
PlatformPrintJobController? printJobController)? onPrintRequest;
///{@template flutter_inappwebview.WebView.onLongPressHitTestResult}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onLongPressHitTestResult}
///Event fired when an HTML element of the webview has been clicked and held.
///
///[hitTestResult] represents the hit result for hitting an HTML elements.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - View.setOnLongClickListener](https://developer.android.com/reference/android/view/View#setOnLongClickListener(android.view.View.OnLongClickListener)))
///- iOS ([Official API - UILongPressGestureRecognizer](https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer))
///{@endtemplate}
final void Function(T controller, InAppWebViewHitTestResult hitTestResult)?
onLongPressHitTestResult;
///{@template flutter_inappwebview.WebView.onEnterFullscreen}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onEnterFullscreen}
///Event fired when the current page has entered full screen mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onShowCustomView](https://developer.android.com/reference/android/webkit/WebChromeClient#onShowCustomView(android.view.View,%20android.webkit.WebChromeClient.CustomViewCallback)))
///- iOS ([Official API - UIWindow.didBecomeVisibleNotification](https://developer.apple.com/documentation/uikit/uiwindow/1621621-didbecomevisiblenotification))
///- MacOS ([Official API - NSWindow.didEnterFullScreenNotification](https://developer.apple.com/documentation/appkit/nswindow/1419651-didenterfullscreennotification))
@ -548,14 +548,14 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final void Function(T controller)? onEnterFullscreen;
///{@template flutter_inappwebview.WebView.onExitFullscreen}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onExitFullscreen}
///Event fired when the current page has exited full screen mode.
///
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebChromeClient#onHideCustomView()
///
///**Official iOS API**: https://developer.apple.com/documentation/uikit/uiwindow/1621617-didbecomehiddennotification
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onHideCustomView](https://developer.android.com/reference/android/webkit/WebChromeClient#onHideCustomView()))
///- iOS ([Official API - UIWindow.didBecomeHiddenNotification](https://developer.apple.com/documentation/uikit/uiwindow/1621617-didbecomehiddennotification))
///- MacOS ([Official API - NSWindow.didExitFullScreenNotification](https://developer.apple.com/documentation/appkit/nswindow/1419177-didexitfullscreennotification))
@ -563,7 +563,7 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final void Function(T controller)? onExitFullscreen;
///{@template flutter_inappwebview.WebView.onPageCommitVisible}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onPageCommitVisible}
///Called when the web view begins to receive web content.
///
///This event occurs early in the document loading process, and as such
@ -571,21 +571,21 @@ class PlatformWebViewCreationParams<T> {
///
///[url] represents the URL corresponding to the page navigation that triggered this callback.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onPageCommitVisible](https://developer.android.com/reference/android/webkit/WebViewClient#onPageCommitVisible(android.webkit.WebView,%20java.lang.String)))
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview))
///{@endtemplate}
final void Function(T controller, WebUri? url)? onPageCommitVisible;
///{@template flutter_inappwebview.WebView.onTitleChanged}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onTitleChanged}
///Event fired when a change in the document title occurred.
///
///[title] represents the string containing the new title of the document.
///
///**NOTE for Web**: this event will be called only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onReceivedTitle](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTitle(android.webkit.WebView,%20java.lang.String)))
///- iOS
///- MacOS
@ -593,7 +593,7 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final void Function(T controller, String? title)? onTitleChanged;
///{@template flutter_inappwebview.WebView.onOverScrolled}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onOverScrolled}
///Event fired to respond to the results of an over-scroll operation.
///
///[x] represents the new X scroll value in pixels.
@ -604,14 +604,14 @@ class PlatformWebViewCreationParams<T> {
///
///[clampedY] is `true` if [y] was clamped to an over-scroll boundary.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebView.onOverScrolled](https://developer.android.com/reference/android/webkit/WebView#onOverScrolled(int,%20int,%20boolean,%20boolean)))
///- iOS
///{@endtemplate}
final void Function(T controller, int x, int y, bool clampedX, bool clampedY)?
onOverScrolled;
///{@template flutter_inappwebview.WebView.onZoomScaleChanged}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onZoomScaleChanged}
///Event fired when the zoom scale of the WebView has changed.
///
///[oldScale] The old zoom scale factor.
@ -620,7 +620,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE for Web**: this event will be called only if the iframe has the same origin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onScaleChanged](https://developer.android.com/reference/android/webkit/WebViewClient#onScaleChanged(android.webkit.WebView,%20float,%20float)))
///- iOS ([Official API - UIScrollViewDelegate.scrollViewDidZoom](https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom))
///- Web
@ -634,7 +634,7 @@ class PlatformWebViewCreationParams<T> {
T controller, Uri url, SafeBrowsingThreat? threatType)?
androidOnSafeBrowsingHit;
///{@template flutter_inappwebview.WebView.onSafeBrowsingHit}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onSafeBrowsingHit}
///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.
///
@ -644,7 +644,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE**: available only on Android 27+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onSafeBrowsingHit](https://developer.android.com/reference/android/webkit/WebViewClient#onSafeBrowsingHit(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20int,%20android.webkit.SafeBrowsingResponse)))
///{@endtemplate}
final Future<SafeBrowsingResponse?> Function(
@ -657,7 +657,7 @@ class PlatformWebViewCreationParams<T> {
T controller, String origin, List<String> resources)?
androidOnPermissionRequest;
///{@template flutter_inappwebview.WebView.onPermissionRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onPermissionRequest}
///Event fired when the WebView is requesting permission to access the specified resources and the permission currently isn't granted or denied.
///
///[permissionRequest] represents the permission request with an array of resources the web content wants to access
@ -669,7 +669,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE for MacOS**: available only on iOS 12.0+. The default [PermissionResponse.action] is [PermissionResponseAction.PROMPT].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequest](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequest(android.webkit.PermissionRequest)))
///- iOS
///- MacOS
@ -682,14 +682,14 @@ class PlatformWebViewCreationParams<T> {
final Future<GeolocationPermissionShowPromptResponse?> Function(
T controller, String origin)? androidOnGeolocationPermissionsShowPrompt;
///{@template flutter_inappwebview.WebView.onGeolocationPermissionsShowPrompt}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onGeolocationPermissionsShowPrompt}
///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.
///
///[origin] represents the origin of the web content attempting to use the Geolocation API.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsShowPrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsShowPrompt(java.lang.String,%20android.webkit.GeolocationPermissions.Callback)))
///{@endtemplate}
final Future<GeolocationPermissionShowPromptResponse?> Function(
@ -699,11 +699,11 @@ class PlatformWebViewCreationParams<T> {
@Deprecated("Use onGeolocationPermissionsHidePrompt instead")
final void Function(T controller)? androidOnGeolocationPermissionsHidePrompt;
///{@template flutter_inappwebview.WebView.onGeolocationPermissionsHidePrompt}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onGeolocationPermissionsHidePrompt}
///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.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsHidePrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsHidePrompt()))
///{@endtemplate}
final void Function(T controller)? onGeolocationPermissionsHidePrompt;
@ -713,7 +713,7 @@ class PlatformWebViewCreationParams<T> {
final Future<WebResourceResponse?> Function(
T controller, WebResourceRequest request)? androidShouldInterceptRequest;
///{@template flutter_inappwebview.WebView.shouldInterceptRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.shouldInterceptRequest}
///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.
@ -728,7 +728,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useShouldInterceptRequest] option to `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.shouldInterceptRequest](https://developer.android.com/reference/android/webkit/WebViewClient#shouldInterceptRequest(android.webkit.WebView,%20android.webkit.WebResourceRequest)))
///{@endtemplate}
final Future<WebResourceResponse?> Function(
@ -739,7 +739,7 @@ class PlatformWebViewCreationParams<T> {
final Future<WebViewRenderProcessAction?> Function(T controller, Uri? url)?
androidOnRenderProcessUnresponsive;
///{@template flutter_inappwebview.WebView.onRenderProcessUnresponsive}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onRenderProcessUnresponsive}
///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.
///
///If a WebView fails to process an input event, or successfully navigate to a new URL within a reasonable time frame, the renderer is considered to be unresponsive, and this callback will be called.
@ -757,7 +757,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE**: available only on Android 29+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessUnresponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessUnresponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)))
///{@endtemplate}
final Future<WebViewRenderProcessAction?> Function(T controller, WebUri? url)?
@ -768,7 +768,7 @@ class PlatformWebViewCreationParams<T> {
final Future<WebViewRenderProcessAction?> Function(T controller, Uri? url)?
androidOnRenderProcessResponsive;
///{@template flutter_inappwebview.WebView.onRenderProcessResponsive}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onRenderProcessResponsive}
///Event called once when an unresponsive renderer currently associated with the WebView becomes responsive.
///
///After a WebView renderer becomes unresponsive, which is notified to the application by [onRenderProcessUnresponsive],
@ -779,7 +779,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE**: available only on Android 29+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessResponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessResponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)))
///{@endtemplate}
final Future<WebViewRenderProcessAction?> Function(T controller, WebUri? url)?
@ -790,7 +790,7 @@ class PlatformWebViewCreationParams<T> {
final void Function(T controller, RenderProcessGoneDetail detail)?
androidOnRenderProcessGone;
///{@template flutter_inappwebview.WebView.onRenderProcessGone}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onRenderProcessGone}
///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.
@ -799,7 +799,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE**: available only on Android 26+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onRenderProcessGone](https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)))
///{@endtemplate}
final void Function(T controller, RenderProcessGoneDetail detail)?
@ -810,10 +810,10 @@ class PlatformWebViewCreationParams<T> {
final Future<FormResubmissionAction?> Function(T controller, Uri? url)?
androidOnFormResubmission;
///{@template flutter_inappwebview.WebView.onFormResubmission}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onFormResubmission}
///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.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onFormResubmission](https://developer.android.com/reference/android/webkit/WebViewClient#onFormResubmission(android.webkit.WebView,%20android.os.Message,%20android.os.Message)))
///{@endtemplate}
final Future<FormResubmissionAction?> Function(T controller, WebUri? url)?
@ -828,12 +828,12 @@ class PlatformWebViewCreationParams<T> {
@Deprecated('Use onReceivedIcon instead')
final void Function(T controller, Uint8List icon)? androidOnReceivedIcon;
///{@template flutter_inappwebview.WebView.onReceivedIcon}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onReceivedIcon}
///Event fired when there is new favicon for the current page.
///
///[icon] represents the favicon for the current page.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onReceivedIcon](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedIcon(android.webkit.WebView,%20android.graphics.Bitmap)))
///{@endtemplate}
final void Function(T controller, Uint8List icon)? onReceivedIcon;
@ -843,14 +843,14 @@ class PlatformWebViewCreationParams<T> {
final void Function(T controller, Uri url, bool precomposed)?
androidOnReceivedTouchIconUrl;
///{@template flutter_inappwebview.WebView.onReceivedTouchIconUrl}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onReceivedTouchIconUrl}
///Event fired when there is an url for an apple-touch-icon.
///
///[url] represents the icon url.
///
///[precomposed] is `true` if the url is for a precomposed touch icon.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onReceivedTouchIconUrl](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTouchIconUrl(android.webkit.WebView,%20java.lang.String,%20boolean)))
///{@endtemplate}
final void Function(T controller, WebUri url, bool precomposed)?
@ -862,7 +862,7 @@ class PlatformWebViewCreationParams<T> {
T controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)?
androidOnJsBeforeUnload;
///{@template flutter_inappwebview.WebView.onJsBeforeUnload}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onJsBeforeUnload}
///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] is `true`, WebView will assume that the client will handle the confirm dialog.
@ -873,7 +873,7 @@ class PlatformWebViewCreationParams<T> {
///
///[jsBeforeUnloadRequest] contains the message to be displayed in the alert dialog and the of the page requesting the dialog.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onJsBeforeUnload](https://developer.android.com/reference/android/webkit/WebChromeClient#onJsBeforeUnload(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)))
///{@endtemplate}
final Future<JsBeforeUnloadResponse?> Function(
@ -885,18 +885,18 @@ class PlatformWebViewCreationParams<T> {
final void Function(T controller, LoginRequest loginRequest)?
androidOnReceivedLoginRequest;
///{@template flutter_inappwebview.WebView.onReceivedLoginRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onReceivedLoginRequest}
///Event fired when a request to automatically log in the user has been processed.
///
///[loginRequest] contains the realm, account and args of the login request.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebViewClient.onReceivedLoginRequest](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedLoginRequest(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20java.lang.String)))
///{@endtemplate}
final void Function(T controller, LoginRequest loginRequest)?
onReceivedLoginRequest;
///{@template flutter_inappwebview.WebView.onPermissionRequestCanceled}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onPermissionRequestCanceled}
///Notify the host application that the given permission request has been canceled. Any related UI should therefore be hidden.
///
///[permissionRequest] represents the permission request that needs be canceled
@ -905,17 +905,17 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE for Android**: available only on Android 21+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequestCanceled](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequestCanceled(android.webkit.PermissionRequest)))
///{@endtemplate}
final void Function(T controller, PermissionRequest permissionRequest)?
onPermissionRequestCanceled;
///{@template flutter_inappwebview.WebView.onRequestFocus}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onRequestFocus}
///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.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - WebChromeClient.onRequestFocus](https://developer.android.com/reference/android/webkit/WebChromeClient#onRequestFocus(android.webkit.WebView)))
///{@endtemplate}
final void Function(T controller)? onRequestFocus;
@ -924,10 +924,10 @@ class PlatformWebViewCreationParams<T> {
@Deprecated('Use onWebContentProcessDidTerminate instead')
final void Function(T controller)? iosOnWebContentProcessDidTerminate;
///{@template flutter_inappwebview.WebView.onWebContentProcessDidTerminate}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onWebContentProcessDidTerminate}
///Invoked when the web view's web content process is terminated.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi))
///- MacOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi))
///{@endtemplate}
@ -938,10 +938,10 @@ class PlatformWebViewCreationParams<T> {
final void Function(T controller)?
iosOnDidReceiveServerRedirectForProvisionalNavigation;
///{@template flutter_inappwebview.WebView.onDidReceiveServerRedirectForProvisionalNavigation}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onDidReceiveServerRedirectForProvisionalNavigation}
///Called when a web view receives a server redirect.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455627-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455627-webview))
///{@endtemplate}
@ -954,14 +954,14 @@ class PlatformWebViewCreationParams<T> {
T controller, IOSWKNavigationResponse navigationResponse)?
iosOnNavigationResponse;
///{@template flutter_inappwebview.WebView.onNavigationResponse}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onNavigationResponse}
///Called when a web view asks for permission to navigate to new content after the response to the navigation request is known.
///
///[navigationResponse] represents the navigation response.
///
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useOnNavigationResponse] setting to `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
///{@endtemplate}
@ -975,7 +975,7 @@ class PlatformWebViewCreationParams<T> {
T controller, URLAuthenticationChallenge challenge)?
iosShouldAllowDeprecatedTLS;
///{@template flutter_inappwebview.WebView.shouldAllowDeprecatedTLS}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.shouldAllowDeprecatedTLS}
///Called when a web view asks whether to continue with a connection that uses a deprecated version of TLS (v1.0 and v1.1).
///
///[challenge] represents the authentication challenge.
@ -984,7 +984,7 @@ class PlatformWebViewCreationParams<T> {
///
///**NOTE for MacOS**: available only on MacOS 11.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview))
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview))
///{@endtemplate}
@ -992,14 +992,14 @@ class PlatformWebViewCreationParams<T> {
T controller, URLAuthenticationChallenge challenge)?
shouldAllowDeprecatedTLS;
///{@template flutter_inappwebview.WebView.onCameraCaptureStateChanged}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onCameraCaptureStateChanged}
///Event fired when a change in the camera capture state occurred.
///
///**NOTE for iOS**: available only on iOS 15.0+.
///
///**NOTE for MacOS**: available only on MacOS 12.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///{@endtemplate}
@ -1009,14 +1009,14 @@ class PlatformWebViewCreationParams<T> {
MediaCaptureState? newState,
)? onCameraCaptureStateChanged;
///{@template flutter_inappwebview.WebView.onMicrophoneCaptureStateChanged}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onMicrophoneCaptureStateChanged}
///Event fired when a change in the microphone capture state occurred.
///
///**NOTE for iOS**: available only on iOS 15.0+.
///
///**NOTE for MacOS**: available only on MacOS 12.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///{@endtemplate}
@ -1026,25 +1026,25 @@ class PlatformWebViewCreationParams<T> {
MediaCaptureState? newState,
)? onMicrophoneCaptureStateChanged;
///{@template flutter_inappwebview.WebView.onContentSizeChanged}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.onContentSizeChanged}
///Event fired when the content size of the `WebView` changes.
///
///[oldContentSize] represents the old content size value.
///
///[newContentSize] represents the new content size value.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///{@endtemplate}
final void Function(T controller, Size oldContentSize, Size newContentSize)?
onContentSizeChanged;
///{@template flutter_inappwebview.WebView.initialUrlRequest}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.initialUrlRequest}
///Initial url request that will be loaded.
///
///**NOTE for Android**: when loading an URL Request using "POST" method, headers are ignored.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -1052,10 +1052,10 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final URLRequest? initialUrlRequest;
///{@template flutter_inappwebview.WebView.initialFile}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.initialFile}
///Initial asset file that will be loaded. See [InAppWebViewController.loadFile] for explanation.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -1063,10 +1063,10 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final String? initialFile;
///{@template flutter_inappwebview.WebView.initialData}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.initialData}
///Initial [InAppWebViewInitialData] that will be loaded.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -1078,10 +1078,10 @@ class PlatformWebViewCreationParams<T> {
@Deprecated('Use initialSettings instead')
final InAppWebViewGroupOptions? initialOptions;
///{@template flutter_inappwebview.WebView.initialSettings}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.initialSettings}
///Initial settings that will be used.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -1089,53 +1089,53 @@ class PlatformWebViewCreationParams<T> {
///{@endtemplate}
final InAppWebViewSettings? initialSettings;
///{@template flutter_inappwebview.WebView.contextMenu}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.contextMenu}
///Context menu which contains custom menu items to be shown when [ContextMenu] is presented.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///{@endtemplate}
final ContextMenu? contextMenu;
///{@template flutter_inappwebview.WebView.initialUserScripts}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.initialUserScripts}
///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.
///
///**NOTE for iOS**: this property will be ignored if the [WebView.windowId] has been set.
///**NOTE for iOS**: this property will be ignored if the [PlatformWebViewCreationParams.windowId] has been set.
///There isn't any way to add/remove user scripts specific to iOS window WebViews.
///This is a limitation of the native iOS WebKit APIs.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
final UnmodifiableListView<UserScript>? initialUserScripts;
///{@template flutter_inappwebview.WebView.pullToRefreshController}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.pullToRefreshController}
///Represents the pull-to-refresh feature controller.
///
///**NOTE for Android**: to be able to use the "pull-to-refresh" feature, [InAppWebViewSettings.useHybridComposition] must be `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///{@endtemplate}
final PlatformPullToRefreshController? pullToRefreshController;
///{@template flutter_inappwebview.WebView.findInteractionController}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewCreationParams.findInteractionController}
///Represents the find interaction feature controller.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
final PlatformFindInteractionController? findInteractionController;
///{@macro flutter_inappwebview.WebView}
///{@macro flutter_inappwebview_platform_interface.PlatformWebViewCreationParams}
const PlatformWebViewCreationParams(
{this.controllerFromPlatform,
this.windowId,

View File

@ -7,6 +7,7 @@ import 'in_app_webview/platform_inappwebview_controller.dart';
import 'types/main.dart';
import 'web_uri.dart';
import 'inappwebview_platform.dart';
import 'in_app_webview/platform_headless_in_app_webview.dart';
/// Object specifying creation parameters for creating a [PlatformCookieManager].
///
@ -18,6 +19,7 @@ class PlatformCookieManagerCreationParams {
const PlatformCookieManagerCreationParams();
}
///{@template flutter_inappwebview_platform_interface.PlatformCookieManager}
///Class that implements a singleton object (shared instance) which manages the cookies used by WebView instances.
///On Android, it is implemented using [CookieManager](https://developer.android.com/reference/android/webkit/CookieManager).
///On iOS, it is implemented using [WKHTTPCookieStore](https://developer.apple.com/documentation/webkit/wkhttpcookiestore).
@ -26,11 +28,12 @@ class PlatformCookieManagerCreationParams {
///has been implemented using JavaScript because there is no other way to work with them on iOS below 11.0.
///See https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies for JavaScript restrictions.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///- Web
///{@endtemplate}
abstract class PlatformCookieManager extends PlatformInterface {
/// Creates a new [PlatformCookieManager]
factory PlatformCookieManager(PlatformCookieManagerCreationParams params) {
@ -60,6 +63,7 @@ abstract class PlatformCookieManager extends PlatformInterface {
/// The parameters used to initialize the [PlatformCookieManager].
final PlatformCookieManagerCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformCookieManager.setCookie}
///Sets a cookie for the given [url]. Any existing cookie with the same [host], [path] and [name] will be replaced with the new cookie.
///The cookie being set will be ignored if it is expired.
///
@ -71,18 +75,19 @@ abstract class PlatformCookieManager extends PlatformInterface {
///The return value indicates whether the cookie was set successfully.
///Note that it will return always `true` for Web platform, iOS below 11.0 and MacOS below 10.13.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///**NOTE for iOS below 11.0 and MacOS below 10.13**: If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to set the cookie (session-only cookie won't work! In that case, you should set also [expiresDate] or [maxAge]).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to set the cookie (session-only cookie won't work! In that case, you should set also [expiresDate] or [maxAge]).
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - CookieManager.setCookie](https://developer.android.com/reference/android/webkit/CookieManager#setCookie(java.lang.String,%20java.lang.String,%20android.webkit.ValueCallback%3Cjava.lang.Boolean%3E)))
///- iOS ([Official API - WKHTTPCookieStore.setCookie](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882007-setcookie))
///- MacOS ([Official API - WKHTTPCookieStore.setCookie](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882007-setcookie))
///- Web
///{@endtemplate}
Future<bool> setCookie(
{required WebUri url,
required String name,
@ -101,6 +106,7 @@ abstract class PlatformCookieManager extends PlatformInterface {
'setCookie is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformCookieManager.getCookies}
///Gets all the cookies for the given [url].
///
///[webViewController] is used for getting the cookies (also session-only cookies) using JavaScript (cookies with `isHttpOnly` enabled cannot be found, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
@ -108,18 +114,19 @@ abstract class PlatformCookieManager extends PlatformInterface {
///In this case the [url] parameter is ignored.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: All the cookies returned this way will have all the properties to `null` except for [Cookie.name] and [Cookie.value].
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to get the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be found!).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to get the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be found!).
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - CookieManager.getCookie](https://developer.android.com/reference/android/webkit/CookieManager#getCookie(java.lang.String)))
///- iOS ([Official API - WKHTTPCookieStore.getAllCookies](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882005-getallcookies))
///- MacOS ([Official API - WKHTTPCookieStore.getAllCookies](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882005-getallcookies))
///- Web
///{@endtemplate}
Future<List<Cookie>> getCookies(
{required WebUri url,
@Deprecated("Use webViewController instead")
@ -129,6 +136,7 @@ abstract class PlatformCookieManager extends PlatformInterface {
'getCookies is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformCookieManager.getCookie}
///Gets a cookie by its [name] for the given [url].
///
///[webViewController] is used for getting the cookie (also session-only cookie) using JavaScript (cookie with `isHttpOnly` enabled cannot be found, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
@ -136,18 +144,19 @@ abstract class PlatformCookieManager extends PlatformInterface {
///In this case the [url] parameter is ignored.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: All the cookies returned this way will have all the properties to `null` except for [Cookie.name] and [Cookie.value].
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to get the cookie (session-only cookie and cookie with `isHttpOnly` enabled won't be found!).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to get the cookie (session-only cookie and cookie with `isHttpOnly` enabled won't be found!).
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///- Web
///{@endtemplate}
Future<Cookie?> getCookie(
{required WebUri url,
required String name,
@ -158,6 +167,7 @@ abstract class PlatformCookieManager extends PlatformInterface {
'getCookie is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformCookieManager.deleteCookie}
///Removes a cookie by its [name] for the given [url], [domain] and [path].
///
///The default value of [path] is `"/"`.
@ -166,18 +176,19 @@ abstract class PlatformCookieManager extends PlatformInterface {
///from the current context of the `WebView` managed by that controller when you need to target iOS below 11, MacOS below 10.13 and Web platform. JavaScript must be enabled in order to work.
///In this case the [url] parameter is ignored.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///**NOTE for iOS below 11.0 and MacOS below 10.13**: If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to delete the cookie (session-only cookie and cookie with `isHttpOnly` enabled won't be deleted!).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to delete the cookie (session-only cookie and cookie with `isHttpOnly` enabled won't be deleted!).
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - WKHTTPCookieStore.delete](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882009-delete)
///- MacOS ([Official API - WKHTTPCookieStore.delete](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882009-delete)
///- Web
///{@endtemplate}
Future<void> deleteCookie(
{required WebUri url,
required String name,
@ -190,6 +201,7 @@ abstract class PlatformCookieManager extends PlatformInterface {
'deleteCookie is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformCookieManager.deleteCookies}
///Removes all cookies for the given [url], [domain] and [path].
///
///The default value of [path] is `"/"`.
@ -198,18 +210,19 @@ abstract class PlatformCookieManager extends PlatformInterface {
///from the current context of the `WebView` managed by that controller when you need to target iOS below 11, MacOS below 10.13 and Web platform. JavaScript must be enabled in order to work.
///In this case the [url] parameter is ignored.
///
///**NOTE for iOS below 11.0 and MacOS below 10.13**: If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///**NOTE for iOS below 11.0 and MacOS below 10.13**: If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to delete the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be deleted!).
///
///**NOTE for Web**: this method will have effect only if the iframe has the same origin.
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [HeadlessInAppWebView]
///If [webViewController] is `null` or JavaScript is disabled for it, it will try to use a [PlatformHeadlessInAppWebView]
///to delete the cookies (session-only cookies and cookies with `isHttpOnly` enabled won't be deleted!).
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///- Web
///{@endtemplate}
Future<void> deleteCookies(
{required WebUri url,
String path = "/",
@ -221,30 +234,34 @@ abstract class PlatformCookieManager extends PlatformInterface {
'deleteCookies is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformCookieManager.deleteAllCookies}
///Removes all cookies.
///
///**NOTE for iOS**: available from iOS 11.0+.
///
///**NOTE for MacOS**: available from iOS 10.13+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - CookieManager.removeAllCookies](https://developer.android.com/reference/android/webkit/CookieManager#removeAllCookies(android.webkit.ValueCallback%3Cjava.lang.Boolean%3E)))
///- iOS ([Official API - WKWebsiteDataStore.removeData](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532938-removedata))
///- MacOS ([Official API - WKWebsiteDataStore.removeData](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532938-removedata))
///{@endtemplate}
Future<void> deleteAllCookies() {
throw UnimplementedError(
'deleteAllCookies is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformCookieManager.getAllCookies}
///Fetches all stored cookies.
///
///**NOTE for iOS**: available on iOS 11.0+.
///
///**NOTE for MacOS**: available from iOS 10.13+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKHTTPCookieStore.getAllCookies](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882005-getallcookies))
///- MacOS ([Official API - WKHTTPCookieStore.getAllCookies](https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882005-getallcookies))
///{@endtemplate}
Future<List<Cookie>> getAllCookies() {
throw UnimplementedError(
'getAllCookies is not implemented on the current platform');

View File

@ -15,16 +15,18 @@ class PlatformHttpAuthCredentialDatabaseCreationParams {
const PlatformHttpAuthCredentialDatabaseCreationParams();
}
///{@template flutter_inappwebview_platform_interface.PlatformHttpAuthCredentialDatabase}
///Class that implements a singleton object (shared instance) which manages the shared HTTP auth credentials cache.
///On iOS and MacOS, this class uses the [URLCredentialStorage](https://developer.apple.com/documentation/foundation/urlcredentialstorage) class.
///On Android, this class has a custom implementation using `android.database.sqlite.SQLiteDatabase` because
///[WebViewDatabase](https://developer.android.com/reference/android/webkit/WebViewDatabase)
///doesn't offer the same functionalities as iOS `URLCredentialStorage`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface {
/// Creates a new [PlatformHttpAuthCredentialDatabase]
factory PlatformHttpAuthCredentialDatabase(
@ -57,37 +59,43 @@ abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface {
/// The parameters used to initialize the [PlatformHttpAuthCredentialDatabase].
final PlatformHttpAuthCredentialDatabaseCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformHttpAuthCredentialDatabase.getAllAuthCredentials}
///Gets a map list of all HTTP auth credentials saved.
///Each map contains the key `protectionSpace` of type [URLProtectionSpace]
///and the key `credentials` of type List<[URLCredential]> that contains all the HTTP auth credentials saved for that `protectionSpace`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - URLCredentialStorage.allCredentials](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1413859-allcredentials))
///- MacOS ([Official API - URLCredentialStorage.allCredentials](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1413859-allcredentials))
///{@endtemplate}
Future<List<URLProtectionSpaceHttpAuthCredentials>> getAllAuthCredentials() {
throw UnimplementedError(
'getAllAuthCredentials is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformHttpAuthCredentialDatabase.getHttpAuthCredentials}
///Gets all the HTTP auth credentials saved for that [protectionSpace].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<List<URLCredential>> getHttpAuthCredentials(
{required URLProtectionSpace protectionSpace}) {
throw UnimplementedError(
'getHttpAuthCredentials is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformHttpAuthCredentialDatabase.setHttpAuthCredential}
///Saves an HTTP auth [credential] for that [protectionSpace].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - URLCredentialStorage.set](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set))
///- MacOS ([Official API - URLCredentialStorage.set](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set))
///{@endtemplate}
Future<void> setHttpAuthCredential(
{required URLProtectionSpace protectionSpace,
required URLCredential credential}) {
@ -95,12 +103,14 @@ abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface {
'setHttpAuthCredential is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformHttpAuthCredentialDatabase.removeHttpAuthCredential}
///Removes an HTTP auth [credential] for that [protectionSpace].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS ([Official API - URLCredentialStorage.remove](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1408664-remove))
///- MacOS ([Official API - URLCredentialStorage.remove](https://developer.apple.com/documentation/foundation/urlcredentialstorage/1408664-remove))
///{@endtemplate}
Future<void> removeHttpAuthCredential(
{required URLProtectionSpace protectionSpace,
required URLCredential credential}) {
@ -108,24 +118,28 @@ abstract class PlatformHttpAuthCredentialDatabase extends PlatformInterface {
'removeHttpAuthCredential is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformHttpAuthCredentialDatabase.removeHttpAuthCredentials}
///Removes all the HTTP auth credentials saved for that [protectionSpace].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> removeHttpAuthCredentials(
{required URLProtectionSpace protectionSpace}) {
throw UnimplementedError(
'removeHttpAuthCredentials is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformHttpAuthCredentialDatabase.clearAllAuthCredentials}
///Removes all the HTTP auth credentials saved in the database.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
Future<void> clearAllAuthCredentials() {
throw UnimplementedError(
'clearAllAuthCredentials is not implemented on the current platform');

View File

@ -31,14 +31,16 @@ class PlatformInAppLocalhostServerCreationParams {
final bool shared;
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer}
///This class allows you to create a simple server on `http://localhost:[port]/`
///in order to be able to load your assets file on a local server.
///The default `port` value is `8080`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
abstract class PlatformInAppLocalhostServer extends PlatformInterface {
/// Creates a new [PlatformInAppLocalhostServer]
factory PlatformInAppLocalhostServer(
@ -96,6 +98,7 @@ abstract class PlatformInAppLocalhostServer extends PlatformInterface {
///{@endtemplate}
bool get shared => params.shared;
///{@template flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.start}
///Starts the server on `http://localhost:[port]/`.
///
///**NOTE for iOS**: For the iOS Platform, you need to add the `NSAllowsLocalNetworking` key with `true` in the `Info.plist` file
@ -108,18 +111,23 @@ abstract class PlatformInAppLocalhostServer extends PlatformInterface {
///</dict>
///```
///The `NSAllowsLocalNetworking` key is available since **iOS 10**.
///{@endtemplate}
Future<void> start() {
throw UnimplementedError(
'start is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.close}
///Closes the server.
///{@endtemplate}
Future<void> close() {
throw UnimplementedError(
'close is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.isRunning}
///Indicates if the server is running or not.
///{@endtemplate}
bool isRunning() {
throw UnimplementedError(
'isRunning is not implemented on the current platform');

View File

@ -18,6 +18,7 @@ class PlatformProcessGlobalConfigCreationParams {
const PlatformProcessGlobalConfigCreationParams();
}
///{@template flutter_inappwebview_platform_interface.PlatformProcessGlobalConfig}
///Process Global Configuration for `WebView`.
///WebView has some process-global configuration parameters
///that cannot be changed once WebView has been loaded.
@ -38,8 +39,9 @@ class PlatformProcessGlobalConfigCreationParams {
///The configuration should be set up as early as possible during application startup,
///to ensure that it happens before any other thread can call a method that loads `WebView`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProcessGlobalConfig](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig))
///{@endtemplate}
abstract class PlatformProcessGlobalConfig extends PlatformInterface {
/// Creates a new [PlatformProcessGlobalConfig]
factory PlatformProcessGlobalConfig(
@ -72,13 +74,15 @@ abstract class PlatformProcessGlobalConfig extends PlatformInterface {
/// The parameters used to initialize the [PlatformProcessGlobalConfig].
final PlatformProcessGlobalConfigCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformProcessGlobalConfig.apply}
///Applies the configuration to be used by `WebView` on loading.
///This method can only be called once.
///
///Calling this method will not cause `WebView` to be loaded and will not block the calling thread.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProcessGlobalConfig.apply](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#apply(androidx.webkit.ProcessGlobalConfig)))
///{@endtemplate}
Future<void> apply({required ProcessGlobalConfigSettings settings}) {
throw UnimplementedError(
'apply is not implemented on the current platform');
@ -87,7 +91,7 @@ abstract class PlatformProcessGlobalConfig extends PlatformInterface {
///Class that represents the settings used to configure the [PlatformProcessGlobalConfig].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
@ExchangeableObject(copyMethod: true)
class ProcessGlobalConfigSettings_ {
@ -141,7 +145,7 @@ class ProcessGlobalConfigSettings_ {
///Class that represents the settings used to configure the [ProcessGlobalConfigSettings.directoryBasePaths].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyConfig](https://developer.android.com/reference/androidx/webkit/ProxyConfig))
@ExchangeableObject()
class ProcessGlobalConfigDirectoryBasePaths_ {

View File

@ -8,7 +8,7 @@ part of 'platform_process_global_config.dart';
///Class that represents the settings used to configure the [PlatformProcessGlobalConfig].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
class ProcessGlobalConfigSettings {
///The directory name suffix to be used for the current process.
@ -97,7 +97,7 @@ class ProcessGlobalConfigSettings {
///Class that represents the settings used to configure the [ProcessGlobalConfigSettings.directoryBasePaths].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyConfig](https://developer.android.com/reference/androidx/webkit/ProxyConfig))
class ProcessGlobalConfigDirectoryBasePaths {
///The absolute base path for the WebView cache directory.

View File

@ -18,6 +18,7 @@ class PlatformProxyControllerCreationParams {
const PlatformProxyControllerCreationParams();
}
///{@template flutter_inappwebview_platform_interface.PlatformProxyController}
///Manages setting and clearing a process-specific override for the Android system-wide proxy settings that govern network requests made by `WebView`.
///
///`WebView` may make network requests in order to fetch content that is not otherwise read from the file system or provided directly by application code.
@ -26,8 +27,9 @@ class PlatformProxyControllerCreationParams {
///In the rare case that it is necessary for an application to explicitly specify its proxy configuration,
///this API may be used to explicitly specify the proxy rules that govern WebView initiated network requests.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyController](https://developer.android.com/reference/androidx/webkit/ProxyController))
///{@endtemplate}
abstract class PlatformProxyController extends PlatformInterface {
/// Creates a new [PlatformProxyController]
factory PlatformProxyController(
@ -58,23 +60,27 @@ abstract class PlatformProxyController extends PlatformInterface {
/// The parameters used to initialize the [PlatformProxyController].
final PlatformProxyControllerCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformProxyController.setProxyOverride}
///Sets [ProxySettings] which will be used by all `WebView`s in the app.
///URLs that match patterns in the bypass list will not be directed to any proxy.
///Instead, the request will be made directly to the origin specified by the URL.
///Network connections are not guaranteed to immediately use the new proxy setting; wait for the method to return before loading a page.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyController.setProxyOverride](https://developer.android.com/reference/androidx/webkit/ProxyController#setProxyOverride(androidx.webkit.ProxyConfig,%20java.util.concurrent.Executor,%20java.lang.Runnable)))
///{@endtemplate}
Future<void> setProxyOverride({required ProxySettings settings}) {
throw UnimplementedError(
'setProxyOverride is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformProxyController.clearProxyOverride}
///Clears the proxy settings.
///Network connections are not guaranteed to immediately use the new proxy setting; wait for the method to return before loading a page.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyController.clearProxyOverride](https://developer.android.com/reference/androidx/webkit/ProxyController#clearProxyOverride(java.util.concurrent.Executor,%20java.lang.Runnable)))
///{@endtemplate}
Future<void> clearProxyOverride() {
throw UnimplementedError(
'clearProxyOverride is not implemented on the current platform');
@ -83,7 +89,7 @@ abstract class PlatformProxyController extends PlatformInterface {
///Class that represents the settings used to configure the [PlatformProxyController].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyConfig](https://developer.android.com/reference/androidx/webkit/ProxyConfig))
@ExchangeableObject(copyMethod: true)
class ProxySettings_ {

View File

@ -8,7 +8,7 @@ part of 'platform_proxy_controller.dart';
///Class that represents the settings used to configure the [PlatformProxyController].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ProxyConfig](https://developer.android.com/reference/androidx/webkit/ProxyConfig))
class ProxySettings {
///List of bypass rules.

View File

@ -14,12 +14,14 @@ class PlatformServiceWorkerControllerCreationParams {
const PlatformServiceWorkerControllerCreationParams();
}
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController}
///Class that manages Service Workers used by `WebView`.
///
///**NOTE**: available on Android 24+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ServiceWorkerControllerCompat](https://developer.android.com/reference/androidx/webkit/ServiceWorkerControllerCompat))
///{@endtemplate}
abstract class PlatformServiceWorkerController extends PlatformInterface {
/// Creates a new [PlatformServiceWorkerController]
factory PlatformServiceWorkerController(
@ -68,114 +70,138 @@ abstract class PlatformServiceWorkerController extends PlatformInterface {
/// The parameters used to initialize the [PlatformServiceWorkerController].
final PlatformServiceWorkerControllerCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.serviceWorkerClient}
///Service Worker client.
///{@endtemplate}
ServiceWorkerClient? get serviceWorkerClient;
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.setServiceWorkerClient}
///Sets the client to capture service worker related callbacks.
///A [ServiceWorkerClient] should be set before any service workers are active, e.g. a safe place is before any WebView instances are created or pages loaded.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ServiceWorkerControllerCompat.setServiceWorkerClient](https://developer.android.com/reference/androidx/webkit/ServiceWorkerControllerCompat#setServiceWorkerClient(androidx.webkit.ServiceWorkerClientCompat)))
///{@endtemplate}
Future<void> setServiceWorkerClient(ServiceWorkerClient? value) {
throw UnimplementedError(
'setServiceWorkerClient is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.getAllowContentAccess}
///Gets whether Service Workers support content URL access.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_CONTENT_ACCESS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getAllowContentAccess()
///{@endtemplate}
Future<bool> getAllowContentAccess() {
throw UnimplementedError(
'getAllowContentAccess is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.getAllowFileAccess}
///Gets whether Service Workers support file access.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_FILE_ACCESS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getAllowFileAccess()
///{@endtemplate}
Future<bool> getAllowFileAccess() {
throw UnimplementedError(
'getAllowFileAccess is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.getBlockNetworkLoads}
///Gets whether Service Workers are prohibited from loading any resources from the network.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getBlockNetworkLoads()
///{@endtemplate}
Future<bool> getBlockNetworkLoads() {
throw UnimplementedError(
'getBlockNetworkLoads is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.getCacheMode}
///Gets the current setting for overriding the cache mode.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_CACHE_MODE].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#getCacheMode()
///{@endtemplate}
Future<CacheMode?> getCacheMode() {
throw UnimplementedError(
'getCacheMode is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.setAllowContentAccess}
///Enables or disables content URL access from Service Workers.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_CONTENT_ACCESS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setAllowContentAccess(boolean)
///{@endtemplate}
Future<void> setAllowContentAccess(bool allow) {
throw UnimplementedError(
'setAllowContentAccess is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.setAllowFileAccess}
///Enables or disables file access within Service Workers.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_FILE_ACCESS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setAllowFileAccess(boolean)
///{@endtemplate}
Future<void> setAllowFileAccess(bool allow) {
throw UnimplementedError(
'setAllowFileAccess is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.setBlockNetworkLoads}
///Sets whether Service Workers should not load resources from the network.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setBlockNetworkLoads(boolean)
///{@endtemplate}
Future<void> setBlockNetworkLoads(bool flag) {
throw UnimplementedError(
'setBlockNetworkLoads is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformServiceWorkerController.setCacheMode}
///Overrides the way the cache is used.
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_CACHE_MODE].
///
///**NOTE**: available on Android 24+.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setCacheMode(int)
///{@endtemplate}
Future<void> setCacheMode(CacheMode mode) {
throw UnimplementedError(
'setCacheMode is not implemented on the current platform');
}
}
///{@template flutter_inappwebview_platform_interface.ServiceWorkerClient}
///Class used by clients to capture Service Worker related callbacks.
///
///**NOTE**: available on Android 24+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - ServiceWorkerClientCompat](https://developer.android.com/reference/androidx/webkit/ServiceWorkerClientCompat))
///{@endtemplate}
class ServiceWorkerClient {
///{@template flutter_inappwebview_platform_interface.ServiceWorkerClient.shouldInterceptRequest}
///Notify the host application of a resource request and allow the application to return the data.
///If the return value is `null`, the Service Worker will continue to load the resource as usual.
///Otherwise, the return response and data will be used.
@ -186,6 +212,7 @@ class ServiceWorkerClient {
///[request] represents an object containing the details of the request.
///
///**NOTE**: available on Android 24+.
///{@endtemplate}
final Future<WebResourceResponse?> Function(WebResourceRequest request)?
shouldInterceptRequest;

View File

@ -18,6 +18,7 @@ class PlatformTracingControllerCreationParams {
const PlatformTracingControllerCreationParams();
}
///{@template flutter_inappwebview_platform_interface.PlatformTracingController}
///Manages tracing of `WebView`s.
///In particular provides functionality for the app to enable/disable tracing of parts of code and to collect tracing data.
///This is useful for profiling performance issues, debugging and memory usage analysis in production and real life scenarios.
@ -25,8 +26,9 @@ class PlatformTracingControllerCreationParams {
///The resulting trace data is sent back as a byte sequence in json format.
///This file can be loaded in "chrome://tracing" for further analysis.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController](https://developer.android.com/reference/androidx/webkit/TracingController))
///{@endtemplate}
abstract class PlatformTracingController extends PlatformInterface {
/// Creates a new [PlatformTracingController]
factory PlatformTracingController(
@ -57,19 +59,22 @@ abstract class PlatformTracingController extends PlatformInterface {
/// The parameters used to initialize the [PlatformTracingController].
final PlatformTracingControllerCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformTracingController.start}
///Starts tracing all `WebView`s.
///Depending on the trace mode in trace config specifies how the trace events are recorded.
///For tracing modes [TracingMode.RECORD_UNTIL_FULL] and [TracingMode.RECORD_CONTINUOUSLY]
///the events are recorded using an internal buffer and flushed to the outputStream
///when [stop] is called.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController.start](https://developer.android.com/reference/android/webkit/TracingController#start(android.webkit.TracingConfig)))
///{@endtemplate}
Future<void> start({required TracingSettings settings}) {
throw UnimplementedError(
'start is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformTracingController.stop}
///Stops tracing and flushes tracing data to the specified output stream.
///The data is sent to the specified output stream in json format typically in
///chunks.
@ -77,16 +82,19 @@ abstract class PlatformTracingController extends PlatformInterface {
///Returns `false` if the WebView framework was not tracing at the time of the call,
///`true` otherwise.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController.stop](https://developer.android.com/reference/android/webkit/TracingController#stop(java.io.OutputStream,%20java.util.concurrent.Executor)))
///{@endtemplate}
Future<bool> stop({String? filePath}) {
throw UnimplementedError('stop is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformTracingController.isTracing}
///Returns whether the WebView framework is tracing.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingController.isTracing](https://developer.android.com/reference/android/webkit/TracingController#isTracing()))
///{@endtemplate}
Future<bool> isTracing() {
throw UnimplementedError(
'isTracing is not implemented on the current platform');
@ -122,7 +130,7 @@ List<dynamic> _serializeCategories(List<dynamic> categories) {
///Class that represents the settings used to configure the [PlatformTracingController].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingConfig](https://developer.android.com/reference/androidx/webkit/TracingConfig))
@ExchangeableObject(copyMethod: true)
class TracingSettings_ {

View File

@ -8,7 +8,7 @@ part of 'platform_tracing_controller.dart';
///Class that represents the settings used to configure the [PlatformTracingController].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - TracingConfig](https://developer.android.com/reference/androidx/webkit/TracingConfig))
class TracingSettings {
///Adds predefined [TracingCategory] and/or custom [String] sets of categories to be included in the trace output.

View File

@ -7,7 +7,7 @@ import 'types/web_resource_response.dart';
part 'platform_webview_asset_loader.g.dart';
///Helper class to load local files including application's static assets and resources using http(s):// URLs inside a [WebView] class.
///Helper class to load local files including application's static assets and resources using http(s):// URLs inside a `WebView` class.
///Loading local files using web-like URLs instead of `file://` is desirable as it is compatible with the Same-Origin policy.
///
///For more context about application's assets and resources and how to normally access them please refer to
@ -17,7 +17,7 @@ part 'platform_webview_asset_loader.g.dart';
///This means that local files should only be hosted on domains your organization owns
///(at paths reserved for this purpose) or the default domain reserved for this: `appassets.androidplatform.net`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
@ExchangeableObject(copyMethod: true)
class WebViewAssetLoader_ {
@ -41,6 +41,7 @@ class WebViewAssetLoader_ {
WebViewAssetLoader_({this.domain, this.httpAllowed, this.pathHandlers});
}
///[PlatformPathHandler] interface.
abstract class IPathHandler {
String get path {
throw UnimplementedError('path is not implemented on the current platform');
@ -70,9 +71,11 @@ class PlatformPathHandlerCreationParams {
final String path;
}
///{@template flutter_inappwebview_platform_interface.PlatformPathHandler}
///A handler that produces responses for a registered path.
///
///Implement this interface to handle other use-cases according to your app's needs.
///{@endtemplate}
abstract class PlatformPathHandler extends PlatformInterface
implements IPathHandler {
/// Creates a new [PlatformWebViewAssetLoader]
@ -124,7 +127,9 @@ abstract class PlatformPathHandler extends PlatformInterface
}
}
///Interface path handler events.
abstract class PlatformPathHandlerEvents {
///{@template flutter_inappwebview_platform_interface.PlatformPathHandler.handle}
///Handles the requested URL by returning the appropriate response.
///
///Returning a `null` value means that the handler decided not to handle this path.
@ -133,6 +138,7 @@ abstract class PlatformPathHandlerEvents {
///However, if the handler wants to save unnecessary processing either by another handler or by falling back to network,
///in cases like a file cannot be found, it may return a `WebResourceResponse(data: null)`
///which is received as an HTTP response with status code `404` and no body.
///{@endtemplate}
Future<WebResourceResponse?> handle(String path) {
throw UnimplementedError(
'handle is not implemented on the current platform');
@ -160,6 +166,7 @@ class PlatformAssetsPathHandlerCreationParams
}
}
///{@template flutter_inappwebview_platform_interface.PlatformAssetsPathHandler}
///Handler class to open a file from assets directory in the application APK.
///
///Opens the requested file from the application's assets directory.
@ -173,6 +180,7 @@ class PlatformAssetsPathHandlerCreationParams
///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-).
///Developers should ensure that asset files are named using standard file extensions.
///If the file does not have a recognised extension, `text/plain` will be used by default.
///{@endtemplate}
abstract class PlatformAssetsPathHandler extends PlatformPathHandler {
/// Creates a new [PlatformAssetsPathHandler]
factory PlatformAssetsPathHandler(
@ -228,6 +236,7 @@ class PlatformResourcesPathHandlerCreationParams
}
}
///{@template flutter_inappwebview_platform_interface.PlatformResourcesPathHandler}
///Handler class to open a file from resources directory in the application APK.
///
///Opens the requested file from application's resources directory.
@ -241,6 +250,7 @@ class PlatformResourcesPathHandlerCreationParams
///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-).
///Developers should ensure that asset files are named using standard file extensions.
///If the file does not have a recognised extension, `text/plain` will be used by default.
///{@endtemplate}
abstract class PlatformResourcesPathHandler extends PlatformPathHandler {
/// Creates a new [PlatformResourcesPathHandler]
factory PlatformResourcesPathHandler(
@ -302,6 +312,7 @@ class PlatformInternalStoragePathHandlerCreationParams
final String directory;
}
///{@template flutter_inappwebview_platform_interface.PlatformInternalStoragePathHandler}
///Handler class to open files from application internal storage.
///For more information about android storage please refer to
///[Android Developers Docs: Data and file storage overview](https://developer.android.com/guide/topics/data/data-storage).
@ -320,6 +331,7 @@ class PlatformInternalStoragePathHandlerCreationParams
///[guessContentTypeFromName](https://developer.android.com/reference/java/net/URLConnection.html#guessContentTypeFromName-java.lang.String-).
///Developers should ensure that asset files are named using standard file extensions.
///If the file does not have a recognised extension, `text/plain` will be used by default.
///{@endtemplate}
abstract class PlatformInternalStoragePathHandler extends PlatformPathHandler {
/// Creates a new [PlatformResourcesPathHandler]
factory PlatformInternalStoragePathHandler(

View File

@ -6,7 +6,7 @@ part of 'platform_webview_asset_loader.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Helper class to load local files including application's static assets and resources using http(s):// URLs inside a [WebView] class.
///Helper class to load local files including application's static assets and resources using http(s):// URLs inside a `WebView` class.
///Loading local files using web-like URLs instead of `file://` is desirable as it is compatible with the Same-Origin policy.
///
///For more context about application's assets and resources and how to normally access them please refer to
@ -16,7 +16,7 @@ part of 'platform_webview_asset_loader.dart';
///This means that local files should only be hosted on domains your organization owns
///(at paths reserved for this purpose) or the default domain reserved for this: `appassets.androidplatform.net`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
class WebViewAssetLoader {
///An unused domain reserved for Android applications to intercept requests for app assets.

View File

@ -16,10 +16,12 @@ class PlatformWebViewFeatureCreationParams {
const PlatformWebViewFeatureCreationParams();
}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewFeature}
///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///{@endtemplate}
abstract class PlatformWebViewFeature extends PlatformInterface {
/// Creates a new [PlatformWebViewFeature]
factory PlatformWebViewFeature(PlatformWebViewFeatureCreationParams params) {
@ -64,6 +66,7 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
/// The parameters used to initialize the [PlatformWebViewFeature].
final PlatformWebViewFeatureCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformWebViewFeature.isFeatureSupported}
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`.
@ -77,11 +80,13 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
///Furthermore, if this method returns `false` for a particular feature, any callback guarded by that feature will not be invoked.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)
///{@endtemplate}
Future<bool> isFeatureSupported(WebViewFeature feature) {
throw UnimplementedError(
'isFeatureSupported is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformWebViewFeature.isStartupFeatureSupported}
///Return whether a startup feature is supported at run-time.
///On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a startup feature is supported,
@ -97,16 +102,14 @@ abstract class PlatformWebViewFeature extends PlatformInterface {
///any callback guarded by that feature will not be invoked.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)
///{@endtemplate}
Future<bool> isStartupFeatureSupported(WebViewFeature startupFeature) {
throw UnimplementedError(
'isStartupFeatureSupported is not implemented on the current platform');
}
}
///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device.
///
///**Supported Platforms/Implementations**:
///- Android native WebView
///{@macro flutter_inappwebview_platform_interface.PlatformWebViewFeature}
@ExchangeableEnum()
class WebViewFeature_ {
// ignore: unused_field
@ -330,37 +333,11 @@ class WebViewFeature_ {
const WebViewFeature_._internal(
"STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS");
///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device,
///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`.
///
///**Note**: This method is different from [isStartupFeatureSupported] and this
///method only accepts certain features.
///Please verify that the correct feature checking method is used for a particular feature.
///
///**Note**: If this method returns `false`, it is not safe to invoke the methods
///requiring the desired feature.
///Furthermore, if this method returns `false` for a particular feature, any callback guarded by that feature will not be invoked.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)
///{@macro flutter_inappwebview_platform_interface.PlatformWebViewFeature.isFeatureSupported}
static Future<bool> isFeatureSupported(WebViewFeature feature) =>
PlatformWebViewFeature.static().isFeatureSupported(feature);
///Return whether a startup feature is supported at run-time.
///On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher,
///this will check whether a startup feature is supported,
///depending on the combination of the desired feature,
///the Android version of device, and the WebView APK on the device.
///If running on a device with a lower API level, this will always return `false`.
///
///**Note**: This method is different from [isFeatureSupported] and this method only accepts startup features.
///Please verify that the correct feature checking method is used for a particular feature.
///
///**Note**: If this method returns `false`, it is not safe to invoke the methods requiring the desired feature.
///Furthermore, if this method returns `false` for a particular feature,
///any callback guarded by that feature will not be invoked.
///
///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)
///{@macro flutter_inappwebview_platform_interface.PlatformWebViewFeature.isStartupFeatureSupported}
static Future<bool> isStartupFeatureSupported(
WebViewFeature startupFeature) =>
PlatformWebViewFeature.static().isStartupFeatureSupported(startupFeature);

View File

@ -8,7 +8,7 @@ part of 'platform_webview_feature.dart';
///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
class WebViewFeature {
final String _value;

View File

@ -26,12 +26,14 @@ class PlatformPrintJobControllerCreationParams {
final PrintJobCompletionHandler? onComplete;
}
///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController}
///Class representing a print job eventually returned by [PlatformInAppWebViewController.printCurrentPage].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
abstract class PlatformPrintJobController extends PlatformInterface
implements Disposable {
/// Creates a new [PlatformPrintJobController]
@ -70,32 +72,37 @@ abstract class PlatformPrintJobController extends PlatformInterface
///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController.onComplete}
///A completion handler used to handle the conclusion of the print job (for instance, to reset state) and to handle any errors encountered in printing.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - UIPrintInteractionController.CompletionHandler](https://developer.apple.com/documentation/uikit/uiprintinteractioncontroller/completionhandler))
///- MacOS ([Official API - NSPrintOperation.runModal](https://developer.apple.com/documentation/appkit/nsprintoperation/1532065-runmodal))
///{@endtemplate}
PrintJobCompletionHandler? get onComplete => params.onComplete;
///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController.cancel}
///Cancels this print job.
///You can request cancellation of a queued, started, blocked, or failed print job.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - PrintJob.cancel](https://developer.android.com/reference/android/print/PrintJob#cancel()))
///{@endtemplate}
Future<void> cancel() {
throw UnimplementedError(
'cancel is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController.restart}
///Restarts this print job.
///You can request restart of a failed print job.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - PrintJob.restart](https://developer.android.com/reference/android/print/PrintJob#restart()))
///{@endtemplate}
Future<void> restart() {
throw UnimplementedError(
'restart is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController.dismiss}
///Dismisses the printing-options sheet or popover.
///
///You should dismiss the printing options when they are presented in a sheet or
@ -103,28 +110,39 @@ abstract class PlatformPrintJobController extends PlatformInterface
///(This, of course, assumes your application responds to orientation changes.)
///You should then present the printing options again once the new orientation takes effect.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///{@endtemplate}
Future<void> dismiss({bool animated = true}) {
throw UnimplementedError(
'dismiss is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController.getInfo}
///Gets the [PrintJobInfo] that describes this job.
///
///**NOTE**: The returned info object is a snapshot of the
///current print job state. Every call to this method returns a fresh
///info object that reflects the current print job state.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - PrintJob.getInfo](https://developer.android.com/reference/android/print/PrintJob#getInfo()))
///- iOS
///- MacOS
///{@endtemplate}
Future<PrintJobInfo?> getInfo() {
throw UnimplementedError(
'getInfo is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController.dispose}
///Disposes the print job.
///
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
///{@endtemplate}
@override
void dispose() {
throw UnimplementedError(

View File

@ -25,7 +25,7 @@ class PrintJobSettings_ {
///Otherwise, it will be handled and disposed automatically by the system.
///The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -35,7 +35,7 @@ class PrintJobSettings_ {
///An application should set this property to a name appropriate to the content being printed.
///The default job name is the current webpage title concatenated with the "Document" word at the end.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -43,13 +43,13 @@ class PrintJobSettings_ {
///`true` to animate the display of the sheet, `false` to display the sheet immediately.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? animated;
///The orientation of the printed content, portrait or landscape.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -57,7 +57,7 @@ class PrintJobSettings_ {
///The number of pages to render.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
int? numberOfPages;
@ -66,7 +66,7 @@ class PrintJobSettings_ {
///
///**NOTE for iOS**: available only on iOS 14.5+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
PrintJobRenderingQuality_? forceRenderingQuality;
@ -74,20 +74,20 @@ class PrintJobSettings_ {
///Margins define the white space around the content where the left margin defines
///the amount of white space on the left of the content and so on.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
EdgeInsets? margins;
///The media size.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
PrintJobMediaSize_? mediaSize;
///The color mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- MacOS
PrintJobColorMode_? colorMode;
@ -96,27 +96,27 @@ class PrintJobSettings_ {
///
///**NOTE for Android native WebView**: available only on Android 23+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
PrintJobDuplexMode_? duplexMode;
///The kind of printable content.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
PrintJobOutputType_? outputType;
///The supported resolution in DPI (dots per inch).
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
PrintJobResolution_? resolution;
///A Boolean value that determines whether the printing options include the number of copies.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
bool? showsNumberOfCopies;
@ -126,7 +126,7 @@ class PrintJobSettings_ {
///Setting the value to `true` enables a paper selection menu on printers that support different types of paper and have more than one paper type loaded.
///On printers where only one paper type is available, no paper selection menu is displayed, regardless of the value of this property.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? showsPaperSelectionForLoadedPapers;
@ -135,7 +135,7 @@ class PrintJobSettings_ {
///
///**NOTE for iOS**: available only on iOS 15.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
bool? showsPaperOrientation;
@ -143,42 +143,42 @@ class PrintJobSettings_ {
///A Boolean value that determines whether the print panel includes a control for manipulating the paper size of the printer.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPaperSize;
///A Boolean value that determines whether the Print panel includes a control for scaling the printed output.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsScaling;
///A Boolean value that determines whether the Print panel includes a set of fields for manipulating the range of pages being printed.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPageRange;
///A Boolean value that determines whether the Print panel includes a separate accessory view for manipulating the paper size, orientation, and scaling attributes.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPageSetupAccessory;
///A Boolean value that determines whether the Print panel displays a built-in preview of the document contents.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPreview;
///A Boolean value that determines whether the Print panel includes an additional selection option for paper range.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPrintSelection;
@ -189,7 +189,7 @@ class PrintJobSettings_ {
///that operation is controlled by the [showsProgressPanel] property.
///Operations that generate EPS or PDF data do no display a progress panel, regardless of the value in the flag parameter.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPrintPanel;
@ -200,7 +200,7 @@ class PrintJobSettings_ {
///that operation is controlled by the [showsPrintPanel] property.
///Operations that generate EPS or PDF data do no display a progress panel, regardless of the value in the flag parameter.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsProgressPanel;
@ -209,7 +209,7 @@ class PrintJobSettings_ {
///The footer is measured in points from the bottom of [printableRect] and is below the content area.
///The default footer height is `0.0`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
double? footerHeight;
@ -218,7 +218,7 @@ class PrintJobSettings_ {
///The header is measured in points from the top of [printableRect] and is above the content area.
///The default header height is `0.0`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
double? headerHeight;
@ -229,7 +229,7 @@ class PrintJobSettings_ {
///the top inset value; it uses the lower of the two values.
///The default value of this property is the maximum float value.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
double? maximumContentHeight;
@ -239,133 +239,133 @@ class PrintJobSettings_ {
///It compares the value of this property with the printing rectangles width minus the left and right inset values and uses the lower of the two.
///The default value of this property is the maximum float value.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
double? maximumContentWidth;
///The current scaling factor. From `0.0` to `1.0`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
double? scalingFactor;
///The action specified for the job.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
PrintJobDisposition_? jobDisposition;
///An URL containing the location to which the job file will be saved when the [jobDisposition] is [PrintJobDisposition.SAVE].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
WebUri? jobSavingURL;
///The name of the currently selected paper size.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
String? paperName;
///The horizontal pagination mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
PrintJobPaginationMode_? horizontalPagination;
///The vertical pagination to the specified mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
PrintJobPaginationMode_? verticalPagination;
///Indicates whether the image is centered horizontally.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? isHorizontallyCentered;
///Indicates whether the image is centered vertically.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? isVerticallyCentered;
///The print order for the pages of the operation.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
PrintJobPageOrder_? pageOrder;
///Whether the print operation should spawn a separate thread in which to run itself.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? canSpawnSeparateThread;
///How many copies to print.
///The default value is `1`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? copies;
///An integer value that specifies the first page in the print job.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? firstPage;
///An integer value that specifies the last page in the print job.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? lastPage;
///If `true`, produce detailed reports when an error occurs.
///The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? detailedErrorReporting;
///A fax number.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
String? faxNumber;
///If `true`, a standard header and footer are added outside the margins of each page.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? headerAndFooter;
///If `true`, collates output.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? mustCollate;
///The number of logical pages to be tiled horizontally on a physical sheet of paper.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? pagesAcross;
///The number of logical pages to be tiled vertically on a physical sheet of paper.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? pagesDown;
///A timestamp that specifies the time at which printing should begin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? time;

View File

@ -10,20 +10,20 @@ part of 'print_job_settings.dart';
class PrintJobSettings {
///`true` to animate the display of the sheet, `false` to display the sheet immediately.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? animated;
///Whether the print operation should spawn a separate thread in which to run itself.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? canSpawnSeparateThread;
///The color mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- MacOS
PrintJobColorMode? colorMode;
@ -31,14 +31,14 @@ class PrintJobSettings {
///How many copies to print.
///The default value is `1`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? copies;
///If `true`, produce detailed reports when an error occurs.
///The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? detailedErrorReporting;
@ -46,20 +46,20 @@ class PrintJobSettings {
///
///**NOTE for Android native WebView**: available only on Android 23+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
PrintJobDuplexMode? duplexMode;
///A fax number.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
String? faxNumber;
///An integer value that specifies the first page in the print job.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? firstPage;
@ -68,7 +68,7 @@ class PrintJobSettings {
///The footer is measured in points from the bottom of [printableRect] and is below the content area.
///The default footer height is `0.0`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
double? footerHeight;
@ -76,7 +76,7 @@ class PrintJobSettings {
///
///**NOTE for iOS**: available only on iOS 14.5+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
PrintJobRenderingQuality? forceRenderingQuality;
@ -84,7 +84,7 @@ class PrintJobSettings {
///Otherwise, it will be handled and disposed automatically by the system.
///The default value is `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -93,7 +93,7 @@ class PrintJobSettings {
///If `true`, a standard header and footer are added outside the margins of each page.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? headerAndFooter;
@ -102,33 +102,33 @@ class PrintJobSettings {
///The header is measured in points from the top of [printableRect] and is above the content area.
///The default header height is `0.0`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
double? headerHeight;
///The horizontal pagination mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
PrintJobPaginationMode? horizontalPagination;
///Indicates whether the image is centered horizontally.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? isHorizontallyCentered;
///Indicates whether the image is centered vertically.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? isVerticallyCentered;
///The action specified for the job.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
PrintJobDisposition? jobDisposition;
@ -136,7 +136,7 @@ class PrintJobSettings {
///An application should set this property to a name appropriate to the content being printed.
///The default job name is the current webpage title concatenated with the "Document" word at the end.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -144,13 +144,13 @@ class PrintJobSettings {
///An URL containing the location to which the job file will be saved when the [jobDisposition] is [PrintJobDisposition.SAVE].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
WebUri? jobSavingURL;
///An integer value that specifies the last page in the print job.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? lastPage;
@ -158,7 +158,7 @@ class PrintJobSettings {
///Margins define the white space around the content where the left margin defines
///the amount of white space on the left of the content and so on.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
EdgeInsets? margins;
@ -170,7 +170,7 @@ class PrintJobSettings {
///the top inset value; it uses the lower of the two values.
///The default value of this property is the maximum float value.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
double? maximumContentHeight;
@ -180,32 +180,32 @@ class PrintJobSettings {
///It compares the value of this property with the printing rectangles width minus the left and right inset values and uses the lower of the two.
///The default value of this property is the maximum float value.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
double? maximumContentWidth;
///The media size.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
PrintJobMediaSize? mediaSize;
///If `true`, collates output.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? mustCollate;
///The number of pages to render.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
int? numberOfPages;
///The orientation of the printed content, portrait or landscape.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -213,50 +213,50 @@ class PrintJobSettings {
///The kind of printable content.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
PrintJobOutputType? outputType;
///The print order for the pages of the operation.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
PrintJobPageOrder? pageOrder;
///The number of logical pages to be tiled horizontally on a physical sheet of paper.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? pagesAcross;
///The number of logical pages to be tiled vertically on a physical sheet of paper.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? pagesDown;
///The name of the currently selected paper size.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
String? paperName;
///The supported resolution in DPI (dots per inch).
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
PrintJobResolution? resolution;
///The current scaling factor. From `0.0` to `1.0`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
double? scalingFactor;
///A Boolean value that determines whether the printing options include the number of copies.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
bool? showsNumberOfCopies;
@ -264,14 +264,14 @@ class PrintJobSettings {
///A Boolean value that determines whether the Print panel includes a set of fields for manipulating the range of pages being printed.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPageRange;
///A Boolean value that determines whether the Print panel includes a separate accessory view for manipulating the paper size, orientation, and scaling attributes.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPageSetupAccessory;
@ -280,7 +280,7 @@ class PrintJobSettings {
///
///**NOTE for iOS**: available only on iOS 15.0+.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
bool? showsPaperOrientation;
@ -290,21 +290,21 @@ class PrintJobSettings {
///Setting the value to `true` enables a paper selection menu on printers that support different types of paper and have more than one paper type loaded.
///On printers where only one paper type is available, no paper selection menu is displayed, regardless of the value of this property.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
bool? showsPaperSelectionForLoadedPapers;
///A Boolean value that determines whether the print panel includes a control for manipulating the paper size of the printer.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPaperSize;
///A Boolean value that determines whether the Print panel displays a built-in preview of the document contents.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPreview;
@ -315,14 +315,14 @@ class PrintJobSettings {
///that operation is controlled by the [showsProgressPanel] property.
///Operations that generate EPS or PDF data do no display a progress panel, regardless of the value in the flag parameter.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPrintPanel;
///A Boolean value that determines whether the Print panel includes an additional selection option for paper range.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsPrintSelection;
@ -333,26 +333,26 @@ class PrintJobSettings {
///that operation is controlled by the [showsPrintPanel] property.
///Operations that generate EPS or PDF data do no display a progress panel, regardless of the value in the flag parameter.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsProgressPanel;
///A Boolean value that determines whether the Print panel includes a control for scaling the printed output.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
bool? showsScaling;
///A timestamp that specifies the time at which printing should begin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
int? time;
///The vertical pagination to the specified mode.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- MacOS
PrintJobPaginationMode? verticalPagination;
PrintJobSettings(

View File

@ -1,13 +1,14 @@
import 'dart:ui';
import 'package:flutter/foundation.dart';
import 'package:flutter_inappwebview_platform_interface/src/types/disposable.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import '../in_app_webview/in_app_webview_settings.dart';
import '../debug_logging_settings.dart';
import '../inappwebview_platform.dart';
import '../types/main.dart';
import 'pull_to_refresh_settings.dart';
import '../in_app_webview/platform_webview.dart';
import '../in_app_browser/platform_in_app_browser.dart';
/// Object specifying creation parameters for creating a [PlatformPullToRefreshController].
///
@ -22,25 +23,30 @@ class PlatformPullToRefreshControllerCreationParams {
: this.options = options ?? PullToRefreshOptions(),
this.settings = settings ?? PullToRefreshSettings();
///{@macro flutter_inappwebview_platform_interface.PlatformPullToRefreshController.options}
@Deprecated("Use settings instead")
late PullToRefreshOptions options;
///{@macro flutter_inappwebview_platform_interface.PlatformPullToRefreshController.settings}
late PullToRefreshSettings settings;
///{@macro flutter_inappwebview_platform_interface.PlatformPullToRefreshController.onRefresh}
final void Function()? onRefresh;
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController}
///A standard controller that can initiate the refreshing of a scroll views contents.
///This should be used whenever the user can refresh the contents of a WebView via a vertical swipe gesture.
///
///All the methods should be called only when the WebView has been created or is already running
///(for example [WebView.onWebViewCreated] or [InAppBrowser.onBrowserCreated]).
///(for example [PlatformWebViewCreationParams.onWebViewCreated] or [PlatformInAppBrowserEvents.onBrowserCreated]).
///
///**NOTE for Android**: to be able to use the "pull-to-refresh" feature, [InAppWebViewSettings.useHybridComposition] must be `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///{@endtemplate}
abstract class PlatformPullToRefreshController extends PlatformInterface
implements Disposable {
///Debug settings.
@ -76,8 +82,15 @@ abstract class PlatformPullToRefreshController extends PlatformInterface
/// The parameters used to initialize the [PlatformPullToRefreshController].
final PlatformPullToRefreshControllerCreationParams params;
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.options}
/// Use [settings] instead.
///{@endtemplate}
@Deprecated("Use settings instead")
PullToRefreshOptions get options => params.options;
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.settings}
/// Initial settings.
///{@endtemplate}
PullToRefreshSettings get settings => params.settings;
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.onRefresh}
@ -85,40 +98,47 @@ abstract class PlatformPullToRefreshController extends PlatformInterface
///{@endtemplate}
void Function()? get onRefresh => params.onRefresh;
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.setEnabled}
///Sets whether the pull-to-refresh feature is enabled or not.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setEnabled](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setEnabled(boolean)))
///- iOS ([Official API - UIScrollView.refreshControl](https://developer.apple.com/documentation/uikit/uiscrollview/2127691-refreshcontrol))
///{@endtemplate}
Future<void> setEnabled(bool enabled) {
throw UnimplementedError(
'setEnabled is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.isEnabled}
///Returns `true` is pull-to-refresh feature is enabled, otherwise `false`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - View.isEnabled](https://developer.android.com/reference/android/view/View#isEnabled()))
///- iOS ([Official API - UIScrollView.refreshControl](https://developer.apple.com/documentation/uikit/uiscrollview/2127691-refreshcontrol))
///{@endtemplate}
Future<bool> isEnabled() {
throw UnimplementedError(
'isEnabled is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.beginRefreshing}
///Tells the controller that a refresh operation was started programmatically.
///
///Call this method when an external event source triggers a programmatic refresh of your scrolling view.
///This method updates the state of the refresh control to reflect the in-progress refresh operation.
///When the refresh operation ends, be sure to call the [endRefreshing] method to return the controller to its default state.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///{@endtemplate}
Future<void> beginRefreshing() {
throw UnimplementedError(
'beginRefreshing is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.endRefreshing}
///Tells the controller that a refresh operation has ended.
///
///Call this method at the end of any refresh operation (whether it was initiated programmatically or by the user)
@ -126,103 +146,127 @@ abstract class PlatformPullToRefreshController extends PlatformInterface
///If the refresh control is at least partially visible, calling this method also hides it.
///If animations are also enabled, the control is hidden using an animation.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///{@endtemplate}
Future<void> endRefreshing() {
throw UnimplementedError(
'endRefreshing is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.isRefreshing}
///Returns whether a refresh operation has been triggered and is in progress.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.isRefreshing](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#isRefreshing()))
///- iOS ([Official API - UIRefreshControl.isRefreshing](https://developer.apple.com/documentation/uikit/uirefreshcontrol/1624844-isrefreshing))
///{@endtemplate}
Future<bool> isRefreshing() {
throw UnimplementedError(
'isRefreshing is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.setColor}
///Sets the color of the refresh control.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setColorSchemeColors](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setColorSchemeColors(int...)))
///- iOS ([Official API - UIRefreshControl.tintColor](https://developer.apple.com/documentation/uikit/uirefreshcontrol/1624847-tintcolor))
///{@endtemplate}
Future<void> setColor(Color color) {
throw UnimplementedError(
'setColor is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.setBackgroundColor}
///Sets the background color of the refresh control.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setProgressBackgroundColorSchemeColor](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setProgressBackgroundColorSchemeColor(int)))
///- iOS ([Official API - UIView.backgroundColor](https://developer.apple.com/documentation/uikit/uiview/1622591-backgroundcolor))
///{@endtemplate}
Future<void> setBackgroundColor(Color color) {
throw UnimplementedError(
'setBackgroundColor is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.setDistanceToTriggerSync}
///Set the distance to trigger a sync in dips.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setDistanceToTriggerSync](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setDistanceToTriggerSync(int)))
///{@endtemplate}
Future<void> setDistanceToTriggerSync(int distanceToTriggerSync) {
throw UnimplementedError(
'setDistanceToTriggerSync is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.setSlingshotDistance}
///Sets the distance that the refresh indicator can be pulled beyond its resting position during a swipe gesture.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setSlingshotDistance](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setSlingshotDistance(int)))
///{@endtemplate}
Future<void> setSlingshotDistance(int slingshotDistance) {
throw UnimplementedError(
'setSlingshotDistance is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.getDefaultSlingshotDistance}
///Gets the default distance that the refresh indicator can be pulled beyond its resting position during a swipe gesture.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.DEFAULT_SLINGSHOT_DISTANCE](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#DEFAULT_SLINGSHOT_DISTANCE()))
///{@endtemplate}
Future<int> getDefaultSlingshotDistance() {
throw UnimplementedError(
'getDefaultSlingshotDistance is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.setSize}
///Use [setIndicatorSize] instead.
///{@endtemplate}
@Deprecated("Use setIndicatorSize instead")
Future<void> setSize(AndroidPullToRefreshSize size) {
throw UnimplementedError(
'setSize is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.setIndicatorSize}
///Sets the size of the refresh indicator. One of [PullToRefreshSize.DEFAULT], or [PullToRefreshSize.LARGE].
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView ([Official API - SwipeRefreshLayout.setSize](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#setSize(int)))
///{@endtemplate}
Future<void> setIndicatorSize(PullToRefreshSize size) {
throw UnimplementedError(
'setIndicatorSize is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.setAttributedTitle}
///Use [setStyledTitle] instead.
///{@endtemplate}
@Deprecated("Use setStyledTitle instead")
Future<void> setAttributedTitle(IOSNSAttributedString attributedTitle) {
throw UnimplementedError(
'setAttributedTitle is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.setStyledTitle}
///Sets the styled title text to display in the refresh control.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - UIRefreshControl.attributedTitle](https://developer.apple.com/documentation/uikit/uirefreshcontrol/1624845-attributedtitle))
///{@endtemplate}
Future<void> setStyledTitle(AttributedString attributedTitle) {
throw UnimplementedError(
'setStyledTitle is not implemented on the current platform');
}
///{@template flutter_inappwebview_platform_interface.PlatformPullToRefreshController.dispose}
///Disposes the controller.
///{@endtemplate}
@override
void dispose({bool isKeepAlive = false}) {
throw UnimplementedError(

View File

@ -14,46 +14,46 @@ class PullToRefreshSettings_ {
///Sets whether the pull-to-refresh feature is enabled or not.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
bool? enabled;
///The color of the refresh control.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
Color_? color;
///The background color of the refresh control.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
Color_? backgroundColor;
///The distance to trigger a sync in dips.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
int? distanceToTriggerSync;
///The distance in pixels that the refresh indicator can be pulled beyond its resting position.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
int? slingshotDistance;
///The size of the refresh indicator.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
PullToRefreshSize_? size;
///The title text to display in the refresh control.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
AttributedString_? attributedTitle;

View File

@ -10,47 +10,47 @@ part of 'pull_to_refresh_settings.dart';
class PullToRefreshSettings {
///The title text to display in the refresh control.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
AttributedString? attributedTitle;
///The background color of the refresh control.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
Color? backgroundColor;
///The color of the refresh control.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
Color? color;
///The distance to trigger a sync in dips.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
int? distanceToTriggerSync;
///Sets whether the pull-to-refresh feature is enabled or not.
///The default value is `true`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
bool? enabled;
///The size of the refresh indicator.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
PullToRefreshSize? size;
///The distance in pixels that the refresh indicator can be pulled beyond its resting position.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
int? slingshotDistance;
PullToRefreshSettings(

View File

@ -10,7 +10,7 @@ part 'activity_button.g.dart';
///
///Check [Official Apple App Extensions](https://developer.apple.com/app-extensions/) for more details.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
@ExchangeableObject()
class ActivityButton_ {

View File

@ -12,7 +12,7 @@ part of 'activity_button.dart';
///
///Check [Official Apple App Extensions](https://developer.apple.com/app-extensions/) for more details.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
class ActivityButton {
///The name of the App or Share Extension to be called.

View File

@ -2,10 +2,11 @@ import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_i
import 'url_authentication_challenge.dart';
import 'url_protection_space.dart';
import '../in_app_webview/platform_webview.dart';
part 'client_cert_challenge.g.dart';
///Class that represents the challenge of the [WebView.onReceivedClientCertRequest] event.
///Class that represents the challenge of the [PlatformWebViewCreationParams.onReceivedClientCertRequest] event.
///It provides all the information about the challenge.
@ExchangeableObject()
class ClientCertChallenge_ extends URLAuthenticationChallenge_ {

View File

@ -6,7 +6,7 @@ part of 'client_cert_challenge.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the challenge of the [WebView.onReceivedClientCertRequest] event.
///Class that represents the challenge of the [PlatformWebViewCreationParams.onReceivedClientCertRequest] event.
///It provides all the information about the challenge.
class ClientCertChallenge extends URLAuthenticationChallenge {
///Use [keyTypes] instead.
@ -19,13 +19,13 @@ class ClientCertChallenge extends URLAuthenticationChallenge {
///Returns the acceptable types of asymmetric keys.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView 21+ ([Official API - ClientCertRequest.getKeyTypes](https://developer.android.com/reference/android/webkit/ClientCertRequest#getKeyTypes()))
List<String>? keyTypes;
///The acceptable certificate issuers for the certificate matching the private key.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView 21+ ([Official API - ClientCertRequest.getPrincipals](https://developer.android.com/reference/android/webkit/ClientCertRequest#getPrincipals()))
List<String>? principals;
ClientCertChallenge(

View File

@ -1,4 +1,4 @@
import 'package:flutter/foundation.dart';
import '../in_app_webview/platform_webview.dart';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../util.dart';
@ -6,7 +6,7 @@ import 'client_cert_response_action.dart';
part 'client_cert_response.g.dart';
///Class that represents the response used by the [WebView.onReceivedClientCertRequest] event.
///Class that represents the response used by the [PlatformWebViewCreationParams.onReceivedClientCertRequest] event.
@ExchangeableObject()
class ClientCertResponse_ {
///The file path of the certificate to use.

View File

@ -6,7 +6,7 @@ part of 'client_cert_response.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the response used by the [WebView.onReceivedClientCertRequest] event.
///Class that represents the response used by the [PlatformWebViewCreationParams.onReceivedClientCertRequest] event.
class ClientCertResponse {
///Indicate the [ClientCertResponseAction] to take in response of the client certificate challenge.
ClientCertResponseAction? action;
@ -23,7 +23,7 @@ class ClientCertResponse {
///An Android-specific property used by Java [KeyStore](https://developer.android.com/reference/java/security/KeyStore) class to get the instance.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
String? keyStoreType;
ClientCertResponse(

View File

@ -1,5 +1,6 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_webview.dart';
import 'console_message_level.dart';
part 'console_message.g.dart';
@ -7,7 +8,7 @@ part 'console_message.g.dart';
///Class representing a JavaScript console message from WebCore.
///This could be a issued by a call to one of the console logging functions (e.g. console.log('...')) or a JavaScript error on the page.
///
///To receive notifications of these messages, use the [WebView.onConsoleMessage] event.
///To receive notifications of these messages, use the [PlatformWebViewCreationParams.onConsoleMessage] event.
@ExchangeableObject()
class ConsoleMessage_ {
///Console message

View File

@ -9,7 +9,7 @@ part of 'console_message.dart';
///Class representing a JavaScript console message from WebCore.
///This could be a issued by a call to one of the console logging functions (e.g. console.log('...')) or a JavaScript error on the page.
///
///To receive notifications of these messages, use the [WebView.onConsoleMessage] event.
///To receive notifications of these messages, use the [PlatformWebViewCreationParams.onConsoleMessage] event.
class ConsoleMessage {
///Console message
String message;

View File

@ -18,7 +18,7 @@ class ContentBlockerActionType {
///Stops loading of the resource. If the resource was cached, the cache is ignored.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -41,7 +41,7 @@ class ContentBlockerActionType {
///This only blocks cookies otherwise acceptable to WebView's privacy policy.
///Combining with [IGNORE_PREVIOUS_RULES] doesn't override the browsers privacy settings.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
static final BLOCK_COOKIES =
@ -63,7 +63,7 @@ class ContentBlockerActionType {
///
///**NOTE**: on Android, JavaScript must be enabled.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS
@ -84,7 +84,7 @@ class ContentBlockerActionType {
///Ignores previously triggered actions.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
static final IGNORE_PREVIOUS_RULES =
@ -104,7 +104,7 @@ class ContentBlockerActionType {
///Changes a URL from http to https.
///URLs with a specified (nondefault) port and links using other protocols are unaffected.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
///- iOS
///- MacOS

View File

@ -12,7 +12,7 @@ class Cookie {
///
///**NOTE for Android native WebView**: available on Android only if [WebViewFeature.GET_COOKIE_INFO] feature is supported.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///- Android native WebView
@ -22,7 +22,7 @@ class Cookie {
///
///**NOTE for Android native WebView**: available on Android only if [WebViewFeature.GET_COOKIE_INFO] feature is supported.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///- Android native WebView
@ -32,7 +32,7 @@ class Cookie {
///
///**NOTE for Android native WebView**: available on Android only if [WebViewFeature.GET_COOKIE_INFO] feature is supported.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///- Android native WebView
@ -42,7 +42,7 @@ class Cookie {
///
///**NOTE for Android native WebView**: available on Android only if [WebViewFeature.GET_COOKIE_INFO] feature is supported.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///- Android native WebView
@ -50,14 +50,14 @@ class Cookie {
///Indicates if the cookie is a session only cookie.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
bool? isSessionOnly;
///The cookie name.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///- Android native WebView
@ -68,7 +68,7 @@ class Cookie {
///
///**NOTE for Android native WebView**: available on Android only if [WebViewFeature.GET_COOKIE_INFO] feature is supported.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///- Android native WebView
@ -78,7 +78,7 @@ class Cookie {
///
///**NOTE for Android native WebView**: available on Android only if [WebViewFeature.GET_COOKIE_INFO] feature is supported.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///- Android native WebView
@ -86,7 +86,7 @@ class Cookie {
///The cookie value.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
///- Android native WebView

View File

@ -5,10 +5,11 @@ import 'window_features.dart';
import 'url_request.dart';
import 'frame_info.dart';
import 'navigation_type.dart';
import '../in_app_webview/platform_webview.dart';
part 'create_window_action.g.dart';
///Class that represents the navigation request used by the [WebView.onCreateWindow] event.
///Class that represents the navigation request used by the [PlatformWebViewCreationParams.onCreateWindow] event.
@ExchangeableObject()
class CreateWindowAction_ extends NavigationAction_ {
///The window id. Used by `WebView` to create a new WebView.

View File

@ -6,7 +6,7 @@ part of 'create_window_action.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the navigation request used by the [WebView.onCreateWindow] event.
///Class that represents the navigation request used by the [PlatformWebViewCreationParams.onCreateWindow] event.
class CreateWindowAction extends NavigationAction {
///Use [isDialog] instead.
@Deprecated('Use isDialog instead')
@ -18,13 +18,13 @@ class CreateWindowAction extends NavigationAction {
///Indicates if the new window should be a dialog, rather than a full-size window.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
bool? isDialog;
///Window features requested by the webpage.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS ([Official API - WKWindowFeatures](https://developer.apple.com/documentation/webkit/wkwindowfeatures))
///- MacOS ([Official API - WKWindowFeatures](https://developer.apple.com/documentation/webkit/wkwindowfeatures))
WindowFeatures? windowFeatures;

View File

@ -1,10 +1,11 @@
import 'dart:typed_data';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_webview.dart';
part 'custom_scheme_response.g.dart';
///Class representing the response returned by the [WebView.onLoadResourceWithCustomScheme] event.
///Class representing the response returned by the [PlatformWebViewCreationParams.onLoadResourceWithCustomScheme] event.
///It allows to load a specific resource. The resource data must be encoded to `base64`.
@ExchangeableObject()
class CustomSchemeResponse_ {

View File

@ -6,7 +6,7 @@ part of 'custom_scheme_response.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class representing the response returned by the [WebView.onLoadResourceWithCustomScheme] event.
///Class representing the response returned by the [PlatformWebViewCreationParams.onLoadResourceWithCustomScheme] event.
///It allows to load a specific resource. The resource data must be encoded to `base64`.
class CustomSchemeResponse {
///Content-Encoding of the data, such as `utf-8`.

View File

@ -4,7 +4,7 @@ import '../chrome_safari_browser/platform_chrome_safari_browser.dart';
part 'custom_tabs_navigation_event_type.g.dart';
///The type corresponding to the navigation event of [PlatformChromeSafariBrowser.onNavigationEvent].
///The type corresponding to the navigation event of [PlatformChromeSafariBrowserEvents.onNavigationEvent].
@ExchangeableEnum()
class CustomTabsNavigationEventType_ {
// ignore: unused_field

View File

@ -18,7 +18,7 @@ class CustomTabsNavigationEventType {
///Sent when loading was aborted by a user action before it finishes like clicking on a link or refreshing the page.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final ABORTED =
CustomTabsNavigationEventType._internalMultiPlatform(4, () {
@ -33,7 +33,7 @@ class CustomTabsNavigationEventType {
///Sent when the tab couldn't finish loading due to a failure.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final FAILED =
CustomTabsNavigationEventType._internalMultiPlatform(3, () {
@ -48,7 +48,7 @@ class CustomTabsNavigationEventType {
///Sent when the tab has finished loading a page.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final FINISHED =
CustomTabsNavigationEventType._internalMultiPlatform(2, () {
@ -63,7 +63,7 @@ class CustomTabsNavigationEventType {
///Sent when the tab has started loading a page.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final STARTED =
CustomTabsNavigationEventType._internalMultiPlatform(1, () {
@ -78,7 +78,7 @@ class CustomTabsNavigationEventType {
///Sent when the tab becomes hidden.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final TAB_HIDDEN =
CustomTabsNavigationEventType._internalMultiPlatform(6, () {
@ -93,7 +93,7 @@ class CustomTabsNavigationEventType {
///Sent when the tab becomes visible.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final TAB_SHOWN =
CustomTabsNavigationEventType._internalMultiPlatform(5, () {

View File

@ -20,7 +20,7 @@ class CustomTabsPostMessageResultType {
///Indicates that the postMessage request was not allowed due to a bad argument
///or requesting at a disallowed time like when in background.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final FAILURE_DISALLOWED =
CustomTabsPostMessageResultType._internalMultiPlatform(-1, () {
@ -35,7 +35,7 @@ class CustomTabsPostMessageResultType {
///Indicates that the postMessage request has failed due to an internal error on the browser message channel.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final FAILURE_MESSAGING_ERROR =
CustomTabsPostMessageResultType._internalMultiPlatform(-3, () {
@ -50,7 +50,7 @@ class CustomTabsPostMessageResultType {
///Indicates that the postMessage request has failed due to a `RemoteException`.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final FAILURE_REMOTE_ERROR =
CustomTabsPostMessageResultType._internalMultiPlatform(-2, () {
@ -65,7 +65,7 @@ class CustomTabsPostMessageResultType {
///Indicates that the postMessage request was accepted.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final SUCCESS =
CustomTabsPostMessageResultType._internalMultiPlatform(0, () {

View File

@ -18,7 +18,7 @@ class CustomTabsRelationType {
///Requests the ability to handle all URLs from a given origin.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final HANDLE_ALL_URLS =
CustomTabsRelationType._internalMultiPlatform(2, () {
@ -33,7 +33,7 @@ class CustomTabsRelationType {
///For App -> Web transitions, requests the app to use the declared origin to be used as origin for the client app in the web APIs context.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
static final USE_AS_ORIGIN =
CustomTabsRelationType._internalMultiPlatform(1, () {

View File

@ -1,10 +1,11 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../web_uri.dart';
import '../in_app_webview/platform_webview.dart';
part 'download_start_request.g.dart';
///Class representing a download request of the WebView used by the event [WebView.onDownloadStartRequest].
///Class representing a download request of the WebView used by the event [PlatformWebViewCreationParams.onDownloadStartRequest].
@ExchangeableObject()
class DownloadStartRequest_ {
///The full url to the content that should be downloaded.

View File

@ -6,7 +6,7 @@ part of 'download_start_request.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class representing a download request of the WebView used by the event [WebView.onDownloadStartRequest].
///Class representing a download request of the WebView used by the event [PlatformWebViewCreationParams.onDownloadStartRequest].
class DownloadStartRequest {
///Content-disposition http header, if present.
String? contentDisposition;

View File

@ -1,8 +1,8 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_webview.dart';
part 'form_resubmission_action.g.dart';
///Class that represents the action to take used by the [WebView.onFormResubmission] event.
///Class that represents the action to take used by the [PlatformWebViewCreationParams.onFormResubmission] event.
@ExchangeableEnum()
class FormResubmissionAction_ {
// ignore: unused_field

View File

@ -6,7 +6,7 @@ part of 'form_resubmission_action.dart';
// ExchangeableEnumGenerator
// **************************************************************************
///Class that represents the action to take used by the [WebView.onFormResubmission] event.
///Class that represents the action to take used by the [PlatformWebViewCreationParams.onFormResubmission] event.
class FormResubmissionAction {
final int _value;
final int _nativeValue;

View File

@ -1,8 +1,8 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_webview.dart';
part 'geolocation_permission_show_prompt_response.g.dart';
///Class used by the host application to set the Geolocation permission state for an origin during the [WebView.onGeolocationPermissionsShowPrompt] event.
///Class used by the host application to set the Geolocation permission state for an origin during the [PlatformWebViewCreationParams.onGeolocationPermissionsShowPrompt] event.
@ExchangeableObject()
class GeolocationPermissionShowPromptResponse_ {
///The origin for which permissions are set.

View File

@ -6,7 +6,7 @@ part of 'geolocation_permission_show_prompt_response.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class used by the host application to set the Geolocation permission state for an origin during the [WebView.onGeolocationPermissionsShowPrompt] event.
///Class used by the host application to set the Geolocation permission state for an origin during the [PlatformWebViewCreationParams.onGeolocationPermissionsShowPrompt] event.
class GeolocationPermissionShowPromptResponse {
///Whether or not the origin should be allowed to use the Geolocation API.
bool allow;

View File

@ -1,10 +1,10 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_webview.dart';
import 'http_auth_response_action.dart';
part 'http_auth_response.g.dart';
///Class that represents the response used by the [WebView.onReceivedHttpAuthRequest] event.
///Class that represents the response used by the [PlatformWebViewCreationParams.onReceivedHttpAuthRequest] event.
@ExchangeableObject()
class HttpAuthResponse_ {
///Represents the username used for the authentication if the [action] corresponds to [HttpAuthResponseAction.PROCEED]

View File

@ -6,7 +6,7 @@ part of 'http_auth_response.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the response used by the [WebView.onReceivedHttpAuthRequest] event.
///Class that represents the response used by the [PlatformWebViewCreationParams.onReceivedHttpAuthRequest] event.
class HttpAuthResponse {
///Indicate the [HttpAuthResponseAction] to take in response of the authentication challenge.
HttpAuthResponseAction? action;

View File

@ -4,10 +4,11 @@ import 'url_credential.dart';
import 'url_response.dart';
import 'url_authentication_challenge.dart';
import 'url_protection_space.dart';
import '../in_app_webview/platform_webview.dart';
part 'http_authentication_challenge.g.dart';
///Class that represents the challenge of the [WebView.onReceivedHttpAuthRequest] event.
///Class that represents the challenge of the [PlatformWebViewCreationParams.onReceivedHttpAuthRequest] event.
///It provides all the information about the challenge.
@ExchangeableObject()
class HttpAuthenticationChallenge_ extends URLAuthenticationChallenge_ {

View File

@ -6,7 +6,7 @@ part of 'http_authentication_challenge.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the challenge of the [WebView.onReceivedHttpAuthRequest] event.
///Class that represents the challenge of the [PlatformWebViewCreationParams.onReceivedHttpAuthRequest] event.
///It provides all the information about the challenge.
class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
///The error object representing the last authentication failure.

View File

@ -23,7 +23,7 @@ class InAppWebViewInitialData {
///The URL to use as the history entry. If `null` defaults to `about:blank`. If non-null, this must be a valid URL.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- Android native WebView
WebUri? historyUrl;

View File

@ -1,10 +1,10 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_webview.dart';
import '../web_uri.dart';
part 'js_alert_request.g.dart';
///Class that represents the request of the [WebView.onJsAlert] event.
///Class that represents the request of the [PlatformWebViewCreationParams.onJsAlert] event.
@ExchangeableObject()
class JsAlertRequest_ {
///The url of the page requesting the dialog.

View File

@ -6,7 +6,7 @@ part of 'js_alert_request.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the request of the [WebView.onJsAlert] event.
///Class that represents the request of the [PlatformWebViewCreationParams.onJsAlert] event.
class JsAlertRequest {
///Use [isMainFrame] instead.
@Deprecated('Use isMainFrame instead')
@ -14,7 +14,7 @@ class JsAlertRequest {
///Indicates whether the request was made for the main frame.
///
///**Supported Platforms/Implementations**:
///**Officially Supported Platforms/Implementations**:
///- iOS
///- MacOS
bool? isMainFrame;

View File

@ -1,10 +1,10 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_webview.dart';
import 'js_alert_response_action.dart';
part 'js_alert_response.g.dart';
///Class that represents the response used by the [WebView.onJsAlert] event to control a JavaScript alert dialog.
///Class that represents the response used by the [PlatformWebViewCreationParams.onJsAlert] event to control a JavaScript alert dialog.
@ExchangeableObject()
class JsAlertResponse_ {
///Message to be displayed in the window.

View File

@ -6,7 +6,7 @@ part of 'js_alert_response.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the response used by the [WebView.onJsAlert] event to control a JavaScript alert dialog.
///Class that represents the response used by the [PlatformWebViewCreationParams.onJsAlert] event to control a JavaScript alert dialog.
class JsAlertResponse {
///Action used to confirm that the user hit confirm button.
JsAlertResponseAction? action;

View File

@ -1,10 +1,10 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_webview.dart';
import '../web_uri.dart';
part 'js_before_unload_request.g.dart';
///Class that represents the request of the [WebView.onJsBeforeUnload] event.
///Class that represents the request of the [PlatformWebViewCreationParams.onJsBeforeUnload] event.
@ExchangeableObject()
class JsBeforeUnloadRequest_ {
///The url of the page requesting the dialog.

View File

@ -6,7 +6,7 @@ part of 'js_before_unload_request.dart';
// ExchangeableObjectGenerator
// **************************************************************************
///Class that represents the request of the [WebView.onJsBeforeUnload] event.
///Class that represents the request of the [PlatformWebViewCreationParams.onJsBeforeUnload] event.
class JsBeforeUnloadRequest {
///Message to be displayed in the window.
String? message;

View File

@ -1,10 +1,10 @@
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/platform_webview.dart';
import 'js_before_unload_response_action.dart';
part 'js_before_unload_response.g.dart';
///Class that represents the response used by the [WebView.onJsBeforeUnload] event to control a JavaScript alert dialog.
///Class that represents the response used by the [PlatformWebViewCreationParams.onJsBeforeUnload] event to control a JavaScript alert dialog.
@ExchangeableObject()
class JsBeforeUnloadResponse_ {
///Message to be displayed in the window.

Some files were not shown because too many files have changed in this diff Show More