Updated code docs, Using Android WebViewClientCompat for Chromium-based WebView if the WebView package major version is >= 73 (https://bugs.chromium.org/p/chromium/issues/detail?id=925887), fix #1422
This commit is contained in:
parent
fc98712f30
commit
459875ff2e
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -1,3 +1,9 @@
|
||||||
|
## 6.0.0-beta.20
|
||||||
|
|
||||||
|
- Using Android `WebViewClientCompat` for Chromium-based WebView if the WebView package major version is >= 73 (https://bugs.chromium.org/p/chromium/issues/detail?id=925887)
|
||||||
|
- Updated code docs
|
||||||
|
- Fixed "Unexpected addWebMessageListener behaviour" [#1422](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1422)
|
||||||
|
|
||||||
## 6.0.0-beta.19
|
## 6.0.0-beta.19
|
||||||
|
|
||||||
- Updated code docs
|
- Updated code docs
|
||||||
|
@ -164,6 +170,10 @@
|
||||||
- Removed `URLProtectionSpace.iosIsProxy` property
|
- Removed `URLProtectionSpace.iosIsProxy` property
|
||||||
- `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null`
|
- `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null`
|
||||||
|
|
||||||
|
## 5.7.2+2
|
||||||
|
|
||||||
|
- Fixed "Unexpected addWebMessageListener behaviour" [#1422](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1422)
|
||||||
|
|
||||||
## 5.7.2+1
|
## 5.7.2+1
|
||||||
|
|
||||||
- Fixed "Cannot Grant Permission at Android 21" [#1447](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1447)
|
- Fixed "Cannot Grant Permission at Android 21" [#1447](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1447)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.pichillilorenzo.flutter_inappwebview;
|
package com.pichillilorenzo.flutter_inappwebview;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -82,28 +83,15 @@ public class InAppWebViewStatic extends ChannelDelegateImpl {
|
||||||
result.success(false);
|
result.success(false);
|
||||||
break;
|
break;
|
||||||
case "getCurrentWebViewPackage":
|
case "getCurrentWebViewPackage":
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && plugin != null && (plugin.activity != null || plugin.applicationContext != null)) {
|
Context context = null;
|
||||||
Context context = plugin.activity;
|
if (plugin != null) {
|
||||||
|
context = plugin.activity;
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
context = plugin.applicationContext;
|
context = plugin.applicationContext;
|
||||||
}
|
}
|
||||||
result.success(convertWebViewPackageToMap(WebViewCompat.getCurrentWebViewPackage(context)));
|
|
||||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
//with Android Lollipop (API 21) they started to update the WebView
|
|
||||||
//as a separate APK with the PlayStore and they added the
|
|
||||||
//getLoadedPackageInfo() method to the WebViewFactory class and this
|
|
||||||
//should handle the Android 7.0 behaviour changes too
|
|
||||||
try {
|
|
||||||
Class webViewFactory = Class.forName("android.webkit.WebViewFactory");
|
|
||||||
Method method = webViewFactory.getMethod("getLoadedPackageInfo");
|
|
||||||
PackageInfo pInfo = (PackageInfo) method.invoke(null);
|
|
||||||
result.success(convertWebViewPackageToMap(pInfo));
|
|
||||||
} catch (Exception e) {
|
|
||||||
result.success(null);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
result.success(null);
|
|
||||||
}
|
}
|
||||||
|
PackageInfo packageInfo = context != null ? WebViewCompat.getCurrentWebViewPackage(context) : null;
|
||||||
|
result.success(packageInfo != null ? convertWebViewPackageToMap(packageInfo) : null);
|
||||||
break;
|
break;
|
||||||
case "setWebContentsDebuggingEnabled":
|
case "setWebContentsDebuggingEnabled":
|
||||||
{
|
{
|
||||||
|
@ -135,10 +123,8 @@ public class InAppWebViewStatic extends ChannelDelegateImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> convertWebViewPackageToMap(PackageInfo webViewPackageInfo) {
|
@NonNull
|
||||||
if (webViewPackageInfo == null) {
|
public Map<String, Object> convertWebViewPackageToMap(@NonNull PackageInfo webViewPackageInfo) {
|
||||||
return null;
|
|
||||||
}
|
|
||||||
HashMap<String, Object> webViewPackageInfoMap = new HashMap<>();
|
HashMap<String, Object> webViewPackageInfoMap = new HashMap<>();
|
||||||
|
|
||||||
webViewPackageInfoMap.put("versionName", webViewPackageInfo.versionName);
|
webViewPackageInfoMap.put("versionName", webViewPackageInfo.versionName);
|
||||||
|
|
|
@ -2,9 +2,12 @@ package com.pichillilorenzo.flutter_inappwebview.types;
|
||||||
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.webkit.WebResourceError;
|
import android.webkit.WebResourceError;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.webkit.WebResourceErrorCompat;
|
||||||
|
import androidx.webkit.WebViewFeature;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -24,6 +27,19 @@ public class WebResourceErrorExt {
|
||||||
return new WebResourceErrorExt(error.getErrorCode(), error.getDescription().toString());
|
return new WebResourceErrorExt(error.getErrorCode(), error.getDescription().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.M)
|
||||||
|
static public WebResourceErrorExt fromWebResourceError(@NonNull WebResourceErrorCompat error) {
|
||||||
|
int type = -1;
|
||||||
|
if (WebViewFeature.isFeatureSupported(WebViewFeature.WEB_RESOURCE_ERROR_GET_CODE)) {
|
||||||
|
type = error.getErrorCode();
|
||||||
|
}
|
||||||
|
String description = "";
|
||||||
|
if (WebViewFeature.isFeatureSupported(WebViewFeature.WEB_RESOURCE_ERROR_GET_DESCRIPTION)) {
|
||||||
|
description = error.getDescription().toString();
|
||||||
|
}
|
||||||
|
return new WebResourceErrorExt(type, description);
|
||||||
|
}
|
||||||
|
|
||||||
public Map<String, Object> toMap() {
|
public Map<String, Object> toMap() {
|
||||||
Map<String, Object> webResourceErrorMap = new HashMap<>();
|
Map<String, Object> webResourceErrorMap = new HashMap<>();
|
||||||
webResourceErrorMap.put("type", getType());
|
webResourceErrorMap.put("type", getType());
|
||||||
|
|
|
@ -146,6 +146,9 @@ public class FlutterWebView implements PlatformWebView {
|
||||||
if (webView.inAppWebViewChromeClient != null) {
|
if (webView.inAppWebViewChromeClient != null) {
|
||||||
webView.inAppWebViewChromeClient.dispose();
|
webView.inAppWebViewChromeClient.dispose();
|
||||||
}
|
}
|
||||||
|
if (webView.inAppWebViewClientCompat != null) {
|
||||||
|
webView.inAppWebViewClientCompat.dispose();
|
||||||
|
}
|
||||||
if (webView.inAppWebViewClient != null) {
|
if (webView.inAppWebViewClient != null) {
|
||||||
webView.inAppWebViewClient.dispose();
|
webView.inAppWebViewClient.dispose();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import android.animation.PropertyValuesHolder;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
@ -47,6 +48,7 @@ import android.webkit.WebBackForwardList;
|
||||||
import android.webkit.WebHistoryItem;
|
import android.webkit.WebHistoryItem;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebStorage;
|
import android.webkit.WebStorage;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.HorizontalScrollView;
|
import android.widget.HorizontalScrollView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
@ -59,6 +61,7 @@ import androidx.webkit.WebViewCompat;
|
||||||
import androidx.webkit.WebViewFeature;
|
import androidx.webkit.WebViewFeature;
|
||||||
|
|
||||||
import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin;
|
import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.InAppWebViewStatic;
|
||||||
import com.pichillilorenzo.flutter_inappwebview.R;
|
import com.pichillilorenzo.flutter_inappwebview.R;
|
||||||
import com.pichillilorenzo.flutter_inappwebview.Util;
|
import com.pichillilorenzo.flutter_inappwebview.Util;
|
||||||
import com.pichillilorenzo.flutter_inappwebview.content_blocker.ContentBlocker;
|
import com.pichillilorenzo.flutter_inappwebview.content_blocker.ContentBlocker;
|
||||||
|
@ -124,6 +127,8 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie
|
||||||
@Nullable
|
@Nullable
|
||||||
public InAppWebViewClient inAppWebViewClient;
|
public InAppWebViewClient inAppWebViewClient;
|
||||||
@Nullable
|
@Nullable
|
||||||
|
public InAppWebViewClientCompat inAppWebViewClientCompat;
|
||||||
|
@Nullable
|
||||||
public InAppWebViewChromeClient inAppWebViewChromeClient;
|
public InAppWebViewChromeClient inAppWebViewChromeClient;
|
||||||
@Nullable
|
@Nullable
|
||||||
public InAppWebViewRenderProcessClient inAppWebViewRenderProcessClient;
|
public InAppWebViewRenderProcessClient inAppWebViewRenderProcessClient;
|
||||||
|
@ -199,6 +204,36 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WebViewClient createWebViewClient(InAppBrowserDelegate inAppBrowserDelegate) {
|
||||||
|
// bug https://bugs.chromium.org/p/chromium/issues/detail?id=925887
|
||||||
|
PackageInfo packageInfo = WebViewCompat.getCurrentWebViewPackage(getContext());
|
||||||
|
if (packageInfo == null) {
|
||||||
|
Log.d(LOG_TAG, "Using InAppWebViewClient implementation");
|
||||||
|
return new InAppWebViewClient(inAppBrowserDelegate);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isChromiumWebView = "com.android.webview".equals(packageInfo.packageName) ||
|
||||||
|
"com.google.android.webview".equals(packageInfo.packageName) ||
|
||||||
|
"com.android.chrome".equals(packageInfo.packageName);
|
||||||
|
boolean isChromiumWebViewBugFixed = false;
|
||||||
|
if (isChromiumWebView) {
|
||||||
|
String versionName = packageInfo.versionName != null ? packageInfo.versionName : "";
|
||||||
|
try {
|
||||||
|
int majorVersion = versionName.contains(".") ?
|
||||||
|
Integer.parseInt(versionName.split("\\.")[0]) : 0;
|
||||||
|
isChromiumWebViewBugFixed = majorVersion >= 73;
|
||||||
|
} catch (NumberFormatException ignored) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isChromiumWebViewBugFixed || !isChromiumWebView) {
|
||||||
|
Log.d(LOG_TAG, "Using InAppWebViewClientCompat implementation");
|
||||||
|
return new InAppWebViewClientCompat(inAppBrowserDelegate);
|
||||||
|
} else {
|
||||||
|
Log.d(LOG_TAG, "Using InAppWebViewClient implementation");
|
||||||
|
return new InAppWebViewClient(inAppBrowserDelegate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("RestrictedApi")
|
@SuppressLint("RestrictedApi")
|
||||||
public void prepare() {
|
public void prepare() {
|
||||||
if (plugin != null) {
|
if (plugin != null) {
|
||||||
|
@ -211,8 +246,14 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie
|
||||||
inAppWebViewChromeClient = new InAppWebViewChromeClient(plugin, this, inAppBrowserDelegate);
|
inAppWebViewChromeClient = new InAppWebViewChromeClient(plugin, this, inAppBrowserDelegate);
|
||||||
setWebChromeClient(inAppWebViewChromeClient);
|
setWebChromeClient(inAppWebViewChromeClient);
|
||||||
|
|
||||||
inAppWebViewClient = new InAppWebViewClient(inAppBrowserDelegate);
|
WebViewClient webViewClient = createWebViewClient(inAppBrowserDelegate);
|
||||||
setWebViewClient(inAppWebViewClient);
|
if (webViewClient instanceof InAppWebViewClientCompat) {
|
||||||
|
inAppWebViewClientCompat = (InAppWebViewClientCompat) webViewClient;
|
||||||
|
setWebViewClient(inAppWebViewClientCompat);
|
||||||
|
} else if (webViewClient instanceof InAppWebViewClient) {
|
||||||
|
inAppWebViewClient = (InAppWebViewClient) webViewClient;
|
||||||
|
setWebViewClient(inAppWebViewClient);
|
||||||
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && WebViewFeature.isFeatureSupported(WebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE)) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && WebViewFeature.isFeatureSupported(WebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE)) {
|
||||||
inAppWebViewRenderProcessClient = new InAppWebViewRenderProcessClient();
|
inAppWebViewRenderProcessClient = new InAppWebViewRenderProcessClient();
|
||||||
|
@ -1982,6 +2023,7 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie
|
||||||
evaluateJavaScriptContentWorldCallbacks.clear();
|
evaluateJavaScriptContentWorldCallbacks.clear();
|
||||||
inAppBrowserDelegate = null;
|
inAppBrowserDelegate = null;
|
||||||
inAppWebViewChromeClient = null;
|
inAppWebViewChromeClient = null;
|
||||||
|
inAppWebViewClientCompat = null;
|
||||||
inAppWebViewClient = null;
|
inAppWebViewClient = null;
|
||||||
javaScriptBridgeInterface = null;
|
javaScriptBridgeInterface = null;
|
||||||
inAppWebViewRenderProcessClient = null;
|
inAppWebViewRenderProcessClient = null;
|
||||||
|
|
|
@ -731,7 +731,9 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||||
|
|
||||||
InAppWebView webView = (InAppWebView) view;
|
InAppWebView webView = (InAppWebView) view;
|
||||||
|
|
||||||
if (webView.inAppWebViewClient != null) {
|
if (webView.inAppWebViewClientCompat != null) {
|
||||||
|
webView.inAppWebViewClientCompat.loadCustomJavaScriptOnPageStarted(view);
|
||||||
|
} else if (webView.inAppWebViewClient != null) {
|
||||||
webView.inAppWebViewClient.loadCustomJavaScriptOnPageStarted(view);
|
webView.inAppWebViewClient.loadCustomJavaScriptOnPageStarted(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,9 @@ public class InAppWebViewClient extends WebViewClient {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void allowShouldOverrideUrlLoading(WebView webView, String url, Map<String, String> headers, boolean isForMainFrame) {
|
private void allowShouldOverrideUrlLoading(WebView webView, String url,
|
||||||
|
@Nullable Map<String, String> headers,
|
||||||
|
boolean isForMainFrame) {
|
||||||
if (isForMainFrame) {
|
if (isForMainFrame) {
|
||||||
// There isn't any way to load an URL for a frame that is not the main frame,
|
// There isn't any way to load an URL for a frame that is not the main frame,
|
||||||
// so call this only on main frame.
|
// so call this only on main frame.
|
||||||
|
@ -124,8 +126,11 @@ public class InAppWebViewClient extends WebViewClient {
|
||||||
webView.loadUrl(url);
|
webView.loadUrl(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void onShouldOverrideUrlLoading(final InAppWebView webView, final String url, final String method, final Map<String, String> headers,
|
public void onShouldOverrideUrlLoading(final InAppWebView webView, final String url,
|
||||||
final boolean isForMainFrame, boolean hasGesture, boolean isRedirect) {
|
final String method,
|
||||||
|
@Nullable final Map<String, String> headers,
|
||||||
|
final boolean isForMainFrame, boolean hasGesture,
|
||||||
|
boolean isRedirect) {
|
||||||
URLRequest request = new URLRequest(url, method, null, headers);
|
URLRequest request = new URLRequest(url, method, null, headers);
|
||||||
NavigationAction navigationAction = new NavigationAction(
|
NavigationAction navigationAction = new NavigationAction(
|
||||||
request,
|
request,
|
||||||
|
|
|
@ -0,0 +1,841 @@
|
||||||
|
package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.annotation.TargetApi;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.net.http.SslError;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.webkit.ClientCertRequest;
|
||||||
|
import android.webkit.CookieManager;
|
||||||
|
import android.webkit.CookieSyncManager;
|
||||||
|
import android.webkit.HttpAuthHandler;
|
||||||
|
import android.webkit.RenderProcessGoneDetail;
|
||||||
|
import android.webkit.SslErrorHandler;
|
||||||
|
import android.webkit.ValueCallback;
|
||||||
|
import android.webkit.WebResourceRequest;
|
||||||
|
import android.webkit.WebResourceResponse;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.webkit.SafeBrowsingResponseCompat;
|
||||||
|
import androidx.webkit.WebResourceErrorCompat;
|
||||||
|
import androidx.webkit.WebResourceRequestCompat;
|
||||||
|
import androidx.webkit.WebViewClientCompat;
|
||||||
|
import androidx.webkit.WebViewFeature;
|
||||||
|
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.Util;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.credential_database.CredentialDatabase;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserDelegate;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.JavaScriptBridgeJS;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.ClientCertChallenge;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.ClientCertResponse;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.CustomSchemeResponse;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.HttpAuthResponse;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.HttpAuthenticationChallenge;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.NavigationAction;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.NavigationActionPolicy;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.ServerTrustAuthResponse;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.ServerTrustChallenge;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.URLCredential;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.URLProtectionSpace;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.URLRequest;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.WebResourceErrorExt;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.WebResourceRequestExt;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.types.WebResourceResponseExt;
|
||||||
|
import com.pichillilorenzo.flutter_inappwebview.webview.WebViewChannelDelegate;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
|
||||||
|
public class InAppWebViewClientCompat extends WebViewClientCompat {
|
||||||
|
|
||||||
|
protected static final String LOG_TAG = "IAWebViewClientCompat";
|
||||||
|
private InAppBrowserDelegate inAppBrowserDelegate;
|
||||||
|
private static int previousAuthRequestFailureCount = 0;
|
||||||
|
private static List<URLCredential> credentialsProposed = null;
|
||||||
|
|
||||||
|
public InAppWebViewClientCompat(InAppBrowserDelegate inAppBrowserDelegate) {
|
||||||
|
super();
|
||||||
|
this.inAppBrowserDelegate = inAppBrowserDelegate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(@NonNull WebView view, @NonNull WebResourceRequest request) {
|
||||||
|
InAppWebView webView = (InAppWebView) view;
|
||||||
|
if (webView.customSettings.useShouldOverrideUrlLoading) {
|
||||||
|
boolean isRedirect = false;
|
||||||
|
if (WebViewFeature.isFeatureSupported(WebViewFeature.WEB_RESOURCE_REQUEST_IS_REDIRECT)) {
|
||||||
|
isRedirect = WebResourceRequestCompat.isRedirect(request);
|
||||||
|
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
isRedirect = request.isRedirect();
|
||||||
|
}
|
||||||
|
onShouldOverrideUrlLoading(
|
||||||
|
webView,
|
||||||
|
request.getUrl().toString(),
|
||||||
|
request.getMethod(),
|
||||||
|
request.getRequestHeaders(),
|
||||||
|
request.isForMainFrame(),
|
||||||
|
request.hasGesture(),
|
||||||
|
isRedirect);
|
||||||
|
if (webView.regexToCancelSubFramesLoadingCompiled != null) {
|
||||||
|
if (request.isForMainFrame())
|
||||||
|
return true;
|
||||||
|
else {
|
||||||
|
Matcher m = webView.regexToCancelSubFramesLoadingCompiled.matcher(request.getUrl().toString());
|
||||||
|
return m.matches();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 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.
|
||||||
|
return request.isForMainFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView webView, String url) {
|
||||||
|
InAppWebView inAppWebView = (InAppWebView) webView;
|
||||||
|
if (inAppWebView.customSettings.useShouldOverrideUrlLoading) {
|
||||||
|
onShouldOverrideUrlLoading(inAppWebView, url, "GET", null,true, false, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void allowShouldOverrideUrlLoading(WebView webView, String url,
|
||||||
|
@Nullable Map<String, String> headers,
|
||||||
|
boolean isForMainFrame) {
|
||||||
|
if (isForMainFrame) {
|
||||||
|
// There isn't any way to load an URL for a frame that is not the main frame,
|
||||||
|
// so call this only on main frame.
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
webView.loadUrl(url, headers);
|
||||||
|
else
|
||||||
|
webView.loadUrl(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void onShouldOverrideUrlLoading(final InAppWebView webView, final String url,
|
||||||
|
final String method,
|
||||||
|
@Nullable final Map<String, String> headers,
|
||||||
|
final boolean isForMainFrame, boolean hasGesture,
|
||||||
|
boolean isRedirect) {
|
||||||
|
URLRequest request = new URLRequest(url, method, null, headers);
|
||||||
|
NavigationAction navigationAction = new NavigationAction(
|
||||||
|
request,
|
||||||
|
isForMainFrame,
|
||||||
|
hasGesture,
|
||||||
|
isRedirect
|
||||||
|
);
|
||||||
|
|
||||||
|
final WebViewChannelDelegate.ShouldOverrideUrlLoadingCallback callback = new WebViewChannelDelegate.ShouldOverrideUrlLoadingCallback() {
|
||||||
|
@Override
|
||||||
|
public boolean nonNullSuccess(@NonNull NavigationActionPolicy result) {
|
||||||
|
switch (result) {
|
||||||
|
case ALLOW:
|
||||||
|
allowShouldOverrideUrlLoading(webView, url, headers, isForMainFrame);
|
||||||
|
break;
|
||||||
|
case CANCEL:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void defaultBehaviour(@Nullable NavigationActionPolicy result) {
|
||||||
|
allowShouldOverrideUrlLoading(webView, url, headers, isForMainFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void error(String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails) {
|
||||||
|
Log.e(LOG_TAG, errorCode + ", " + ((errorMessage != null) ? errorMessage : ""));
|
||||||
|
defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.shouldOverrideUrlLoading(navigationAction, callback);
|
||||||
|
} else {
|
||||||
|
callback.defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("RestrictedApi")
|
||||||
|
public void loadCustomJavaScriptOnPageStarted(WebView view) {
|
||||||
|
InAppWebView webView = (InAppWebView) view;
|
||||||
|
|
||||||
|
if (!WebViewFeature.isFeatureSupported(WebViewFeature.DOCUMENT_START_SCRIPT)) {
|
||||||
|
String source = webView.userContentController.generateWrappedCodeForDocumentStart();
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
webView.evaluateJavascript(source, (ValueCallback<String>) null);
|
||||||
|
} else {
|
||||||
|
webView.loadUrl("javascript:" + source.replaceAll("[\r\n]+", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadCustomJavaScriptOnPageFinished(WebView view) {
|
||||||
|
InAppWebView webView = (InAppWebView) view;
|
||||||
|
|
||||||
|
String source = webView.userContentController.generateWrappedCodeForDocumentEnd();
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
webView.evaluateJavascript(source, (ValueCallback<String>) null);
|
||||||
|
} else {
|
||||||
|
webView.loadUrl("javascript:" + source.replaceAll("[\r\n]+", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
webView.isLoading = true;
|
||||||
|
webView.disposeWebMessageChannels();
|
||||||
|
webView.userContentController.resetContentWorlds();
|
||||||
|
loadCustomJavaScriptOnPageStarted(webView);
|
||||||
|
|
||||||
|
super.onPageStarted(view, url, favicon);
|
||||||
|
|
||||||
|
if (inAppBrowserDelegate != null) {
|
||||||
|
inAppBrowserDelegate.didStartNavigation(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onLoadStart(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onPageFinished(WebView view, String url) {
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
webView.isLoading = false;
|
||||||
|
loadCustomJavaScriptOnPageFinished(webView);
|
||||||
|
previousAuthRequestFailureCount = 0;
|
||||||
|
credentialsProposed = null;
|
||||||
|
|
||||||
|
super.onPageFinished(view, url);
|
||||||
|
|
||||||
|
if (inAppBrowserDelegate != null) {
|
||||||
|
inAppBrowserDelegate.didFinishNavigation(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
// WebView not storing cookies reliable to local device storage
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
CookieManager.getInstance().flush();
|
||||||
|
} else {
|
||||||
|
CookieSyncManager.getInstance().sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
String js = JavaScriptBridgeJS.PLATFORM_READY_JS_SOURCE;
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
webView.evaluateJavascript(js, (ValueCallback<String>) null);
|
||||||
|
} else {
|
||||||
|
webView.loadUrl("javascript:" + js.replaceAll("[\r\n]+", ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onLoadStop(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doUpdateVisitedHistory(WebView view, String url, boolean isReload) {
|
||||||
|
super.doUpdateVisitedHistory(view, url, isReload);
|
||||||
|
|
||||||
|
// url argument sometimes doesn't contain the new changed URL, so we get it again from the webview.
|
||||||
|
url = view.getUrl();
|
||||||
|
|
||||||
|
if (inAppBrowserDelegate != null) {
|
||||||
|
inAppBrowserDelegate.didUpdateVisitedHistory(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onUpdateVisitedHistory(url, isReload);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||||
|
@Override
|
||||||
|
public void onReceivedError(@NonNull WebView view,
|
||||||
|
@NonNull WebResourceRequest request,
|
||||||
|
@NonNull WebResourceErrorCompat error) {
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
|
||||||
|
if (request.isForMainFrame()) {
|
||||||
|
if (webView.customSettings.disableDefaultErrorPage) {
|
||||||
|
webView.stopLoading();
|
||||||
|
webView.loadUrl("about:blank");
|
||||||
|
}
|
||||||
|
|
||||||
|
webView.isLoading = false;
|
||||||
|
previousAuthRequestFailureCount = 0;
|
||||||
|
credentialsProposed = null;
|
||||||
|
|
||||||
|
if (inAppBrowserDelegate != null) {
|
||||||
|
int type = -1;
|
||||||
|
if (WebViewFeature.isFeatureSupported(WebViewFeature.WEB_RESOURCE_ERROR_GET_CODE)) {
|
||||||
|
type = error.getErrorCode();
|
||||||
|
}
|
||||||
|
String description = "";
|
||||||
|
if (WebViewFeature.isFeatureSupported(WebViewFeature.WEB_RESOURCE_ERROR_GET_DESCRIPTION)) {
|
||||||
|
description = error.getDescription().toString();
|
||||||
|
}
|
||||||
|
inAppBrowserDelegate.didFailNavigation(request.getUrl().toString(), type, description);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onReceivedError(
|
||||||
|
WebResourceRequestExt.fromWebResourceRequest(request),
|
||||||
|
WebResourceErrorExt.fromWebResourceError(error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("RestrictedApi")
|
||||||
|
@Override
|
||||||
|
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
|
||||||
|
if (!WebViewFeature.isFeatureSupported(WebViewFeature.SUPPRESS_ERROR_PAGE) &&
|
||||||
|
webView.customSettings.disableDefaultErrorPage) {
|
||||||
|
webView.stopLoading();
|
||||||
|
webView.loadUrl("about:blank");
|
||||||
|
}
|
||||||
|
|
||||||
|
webView.isLoading = false;
|
||||||
|
previousAuthRequestFailureCount = 0;
|
||||||
|
credentialsProposed = null;
|
||||||
|
|
||||||
|
if (inAppBrowserDelegate != null) {
|
||||||
|
inAppBrowserDelegate.didFailNavigation(failingUrl, errorCode, description);
|
||||||
|
}
|
||||||
|
|
||||||
|
WebResourceRequestExt request = new WebResourceRequestExt(
|
||||||
|
failingUrl,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
"GET");
|
||||||
|
|
||||||
|
WebResourceErrorExt error = new WebResourceErrorExt(
|
||||||
|
errorCode,
|
||||||
|
description
|
||||||
|
);
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onReceivedError(
|
||||||
|
request,
|
||||||
|
error);
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onReceivedError(view, errorCode, description, failingUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||||
|
@Override
|
||||||
|
public void onReceivedHttpError(@NonNull WebView view,
|
||||||
|
@NonNull WebResourceRequest request,
|
||||||
|
@NonNull WebResourceResponse errorResponse) {
|
||||||
|
super.onReceivedHttpError(view, request, errorResponse);
|
||||||
|
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onReceivedHttpError(
|
||||||
|
WebResourceRequestExt.fromWebResourceRequest(request),
|
||||||
|
WebResourceResponseExt.fromWebResourceResponse(errorResponse));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedHttpAuthRequest(final WebView view, final HttpAuthHandler handler, final String host, final String realm) {
|
||||||
|
final String url = view.getUrl();
|
||||||
|
String protocol = "https";
|
||||||
|
int port = 0;
|
||||||
|
|
||||||
|
if (url != null) {
|
||||||
|
try {
|
||||||
|
URI uri = new URI(url);
|
||||||
|
protocol = uri.getScheme();
|
||||||
|
port = uri.getPort();
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
previousAuthRequestFailureCount++;
|
||||||
|
|
||||||
|
if (credentialsProposed == null)
|
||||||
|
credentialsProposed = CredentialDatabase.getInstance(view.getContext()).getHttpAuthCredentials(host, protocol, realm, port);
|
||||||
|
|
||||||
|
URLCredential credentialProposed = null;
|
||||||
|
if (credentialsProposed != null && credentialsProposed.size() > 0) {
|
||||||
|
credentialProposed = credentialsProposed.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
URLProtectionSpace protectionSpace = new URLProtectionSpace(host, protocol, realm, port, view.getCertificate(), null);
|
||||||
|
HttpAuthenticationChallenge challenge = new HttpAuthenticationChallenge(protectionSpace, previousAuthRequestFailureCount, credentialProposed);
|
||||||
|
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
final String finalProtocol = protocol;
|
||||||
|
final int finalPort = port;
|
||||||
|
final WebViewChannelDelegate.ReceivedHttpAuthRequestCallback callback = new WebViewChannelDelegate.ReceivedHttpAuthRequestCallback() {
|
||||||
|
@Override
|
||||||
|
public boolean nonNullSuccess(@NonNull HttpAuthResponse response) {
|
||||||
|
Integer action = response.getAction();
|
||||||
|
if (action != null) {
|
||||||
|
switch (action) {
|
||||||
|
case 1:
|
||||||
|
String username = response.getUsername();
|
||||||
|
String password = response.getPassword();
|
||||||
|
boolean permanentPersistence = response.isPermanentPersistence();
|
||||||
|
if (permanentPersistence) {
|
||||||
|
CredentialDatabase.getInstance(view.getContext())
|
||||||
|
.setHttpAuthCredential(host, finalProtocol, realm, finalPort, username, password);
|
||||||
|
}
|
||||||
|
handler.proceed(username, password);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (credentialsProposed.size() > 0) {
|
||||||
|
URLCredential credential = credentialsProposed.remove(0);
|
||||||
|
handler.proceed(credential.getUsername(), credential.getPassword());
|
||||||
|
} else {
|
||||||
|
handler.cancel();
|
||||||
|
}
|
||||||
|
// used custom CredentialDatabase!
|
||||||
|
// handler.useHttpAuthUsernamePassword();
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
credentialsProposed = null;
|
||||||
|
previousAuthRequestFailureCount = 0;
|
||||||
|
handler.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void defaultBehaviour(@Nullable HttpAuthResponse result) {
|
||||||
|
InAppWebViewClientCompat.super.onReceivedHttpAuthRequest(view, handler, host, realm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void error(String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails) {
|
||||||
|
Log.e(LOG_TAG, errorCode + ", " + ((errorMessage != null) ? errorMessage : ""));
|
||||||
|
defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onReceivedHttpAuthRequest(challenge, callback);
|
||||||
|
} else {
|
||||||
|
callback.defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedSslError(final WebView view, final SslErrorHandler handler, final SslError sslError) {
|
||||||
|
final String url = sslError.getUrl();
|
||||||
|
String host = "";
|
||||||
|
String protocol = "https";
|
||||||
|
int port = 0;
|
||||||
|
|
||||||
|
try {
|
||||||
|
URI uri = new URI(url);
|
||||||
|
host = uri.getHost();
|
||||||
|
protocol = uri.getScheme();
|
||||||
|
port = uri.getPort();
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
URLProtectionSpace protectionSpace = new URLProtectionSpace(host, protocol, null, port, sslError.getCertificate(), sslError);
|
||||||
|
ServerTrustChallenge challenge = new ServerTrustChallenge(protectionSpace);
|
||||||
|
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
final WebViewChannelDelegate.ReceivedServerTrustAuthRequestCallback callback = new WebViewChannelDelegate.ReceivedServerTrustAuthRequestCallback() {
|
||||||
|
@Override
|
||||||
|
public boolean nonNullSuccess(@NonNull ServerTrustAuthResponse response) {
|
||||||
|
Integer action = response.getAction();
|
||||||
|
if (action != null) {
|
||||||
|
switch (action) {
|
||||||
|
case 1:
|
||||||
|
handler.proceed();
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
handler.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void defaultBehaviour(@Nullable ServerTrustAuthResponse result) {
|
||||||
|
InAppWebViewClientCompat.super.onReceivedSslError(view, handler, sslError);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void error(String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails) {
|
||||||
|
Log.e(LOG_TAG, errorCode + ", " + ((errorMessage != null) ? errorMessage : ""));
|
||||||
|
defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onReceivedServerTrustAuthRequest(challenge, callback);
|
||||||
|
} else {
|
||||||
|
callback.defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
@Override
|
||||||
|
public void onReceivedClientCertRequest(final WebView view, final ClientCertRequest request) {
|
||||||
|
final String url = view.getUrl();
|
||||||
|
final String host = request.getHost();
|
||||||
|
String protocol = "https";
|
||||||
|
final int port = request.getPort();
|
||||||
|
|
||||||
|
if (url != null) {
|
||||||
|
try {
|
||||||
|
URI uri = new URI(url);
|
||||||
|
protocol = uri.getScheme();
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
URLProtectionSpace protectionSpace = new URLProtectionSpace(host, protocol, null, port, view.getCertificate(), null);
|
||||||
|
ClientCertChallenge challenge = new ClientCertChallenge(protectionSpace, request.getPrincipals(), request.getKeyTypes());
|
||||||
|
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
final WebViewChannelDelegate.ReceivedClientCertRequestCallback callback = new WebViewChannelDelegate.ReceivedClientCertRequestCallback() {
|
||||||
|
@Override
|
||||||
|
public boolean nonNullSuccess(@NonNull ClientCertResponse response) {
|
||||||
|
Integer action = response.getAction();
|
||||||
|
if (action != null && webView.plugin != null) {
|
||||||
|
switch (action) {
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
String certificatePath = (String) response.getCertificatePath();
|
||||||
|
String certificatePassword = (String) response.getCertificatePassword();
|
||||||
|
String keyStoreType = (String) response.getKeyStoreType();
|
||||||
|
Util.PrivateKeyAndCertificates privateKeyAndCertificates =
|
||||||
|
Util.loadPrivateKeyAndCertificate(webView.plugin, certificatePath, certificatePassword, keyStoreType);
|
||||||
|
if (privateKeyAndCertificates != null) {
|
||||||
|
request.proceed(privateKeyAndCertificates.privateKey, privateKeyAndCertificates.certificates);
|
||||||
|
} else {
|
||||||
|
request.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
request.ignore();
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
request.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void defaultBehaviour(@Nullable ClientCertResponse result) {
|
||||||
|
InAppWebViewClientCompat.super.onReceivedClientCertRequest(view, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void error(String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails) {
|
||||||
|
Log.e(LOG_TAG, errorCode + ", " + ((errorMessage != null) ? errorMessage : ""));
|
||||||
|
defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onReceivedClientCertRequest(challenge, callback);
|
||||||
|
} else {
|
||||||
|
callback.defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScaleChanged(WebView view, float oldScale, float newScale) {
|
||||||
|
super.onScaleChanged(view, oldScale, newScale);
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
webView.zoomScale = newScale / Util.getPixelDensity(webView.getContext());
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onZoomScaleChanged(oldScale, newScale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.O_MR1)
|
||||||
|
@Override
|
||||||
|
public void onSafeBrowsingHit(@NonNull final WebView view,
|
||||||
|
@NonNull final WebResourceRequest request,
|
||||||
|
final int threatType,
|
||||||
|
@NonNull final SafeBrowsingResponseCompat callback) {
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
final WebViewChannelDelegate.SafeBrowsingHitCallback resultCallback = new WebViewChannelDelegate.SafeBrowsingHitCallback() {
|
||||||
|
@Override
|
||||||
|
public boolean nonNullSuccess(@NonNull com.pichillilorenzo.flutter_inappwebview.types.SafeBrowsingResponse response) {
|
||||||
|
Integer action = response.getAction();
|
||||||
|
if (action != null) {
|
||||||
|
boolean report = response.isReport();
|
||||||
|
switch (action) {
|
||||||
|
case 0:
|
||||||
|
if (WebViewFeature.isFeatureSupported(WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY)) {
|
||||||
|
callback.backToSafety(report);
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (WebViewFeature.isFeatureSupported(WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED)) {
|
||||||
|
callback.proceed(report);
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
default:
|
||||||
|
if (WebViewFeature.isFeatureSupported(WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL)) {
|
||||||
|
callback.showInterstitial(report);
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void defaultBehaviour(@Nullable com.pichillilorenzo.flutter_inappwebview.types.SafeBrowsingResponse result) {
|
||||||
|
InAppWebViewClientCompat.super.onSafeBrowsingHit(view, request, threatType, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void error(String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails) {
|
||||||
|
Log.e(LOG_TAG, errorCode + ", " + ((errorMessage != null) ? errorMessage : ""));
|
||||||
|
defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onSafeBrowsingHit(request.getUrl().toString(), threatType, resultCallback);
|
||||||
|
} else {
|
||||||
|
resultCallback.defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequestExt request) {
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
|
||||||
|
if (webView.webViewAssetLoaderExt != null && webView.webViewAssetLoaderExt.loader != null) {
|
||||||
|
try {
|
||||||
|
final Uri uri = Uri.parse(request.getUrl());
|
||||||
|
WebResourceResponse webResourceResponse = webView.webViewAssetLoaderExt.loader.shouldInterceptRequest(uri);
|
||||||
|
if (webResourceResponse != null) {
|
||||||
|
return webResourceResponse;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (webView.customSettings.useShouldInterceptRequest) {
|
||||||
|
WebResourceResponseExt response = null;
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
try {
|
||||||
|
response = webView.channelDelegate.shouldInterceptRequest(request);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response != null) {
|
||||||
|
String contentType = response.getContentType();
|
||||||
|
String contentEncoding = response.getContentEncoding();
|
||||||
|
byte[] data = response.getData();
|
||||||
|
Map<String, String> responseHeaders = response.getHeaders();
|
||||||
|
Integer statusCode = response.getStatusCode();
|
||||||
|
String reasonPhrase = response.getReasonPhrase();
|
||||||
|
|
||||||
|
ByteArrayInputStream inputStream = (data != null) ? new ByteArrayInputStream(data) : null;
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && statusCode != null && reasonPhrase != null) {
|
||||||
|
return new WebResourceResponse(contentType, contentEncoding, statusCode, reasonPhrase, responseHeaders, inputStream);
|
||||||
|
} else {
|
||||||
|
return new WebResourceResponse(contentType, contentEncoding, inputStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String url = request.getUrl();
|
||||||
|
String scheme = url.split(":")[0].toLowerCase();
|
||||||
|
try {
|
||||||
|
scheme = Uri.parse(request.getUrl()).getScheme();
|
||||||
|
} catch (Exception ignored) {}
|
||||||
|
|
||||||
|
if (webView.customSettings.resourceCustomSchemes != null && webView.customSettings.resourceCustomSchemes.contains(scheme)) {
|
||||||
|
CustomSchemeResponse customSchemeResponse = null;
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
try {
|
||||||
|
customSchemeResponse = webView.channelDelegate.onLoadResourceWithCustomScheme(request);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (customSchemeResponse != null) {
|
||||||
|
WebResourceResponse response = null;
|
||||||
|
try {
|
||||||
|
response = webView.contentBlockerHandler.checkUrl(webView, request, customSchemeResponse.getContentType());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
if (response != null)
|
||||||
|
return response;
|
||||||
|
return new WebResourceResponse(customSchemeResponse.getContentType(),
|
||||||
|
customSchemeResponse.getContentType(),
|
||||||
|
new ByteArrayInputStream(customSchemeResponse.getData()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WebResourceResponse response = null;
|
||||||
|
if (webView.contentBlockerHandler.getRuleList().size() > 0) {
|
||||||
|
try {
|
||||||
|
response = webView.contentBlockerHandler.checkUrl(webView, request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WebResourceResponse shouldInterceptRequest(WebView view, final String url) {
|
||||||
|
WebResourceRequestExt requestExt = new WebResourceRequestExt(
|
||||||
|
url, null, false,
|
||||||
|
false, true, "GET"
|
||||||
|
);
|
||||||
|
return shouldInterceptRequest(view, requestExt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
@Override
|
||||||
|
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
|
||||||
|
WebResourceRequestExt requestExt = WebResourceRequestExt.fromWebResourceRequest(request);
|
||||||
|
return shouldInterceptRequest(view, requestExt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFormResubmission(final WebView view, final Message dontResend, final Message resend) {
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
final WebViewChannelDelegate.FormResubmissionCallback callback = new WebViewChannelDelegate.FormResubmissionCallback() {
|
||||||
|
@Override
|
||||||
|
public boolean nonNullSuccess(@NonNull Integer action) {
|
||||||
|
switch (action) {
|
||||||
|
case 0:
|
||||||
|
resend.sendToTarget();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
default:
|
||||||
|
dontResend.sendToTarget();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void defaultBehaviour(@Nullable Integer result) {
|
||||||
|
InAppWebViewClientCompat.super.onFormResubmission(view, dontResend, resend);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void error(String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails) {
|
||||||
|
Log.e(LOG_TAG, errorCode + ", " + ((errorMessage != null) ? errorMessage : ""));
|
||||||
|
defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onFormResubmission(webView.getUrl(), callback);
|
||||||
|
} else {
|
||||||
|
callback.defaultBehaviour(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageCommitVisible(@NonNull WebView view, @NonNull String url) {
|
||||||
|
super.onPageCommitVisible(view, url);
|
||||||
|
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onPageCommitVisible(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
|
@Override
|
||||||
|
public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) {
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
|
||||||
|
if (webView.customSettings.useOnRenderProcessGone && webView.channelDelegate != null) {
|
||||||
|
boolean didCrash = detail.didCrash();
|
||||||
|
int rendererPriorityAtExit = detail.rendererPriorityAtExit();
|
||||||
|
webView.channelDelegate.onRenderProcessGone(didCrash, rendererPriorityAtExit);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onRenderProcessGone(view, detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedLoginRequest(WebView view, String realm, String account, String args) {
|
||||||
|
final InAppWebView webView = (InAppWebView) view;
|
||||||
|
if (webView.channelDelegate != null) {
|
||||||
|
webView.channelDelegate.onReceivedLoginRequest(realm, account, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUnhandledKeyEvent(WebView view, KeyEvent event) {}
|
||||||
|
|
||||||
|
public void dispose() {
|
||||||
|
if (inAppBrowserDelegate != null) {
|
||||||
|
inAppBrowserDelegate = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -33,6 +33,8 @@ public class WebMessageListener implements Disposable {
|
||||||
protected static final String LOG_TAG = "WebMessageListener";
|
protected static final String LOG_TAG = "WebMessageListener";
|
||||||
public static final String METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_web_message_listener_";
|
public static final String METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_web_message_listener_";
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public String id;
|
||||||
public String jsObjectName;
|
public String jsObjectName;
|
||||||
public Set<String> allowedOriginRules;
|
public Set<String> allowedOriginRules;
|
||||||
public WebViewCompat.WebMessageListener listener;
|
public WebViewCompat.WebMessageListener listener;
|
||||||
|
@ -42,12 +44,14 @@ public class WebMessageListener implements Disposable {
|
||||||
@Nullable
|
@Nullable
|
||||||
public WebMessageListenerChannelDelegate channelDelegate;
|
public WebMessageListenerChannelDelegate channelDelegate;
|
||||||
|
|
||||||
public WebMessageListener(@NonNull InAppWebViewInterface webView, @NonNull BinaryMessenger messenger,
|
public WebMessageListener(@NonNull String id,
|
||||||
|
@NonNull InAppWebViewInterface webView, @NonNull BinaryMessenger messenger,
|
||||||
@NonNull String jsObjectName, @NonNull Set<String> allowedOriginRules) {
|
@NonNull String jsObjectName, @NonNull Set<String> allowedOriginRules) {
|
||||||
|
this.id = id;
|
||||||
this.webView = webView;
|
this.webView = webView;
|
||||||
this.jsObjectName = jsObjectName;
|
this.jsObjectName = jsObjectName;
|
||||||
this.allowedOriginRules = allowedOriginRules;
|
this.allowedOriginRules = allowedOriginRules;
|
||||||
final MethodChannel channel = new MethodChannel(messenger, METHOD_CHANNEL_NAME_PREFIX + this.jsObjectName);
|
final MethodChannel channel = new MethodChannel(messenger, METHOD_CHANNEL_NAME_PREFIX + this.id + "_" + this.jsObjectName);
|
||||||
this.channelDelegate = new WebMessageListenerChannelDelegate(this, channel);
|
this.channelDelegate = new WebMessageListenerChannelDelegate(this, channel);
|
||||||
|
|
||||||
if (this.webView instanceof InAppWebView) {
|
if (this.webView instanceof InAppWebView) {
|
||||||
|
@ -107,12 +111,13 @@ public class WebMessageListener implements Disposable {
|
||||||
if (map == null) {
|
if (map == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
String id = (String) map.get("id");
|
||||||
String jsObjectName = (String) map.get("jsObjectName");
|
String jsObjectName = (String) map.get("jsObjectName");
|
||||||
assert jsObjectName != null;
|
assert jsObjectName != null;
|
||||||
List<String> allowedOriginRuleList = (List<String>) map.get("allowedOriginRules");
|
List<String> allowedOriginRuleList = (List<String>) map.get("allowedOriginRules");
|
||||||
assert allowedOriginRuleList != null;
|
assert allowedOriginRuleList != null;
|
||||||
Set<String> allowedOriginRules = new HashSet<>(allowedOriginRuleList);
|
Set<String> allowedOriginRules = new HashSet<>(allowedOriginRuleList);
|
||||||
return new WebMessageListener(webView, messenger, jsObjectName, allowedOriginRules);
|
return new WebMessageListener(id, webView, messenger, jsObjectName, allowedOriginRules);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assertOriginRulesValid() throws Exception {
|
public void assertOriginRulesValid() throws Exception {
|
||||||
|
|
|
@ -45,10 +45,16 @@ class ExchangeableEnumGenerator
|
||||||
}
|
}
|
||||||
classBuffer.writeln('class $extClassName {');
|
classBuffer.writeln('class $extClassName {');
|
||||||
|
|
||||||
final FieldElement enumValue = visitor.fields.entries
|
final fieldEntriesSorted = visitor.fields.entries.toList();
|
||||||
|
fieldEntriesSorted.sort((a, b) => a.key.compareTo(b.key));
|
||||||
|
|
||||||
|
final methodEntriesSorted = visitor.methods.entries.toList();
|
||||||
|
fieldEntriesSorted.sort((a, b) => a.key.compareTo(b.key));
|
||||||
|
|
||||||
|
final FieldElement enumValue = fieldEntriesSorted
|
||||||
.firstWhere((element) => element.key == "_value")
|
.firstWhere((element) => element.key == "_value")
|
||||||
.value;
|
.value;
|
||||||
final FieldElement enumNativeValue = visitor.fields.entries
|
final FieldElement enumNativeValue = fieldEntriesSorted
|
||||||
.firstWhere((element) => element.key == "_nativeValue",
|
.firstWhere((element) => element.key == "_nativeValue",
|
||||||
orElse: () => MapEntry("_nativeValue", enumValue))
|
orElse: () => MapEntry("_nativeValue", enumValue))
|
||||||
.value;
|
.value;
|
||||||
|
@ -62,7 +68,7 @@ class ExchangeableEnumGenerator
|
||||||
classBuffer.writeln(
|
classBuffer.writeln(
|
||||||
"factory $extClassName._internalMultiPlatform(${enumValue.type} value, Function nativeValue) => $extClassName._internal(value, nativeValue());");
|
"factory $extClassName._internalMultiPlatform(${enumValue.type} value, Function nativeValue) => $extClassName._internal(value, nativeValue());");
|
||||||
|
|
||||||
for (final entry in visitor.fields.entries) {
|
for (final entry in fieldEntriesSorted) {
|
||||||
final fieldName = entry.key;
|
final fieldName = entry.key;
|
||||||
final fieldElement = entry.value;
|
final fieldElement = entry.value;
|
||||||
if (fieldName == "_value" || fieldName == "_nativeValue") {
|
if (fieldName == "_value" || fieldName == "_nativeValue") {
|
||||||
|
@ -176,7 +182,7 @@ class ExchangeableEnumGenerator
|
||||||
if (annotation.read("valuesProperty").boolValue) {
|
if (annotation.read("valuesProperty").boolValue) {
|
||||||
classBuffer.writeln('///Set of all values of [$extClassName].');
|
classBuffer.writeln('///Set of all values of [$extClassName].');
|
||||||
classBuffer.writeln('static final Set<$extClassName> values = [');
|
classBuffer.writeln('static final Set<$extClassName> values = [');
|
||||||
for (final entry in visitor.fields.entries) {
|
for (final entry in fieldEntriesSorted) {
|
||||||
final fieldName = entry.key;
|
final fieldName = entry.key;
|
||||||
final fieldElement = entry.value;
|
final fieldElement = entry.value;
|
||||||
final isEnumCustomValue = _coreCheckerEnumCustomValue
|
final isEnumCustomValue = _coreCheckerEnumCustomValue
|
||||||
|
@ -228,7 +234,7 @@ class ExchangeableEnumGenerator
|
||||||
""");
|
""");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final entry in visitor.methods.entries) {
|
for (final entry in methodEntriesSorted) {
|
||||||
final methodElement = entry.value;
|
final methodElement = entry.value;
|
||||||
if (Util.methodHasIgnore(methodElement)) {
|
if (Util.methodHasIgnore(methodElement)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -301,7 +307,7 @@ class ExchangeableEnumGenerator
|
||||||
classBuffer.writeln('return _value;');
|
classBuffer.writeln('return _value;');
|
||||||
} else {
|
} else {
|
||||||
classBuffer.writeln('switch(_value) {');
|
classBuffer.writeln('switch(_value) {');
|
||||||
for (final entry in visitor.fields.entries) {
|
for (final entry in fieldEntriesSorted) {
|
||||||
final fieldName = entry.key;
|
final fieldName = entry.key;
|
||||||
final fieldElement = entry.value;
|
final fieldElement = entry.value;
|
||||||
if (!fieldElement.isPrivate && fieldElement.isStatic) {
|
if (!fieldElement.isPrivate && fieldElement.isStatic) {
|
||||||
|
|
|
@ -67,7 +67,17 @@ class ExchangeableObjectGenerator
|
||||||
final deprecatedFields = <VariableElement>[];
|
final deprecatedFields = <VariableElement>[];
|
||||||
final constructorFields = <String>[];
|
final constructorFields = <String>[];
|
||||||
final superConstructorFields = <String>[];
|
final superConstructorFields = <String>[];
|
||||||
for (final entry in visitor.fields.entries) {
|
|
||||||
|
final fieldEntriesSorted = visitor.fields.entries.toList();
|
||||||
|
fieldEntriesSorted.sort((a, b) => a.key.compareTo(b.key));
|
||||||
|
|
||||||
|
final fieldValuesSorted = visitor.fields.values.toList();
|
||||||
|
fieldValuesSorted.sort((a, b) => a.name.compareTo(b.name));
|
||||||
|
|
||||||
|
final methodEntriesSorted = visitor.methods.entries.toList();
|
||||||
|
fieldEntriesSorted.sort((a, b) => a.key.compareTo(b.key));
|
||||||
|
|
||||||
|
for (final entry in fieldEntriesSorted) {
|
||||||
final fieldName = entry.key;
|
final fieldName = entry.key;
|
||||||
final fieldElement = entry.value;
|
final fieldElement = entry.value;
|
||||||
if (!fieldElement.isPrivate) {
|
if (!fieldElement.isPrivate) {
|
||||||
|
@ -295,7 +305,7 @@ class ExchangeableObjectGenerator
|
||||||
if (superClass != null) {
|
if (superClass != null) {
|
||||||
fieldElements.addAll(superClass.element2.fields);
|
fieldElements.addAll(superClass.element2.fields);
|
||||||
}
|
}
|
||||||
fieldElements.addAll(visitor.fields.values);
|
fieldElements.addAll(fieldValuesSorted);
|
||||||
final nonRequiredFields = <String>[];
|
final nonRequiredFields = <String>[];
|
||||||
final requiredFields = <String>[];
|
final requiredFields = <String>[];
|
||||||
for (final fieldElement in fieldElements) {
|
for (final fieldElement in fieldElements) {
|
||||||
|
@ -353,7 +363,7 @@ class ExchangeableObjectGenerator
|
||||||
classBuffer.writeln('}');
|
classBuffer.writeln('}');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final entry in visitor.methods.entries) {
|
for (final entry in methodEntriesSorted) {
|
||||||
final methodElement = entry.value;
|
final methodElement = entry.value;
|
||||||
if (Util.methodHasIgnore(methodElement)) {
|
if (Util.methodHasIgnore(methodElement)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -382,7 +392,7 @@ class ExchangeableObjectGenerator
|
||||||
classBuffer.writeln('///Converts instance to a map.');
|
classBuffer.writeln('///Converts instance to a map.');
|
||||||
classBuffer.writeln('Map<String, dynamic> toMap() {');
|
classBuffer.writeln('Map<String, dynamic> toMap() {');
|
||||||
classBuffer.writeln('return {');
|
classBuffer.writeln('return {');
|
||||||
for (final entry in visitor.methods.entries) {
|
for (final entry in methodEntriesSorted) {
|
||||||
final methodElement = entry.value;
|
final methodElement = entry.value;
|
||||||
final toMapMergeWith = _coreCheckerObjectMethod
|
final toMapMergeWith = _coreCheckerObjectMethod
|
||||||
.firstAnnotationOf(methodElement)
|
.firstAnnotationOf(methodElement)
|
||||||
|
@ -403,7 +413,7 @@ class ExchangeableObjectGenerator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (final entry in visitor.fields.entries) {
|
for (final entry in fieldEntriesSorted) {
|
||||||
final fieldElement = entry.value;
|
final fieldElement = entry.value;
|
||||||
if (!fieldElement.isPrivate &&
|
if (!fieldElement.isPrivate &&
|
||||||
!fieldElement.hasDeprecated &&
|
!fieldElement.hasDeprecated &&
|
||||||
|
@ -475,7 +485,7 @@ class ExchangeableObjectGenerator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (final entry in visitor.fields.entries) {
|
for (final entry in fieldEntriesSorted) {
|
||||||
final fieldName = entry.key;
|
final fieldName = entry.key;
|
||||||
final fieldElement = entry.value;
|
final fieldElement = entry.value;
|
||||||
if (!fieldElement.isPrivate &&
|
if (!fieldElement.isPrivate &&
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
export "FLUTTER_ROOT=/Users/lorenzopichilli/fvm/versions/3.3.6"
|
export "FLUTTER_ROOT=/Users/lorenzopichilli/fvm/versions/3.3.6"
|
||||||
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
|
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
|
||||||
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
||||||
export "FLUTTER_TARGET=lib/main.dart"
|
export "FLUTTER_TARGET=integration_test/webview_flutter_test.dart"
|
||||||
export "FLUTTER_BUILD_DIR=build"
|
export "FLUTTER_BUILD_DIR=build"
|
||||||
export "FLUTTER_BUILD_NAME=1.0.0"
|
export "FLUTTER_BUILD_NAME=1.0.0"
|
||||||
export "FLUTTER_BUILD_NUMBER=1"
|
export "FLUTTER_BUILD_NUMBER=1"
|
||||||
|
export "DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
|
||||||
export "DART_OBFUSCATION=false"
|
export "DART_OBFUSCATION=false"
|
||||||
export "TRACK_WIDGET_CREATION=true"
|
export "TRACK_WIDGET_CREATION=true"
|
||||||
export "TREE_SHAKE_ICONS=false"
|
export "TREE_SHAKE_ICONS=false"
|
||||||
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
|
export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json"
|
||||||
|
|
|
@ -10,16 +10,18 @@ import WebKit
|
||||||
|
|
||||||
public class WebMessageListener : FlutterMethodCallDelegate {
|
public class WebMessageListener : FlutterMethodCallDelegate {
|
||||||
static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_web_message_listener_"
|
static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_web_message_listener_"
|
||||||
|
var id: String
|
||||||
var jsObjectName: String
|
var jsObjectName: String
|
||||||
var allowedOriginRules: Set<String>
|
var allowedOriginRules: Set<String>
|
||||||
var channelDelegate: WebMessageListenerChannelDelegate?
|
var channelDelegate: WebMessageListenerChannelDelegate?
|
||||||
weak var webView: InAppWebView?
|
weak var webView: InAppWebView?
|
||||||
|
|
||||||
public init(jsObjectName: String, allowedOriginRules: Set<String>) {
|
public init(id: String, jsObjectName: String, allowedOriginRules: Set<String>) {
|
||||||
|
self.id = id
|
||||||
self.jsObjectName = jsObjectName
|
self.jsObjectName = jsObjectName
|
||||||
self.allowedOriginRules = allowedOriginRules
|
self.allowedOriginRules = allowedOriginRules
|
||||||
super.init()
|
super.init()
|
||||||
let channel = FlutterMethodChannel(name: WebMessageListener.METHOD_CHANNEL_NAME_PREFIX + self.jsObjectName,
|
let channel = FlutterMethodChannel(name: WebMessageListener.METHOD_CHANNEL_NAME_PREFIX + self.id + "_" + self.jsObjectName,
|
||||||
binaryMessenger: SwiftFlutterPlugin.instance!.registrar!.messenger())
|
binaryMessenger: SwiftFlutterPlugin.instance!.registrar!.messenger())
|
||||||
self.channelDelegate = WebMessageListenerChannelDelegate(webMessageListener: self, channel: channel)
|
self.channelDelegate = WebMessageListenerChannelDelegate(webMessageListener: self, channel: channel)
|
||||||
}
|
}
|
||||||
|
@ -101,7 +103,7 @@ public class WebMessageListener : FlutterMethodCallDelegate {
|
||||||
})();
|
})();
|
||||||
"""
|
"""
|
||||||
webView.configuration.userContentController.addPluginScript(PluginScript(
|
webView.configuration.userContentController.addPluginScript(PluginScript(
|
||||||
groupName: "WebMessageListener-" + jsObjectName,
|
groupName: "WebMessageListener-" + id + "-" + jsObjectName,
|
||||||
source: source,
|
source: source,
|
||||||
injectionTime: .atDocumentStart,
|
injectionTime: .atDocumentStart,
|
||||||
forMainFrameOnly: false,
|
forMainFrameOnly: false,
|
||||||
|
@ -117,6 +119,7 @@ public class WebMessageListener : FlutterMethodCallDelegate {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return WebMessageListener(
|
return WebMessageListener(
|
||||||
|
id: map["id"] as! String,
|
||||||
jsObjectName: map["jsObjectName"] as! String,
|
jsObjectName: map["jsObjectName"] as! String,
|
||||||
allowedOriginRules: Set(map["allowedOriginRules"] as! [String])
|
allowedOriginRules: Set(map["allowedOriginRules"] as! [String])
|
||||||
)
|
)
|
||||||
|
|
|
@ -81,9 +81,9 @@ class WebViewAssetLoader {
|
||||||
///
|
///
|
||||||
///Implement this interface to handle other use-cases according to your app's needs.
|
///Implement this interface to handle other use-cases according to your app's needs.
|
||||||
abstract class PathHandler {
|
abstract class PathHandler {
|
||||||
late final String _type;
|
|
||||||
late final String _id;
|
|
||||||
late final MethodChannel _channel;
|
late final MethodChannel _channel;
|
||||||
|
late final String _id;
|
||||||
|
late final String _type;
|
||||||
|
|
||||||
///The suffix path to be handled.
|
///The suffix path to be handled.
|
||||||
///
|
///
|
||||||
|
|
|
@ -18,8 +18,10 @@ class WebViewFeature {
|
||||||
factory WebViewFeature._internalMultiPlatform(
|
factory WebViewFeature._internalMultiPlatform(
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
WebViewFeature._internal(value, nativeValue());
|
WebViewFeature._internal(value, nativeValue());
|
||||||
static const _channel = const MethodChannel(
|
|
||||||
'com.pichillilorenzo/flutter_inappwebview_webviewfeature');
|
///This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed].
|
||||||
|
static const ALGORITHMIC_DARKENING = WebViewFeature._internal(
|
||||||
|
'ALGORITHMIC_DARKENING', 'ALGORITHMIC_DARKENING');
|
||||||
|
|
||||||
///This feature covers [InAppWebViewController.createWebMessageChannel].
|
///This feature covers [InAppWebViewController.createWebMessageChannel].
|
||||||
static const CREATE_WEB_MESSAGE_CHANNEL = WebViewFeature._internal(
|
static const CREATE_WEB_MESSAGE_CHANNEL = WebViewFeature._internal(
|
||||||
|
@ -29,6 +31,15 @@ class WebViewFeature {
|
||||||
static const DISABLED_ACTION_MODE_MENU_ITEMS = WebViewFeature._internal(
|
static const DISABLED_ACTION_MODE_MENU_ITEMS = WebViewFeature._internal(
|
||||||
'DISABLED_ACTION_MODE_MENU_ITEMS', 'DISABLED_ACTION_MODE_MENU_ITEMS');
|
'DISABLED_ACTION_MODE_MENU_ITEMS', 'DISABLED_ACTION_MODE_MENU_ITEMS');
|
||||||
|
|
||||||
|
///This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START].
|
||||||
|
static const DOCUMENT_START_SCRIPT = WebViewFeature._internal(
|
||||||
|
'DOCUMENT_START_SCRIPT', 'DOCUMENT_START_SCRIPT');
|
||||||
|
|
||||||
|
///This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled].
|
||||||
|
static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY =
|
||||||
|
WebViewFeature._internal('ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY',
|
||||||
|
'ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY');
|
||||||
|
|
||||||
///This feature covers [InAppWebViewSettings.forceDark].
|
///This feature covers [InAppWebViewSettings.forceDark].
|
||||||
static const FORCE_DARK =
|
static const FORCE_DARK =
|
||||||
WebViewFeature._internal('FORCE_DARK', 'FORCE_DARK');
|
WebViewFeature._internal('FORCE_DARK', 'FORCE_DARK');
|
||||||
|
@ -37,6 +48,10 @@ class WebViewFeature {
|
||||||
static const FORCE_DARK_STRATEGY =
|
static const FORCE_DARK_STRATEGY =
|
||||||
WebViewFeature._internal('FORCE_DARK_STRATEGY', 'FORCE_DARK_STRATEGY');
|
WebViewFeature._internal('FORCE_DARK_STRATEGY', 'FORCE_DARK_STRATEGY');
|
||||||
|
|
||||||
|
///This feature covers [InAppWebViewController.getVariationsHeader].
|
||||||
|
static const GET_VARIATIONS_HEADER = WebViewFeature._internal(
|
||||||
|
'GET_VARIATIONS_HEADER', 'GET_VARIATIONS_HEADER');
|
||||||
|
|
||||||
///
|
///
|
||||||
static const GET_WEB_CHROME_CLIENT = WebViewFeature._internal(
|
static const GET_WEB_CHROME_CLIENT = WebViewFeature._internal(
|
||||||
'GET_WEB_CHROME_CLIENT', 'GET_WEB_CHROME_CLIENT');
|
'GET_WEB_CHROME_CLIENT', 'GET_WEB_CHROME_CLIENT');
|
||||||
|
@ -77,6 +92,10 @@ class WebViewFeature {
|
||||||
static const RECEIVE_WEB_RESOURCE_ERROR = WebViewFeature._internal(
|
static const RECEIVE_WEB_RESOURCE_ERROR = WebViewFeature._internal(
|
||||||
'RECEIVE_WEB_RESOURCE_ERROR', 'RECEIVE_WEB_RESOURCE_ERROR');
|
'RECEIVE_WEB_RESOURCE_ERROR', 'RECEIVE_WEB_RESOURCE_ERROR');
|
||||||
|
|
||||||
|
///This feature covers [InAppWebViewSettings.requestedWithHeaderMode].
|
||||||
|
static const REQUESTED_WITH_HEADER_CONTROL = WebViewFeature._internal(
|
||||||
|
'REQUESTED_WITH_HEADER_CONTROL', 'REQUESTED_WITH_HEADER_CONTROL');
|
||||||
|
|
||||||
///This feature covers [InAppWebViewController.setSafeBrowsingAllowlist].
|
///This feature covers [InAppWebViewController.setSafeBrowsingAllowlist].
|
||||||
static const SAFE_BROWSING_ALLOWLIST = WebViewFeature._internal(
|
static const SAFE_BROWSING_ALLOWLIST = WebViewFeature._internal(
|
||||||
'SAFE_BROWSING_ALLOWLIST', 'SAFE_BROWSING_ALLOWLIST');
|
'SAFE_BROWSING_ALLOWLIST', 'SAFE_BROWSING_ALLOWLIST');
|
||||||
|
@ -145,6 +164,10 @@ class WebViewFeature {
|
||||||
static const START_SAFE_BROWSING =
|
static const START_SAFE_BROWSING =
|
||||||
WebViewFeature._internal('START_SAFE_BROWSING', 'START_SAFE_BROWSING');
|
WebViewFeature._internal('START_SAFE_BROWSING', 'START_SAFE_BROWSING');
|
||||||
|
|
||||||
|
///This feature covers [InAppWebViewSettings.willSuppressErrorPage].
|
||||||
|
static const SUPPRESS_ERROR_PAGE =
|
||||||
|
WebViewFeature._internal('SUPPRESS_ERROR_PAGE', 'SUPPRESS_ERROR_PAGE');
|
||||||
|
|
||||||
///
|
///
|
||||||
static const TRACING_CONTROLLER_BASIC_USAGE = WebViewFeature._internal(
|
static const TRACING_CONTROLLER_BASIC_USAGE = WebViewFeature._internal(
|
||||||
'TRACING_CONTROLLER_BASIC_USAGE', 'TRACING_CONTROLLER_BASIC_USAGE');
|
'TRACING_CONTROLLER_BASIC_USAGE', 'TRACING_CONTROLLER_BASIC_USAGE');
|
||||||
|
@ -195,38 +218,19 @@ class WebViewFeature {
|
||||||
///
|
///
|
||||||
static const WEB_VIEW_RENDERER_TERMINATE = WebViewFeature._internal(
|
static const WEB_VIEW_RENDERER_TERMINATE = WebViewFeature._internal(
|
||||||
'WEB_VIEW_RENDERER_TERMINATE', 'WEB_VIEW_RENDERER_TERMINATE');
|
'WEB_VIEW_RENDERER_TERMINATE', 'WEB_VIEW_RENDERER_TERMINATE');
|
||||||
|
static const _channel = const MethodChannel(
|
||||||
///This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START].
|
'com.pichillilorenzo/flutter_inappwebview_webviewfeature');
|
||||||
static const DOCUMENT_START_SCRIPT = WebViewFeature._internal(
|
|
||||||
'DOCUMENT_START_SCRIPT', 'DOCUMENT_START_SCRIPT');
|
|
||||||
|
|
||||||
///This feature covers [InAppWebViewSettings.willSuppressErrorPage].
|
|
||||||
static const SUPPRESS_ERROR_PAGE =
|
|
||||||
WebViewFeature._internal('SUPPRESS_ERROR_PAGE', 'SUPPRESS_ERROR_PAGE');
|
|
||||||
|
|
||||||
///This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed].
|
|
||||||
static const ALGORITHMIC_DARKENING = WebViewFeature._internal(
|
|
||||||
'ALGORITHMIC_DARKENING', 'ALGORITHMIC_DARKENING');
|
|
||||||
|
|
||||||
///This feature covers [InAppWebViewSettings.requestedWithHeaderMode].
|
|
||||||
static const REQUESTED_WITH_HEADER_CONTROL = WebViewFeature._internal(
|
|
||||||
'REQUESTED_WITH_HEADER_CONTROL', 'REQUESTED_WITH_HEADER_CONTROL');
|
|
||||||
|
|
||||||
///This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled].
|
|
||||||
static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY =
|
|
||||||
WebViewFeature._internal('ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY',
|
|
||||||
'ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY');
|
|
||||||
|
|
||||||
///This feature covers [InAppWebViewController.getVariationsHeader].
|
|
||||||
static const GET_VARIATIONS_HEADER = WebViewFeature._internal(
|
|
||||||
'GET_VARIATIONS_HEADER', 'GET_VARIATIONS_HEADER');
|
|
||||||
|
|
||||||
///Set of all values of [WebViewFeature].
|
///Set of all values of [WebViewFeature].
|
||||||
static final Set<WebViewFeature> values = [
|
static final Set<WebViewFeature> values = [
|
||||||
|
WebViewFeature.ALGORITHMIC_DARKENING,
|
||||||
WebViewFeature.CREATE_WEB_MESSAGE_CHANNEL,
|
WebViewFeature.CREATE_WEB_MESSAGE_CHANNEL,
|
||||||
WebViewFeature.DISABLED_ACTION_MODE_MENU_ITEMS,
|
WebViewFeature.DISABLED_ACTION_MODE_MENU_ITEMS,
|
||||||
|
WebViewFeature.DOCUMENT_START_SCRIPT,
|
||||||
|
WebViewFeature.ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY,
|
||||||
WebViewFeature.FORCE_DARK,
|
WebViewFeature.FORCE_DARK,
|
||||||
WebViewFeature.FORCE_DARK_STRATEGY,
|
WebViewFeature.FORCE_DARK_STRATEGY,
|
||||||
|
WebViewFeature.GET_VARIATIONS_HEADER,
|
||||||
WebViewFeature.GET_WEB_CHROME_CLIENT,
|
WebViewFeature.GET_WEB_CHROME_CLIENT,
|
||||||
WebViewFeature.GET_WEB_VIEW_CLIENT,
|
WebViewFeature.GET_WEB_VIEW_CLIENT,
|
||||||
WebViewFeature.GET_WEB_VIEW_RENDERER,
|
WebViewFeature.GET_WEB_VIEW_RENDERER,
|
||||||
|
@ -237,6 +241,7 @@ class WebViewFeature {
|
||||||
WebViewFeature.PROXY_OVERRIDE_REVERSE_BYPASS,
|
WebViewFeature.PROXY_OVERRIDE_REVERSE_BYPASS,
|
||||||
WebViewFeature.RECEIVE_HTTP_ERROR,
|
WebViewFeature.RECEIVE_HTTP_ERROR,
|
||||||
WebViewFeature.RECEIVE_WEB_RESOURCE_ERROR,
|
WebViewFeature.RECEIVE_WEB_RESOURCE_ERROR,
|
||||||
|
WebViewFeature.REQUESTED_WITH_HEADER_CONTROL,
|
||||||
WebViewFeature.SAFE_BROWSING_ALLOWLIST,
|
WebViewFeature.SAFE_BROWSING_ALLOWLIST,
|
||||||
WebViewFeature.SAFE_BROWSING_ENABLE,
|
WebViewFeature.SAFE_BROWSING_ENABLE,
|
||||||
WebViewFeature.SAFE_BROWSING_HIT,
|
WebViewFeature.SAFE_BROWSING_HIT,
|
||||||
|
@ -253,6 +258,7 @@ class WebViewFeature {
|
||||||
WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST,
|
WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST,
|
||||||
WebViewFeature.SHOULD_OVERRIDE_WITH_REDIRECTS,
|
WebViewFeature.SHOULD_OVERRIDE_WITH_REDIRECTS,
|
||||||
WebViewFeature.START_SAFE_BROWSING,
|
WebViewFeature.START_SAFE_BROWSING,
|
||||||
|
WebViewFeature.SUPPRESS_ERROR_PAGE,
|
||||||
WebViewFeature.TRACING_CONTROLLER_BASIC_USAGE,
|
WebViewFeature.TRACING_CONTROLLER_BASIC_USAGE,
|
||||||
WebViewFeature.VISUAL_STATE_CALLBACK,
|
WebViewFeature.VISUAL_STATE_CALLBACK,
|
||||||
WebViewFeature.WEB_MESSAGE_CALLBACK_ON_MESSAGE,
|
WebViewFeature.WEB_MESSAGE_CALLBACK_ON_MESSAGE,
|
||||||
|
@ -265,12 +271,6 @@ class WebViewFeature {
|
||||||
WebViewFeature.WEB_RESOURCE_REQUEST_IS_REDIRECT,
|
WebViewFeature.WEB_RESOURCE_REQUEST_IS_REDIRECT,
|
||||||
WebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE,
|
WebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE,
|
||||||
WebViewFeature.WEB_VIEW_RENDERER_TERMINATE,
|
WebViewFeature.WEB_VIEW_RENDERER_TERMINATE,
|
||||||
WebViewFeature.DOCUMENT_START_SCRIPT,
|
|
||||||
WebViewFeature.SUPPRESS_ERROR_PAGE,
|
|
||||||
WebViewFeature.ALGORITHMIC_DARKENING,
|
|
||||||
WebViewFeature.REQUESTED_WITH_HEADER_CONTROL,
|
|
||||||
WebViewFeature.ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY,
|
|
||||||
WebViewFeature.GET_VARIATIONS_HEADER,
|
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [WebViewFeature] instance from [String] value.
|
///Gets a possible [WebViewFeature] instance from [String] value.
|
||||||
|
@ -339,8 +339,10 @@ class AndroidWebViewFeature {
|
||||||
factory AndroidWebViewFeature._internalMultiPlatform(
|
factory AndroidWebViewFeature._internalMultiPlatform(
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
AndroidWebViewFeature._internal(value, nativeValue());
|
AndroidWebViewFeature._internal(value, nativeValue());
|
||||||
static const _channel = const MethodChannel(
|
|
||||||
'com.pichillilorenzo/flutter_inappwebview_webviewfeature');
|
///This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed].
|
||||||
|
static const ALGORITHMIC_DARKENING = AndroidWebViewFeature._internal(
|
||||||
|
'ALGORITHMIC_DARKENING', 'ALGORITHMIC_DARKENING');
|
||||||
|
|
||||||
///
|
///
|
||||||
static const CREATE_WEB_MESSAGE_CHANNEL = AndroidWebViewFeature._internal(
|
static const CREATE_WEB_MESSAGE_CHANNEL = AndroidWebViewFeature._internal(
|
||||||
|
@ -351,6 +353,16 @@ class AndroidWebViewFeature {
|
||||||
AndroidWebViewFeature._internal(
|
AndroidWebViewFeature._internal(
|
||||||
'DISABLED_ACTION_MODE_MENU_ITEMS', 'DISABLED_ACTION_MODE_MENU_ITEMS');
|
'DISABLED_ACTION_MODE_MENU_ITEMS', 'DISABLED_ACTION_MODE_MENU_ITEMS');
|
||||||
|
|
||||||
|
///This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START].
|
||||||
|
static const DOCUMENT_START_SCRIPT = AndroidWebViewFeature._internal(
|
||||||
|
'DOCUMENT_START_SCRIPT', 'DOCUMENT_START_SCRIPT');
|
||||||
|
|
||||||
|
///This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled].
|
||||||
|
static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY =
|
||||||
|
AndroidWebViewFeature._internal(
|
||||||
|
'ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY',
|
||||||
|
'ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY');
|
||||||
|
|
||||||
///
|
///
|
||||||
static const FORCE_DARK =
|
static const FORCE_DARK =
|
||||||
AndroidWebViewFeature._internal('FORCE_DARK', 'FORCE_DARK');
|
AndroidWebViewFeature._internal('FORCE_DARK', 'FORCE_DARK');
|
||||||
|
@ -395,6 +407,10 @@ class AndroidWebViewFeature {
|
||||||
static const RECEIVE_WEB_RESOURCE_ERROR = AndroidWebViewFeature._internal(
|
static const RECEIVE_WEB_RESOURCE_ERROR = AndroidWebViewFeature._internal(
|
||||||
'RECEIVE_WEB_RESOURCE_ERROR', 'RECEIVE_WEB_RESOURCE_ERROR');
|
'RECEIVE_WEB_RESOURCE_ERROR', 'RECEIVE_WEB_RESOURCE_ERROR');
|
||||||
|
|
||||||
|
///This feature covers [InAppWebViewSettings.requestedWithHeaderMode].
|
||||||
|
static const REQUESTED_WITH_HEADER_CONTROL = AndroidWebViewFeature._internal(
|
||||||
|
'REQUESTED_WITH_HEADER_CONTROL', 'REQUESTED_WITH_HEADER_CONTROL');
|
||||||
|
|
||||||
///
|
///
|
||||||
static const SAFE_BROWSING_ALLOWLIST = AndroidWebViewFeature._internal(
|
static const SAFE_BROWSING_ALLOWLIST = AndroidWebViewFeature._internal(
|
||||||
'SAFE_BROWSING_ALLOWLIST', 'SAFE_BROWSING_ALLOWLIST');
|
'SAFE_BROWSING_ALLOWLIST', 'SAFE_BROWSING_ALLOWLIST');
|
||||||
|
@ -465,6 +481,10 @@ class AndroidWebViewFeature {
|
||||||
static const START_SAFE_BROWSING = AndroidWebViewFeature._internal(
|
static const START_SAFE_BROWSING = AndroidWebViewFeature._internal(
|
||||||
'START_SAFE_BROWSING', 'START_SAFE_BROWSING');
|
'START_SAFE_BROWSING', 'START_SAFE_BROWSING');
|
||||||
|
|
||||||
|
///This feature covers [InAppWebViewSettings.willSuppressErrorPage].
|
||||||
|
static const SUPPRESS_ERROR_PAGE = AndroidWebViewFeature._internal(
|
||||||
|
'SUPPRESS_ERROR_PAGE', 'SUPPRESS_ERROR_PAGE');
|
||||||
|
|
||||||
///
|
///
|
||||||
static const TRACING_CONTROLLER_BASIC_USAGE = AndroidWebViewFeature._internal(
|
static const TRACING_CONTROLLER_BASIC_USAGE = AndroidWebViewFeature._internal(
|
||||||
'TRACING_CONTROLLER_BASIC_USAGE', 'TRACING_CONTROLLER_BASIC_USAGE');
|
'TRACING_CONTROLLER_BASIC_USAGE', 'TRACING_CONTROLLER_BASIC_USAGE');
|
||||||
|
@ -517,33 +537,16 @@ class AndroidWebViewFeature {
|
||||||
///
|
///
|
||||||
static const WEB_VIEW_RENDERER_TERMINATE = AndroidWebViewFeature._internal(
|
static const WEB_VIEW_RENDERER_TERMINATE = AndroidWebViewFeature._internal(
|
||||||
'WEB_VIEW_RENDERER_TERMINATE', 'WEB_VIEW_RENDERER_TERMINATE');
|
'WEB_VIEW_RENDERER_TERMINATE', 'WEB_VIEW_RENDERER_TERMINATE');
|
||||||
|
static const _channel = const MethodChannel(
|
||||||
///This feature covers [UserScriptInjectionTime.AT_DOCUMENT_START].
|
'com.pichillilorenzo/flutter_inappwebview_webviewfeature');
|
||||||
static const DOCUMENT_START_SCRIPT = AndroidWebViewFeature._internal(
|
|
||||||
'DOCUMENT_START_SCRIPT', 'DOCUMENT_START_SCRIPT');
|
|
||||||
|
|
||||||
///This feature covers [InAppWebViewSettings.willSuppressErrorPage].
|
|
||||||
static const SUPPRESS_ERROR_PAGE = AndroidWebViewFeature._internal(
|
|
||||||
'SUPPRESS_ERROR_PAGE', 'SUPPRESS_ERROR_PAGE');
|
|
||||||
|
|
||||||
///This feature covers [InAppWebViewSettings.algorithmicDarkeningAllowed].
|
|
||||||
static const ALGORITHMIC_DARKENING = AndroidWebViewFeature._internal(
|
|
||||||
'ALGORITHMIC_DARKENING', 'ALGORITHMIC_DARKENING');
|
|
||||||
|
|
||||||
///This feature covers [InAppWebViewSettings.requestedWithHeaderMode].
|
|
||||||
static const REQUESTED_WITH_HEADER_CONTROL = AndroidWebViewFeature._internal(
|
|
||||||
'REQUESTED_WITH_HEADER_CONTROL', 'REQUESTED_WITH_HEADER_CONTROL');
|
|
||||||
|
|
||||||
///This feature covers [InAppWebViewSettings.enterpriseAuthenticationAppLinkPolicyEnabled].
|
|
||||||
static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY =
|
|
||||||
AndroidWebViewFeature._internal(
|
|
||||||
'ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY',
|
|
||||||
'ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY');
|
|
||||||
|
|
||||||
///Set of all values of [AndroidWebViewFeature].
|
///Set of all values of [AndroidWebViewFeature].
|
||||||
static final Set<AndroidWebViewFeature> values = [
|
static final Set<AndroidWebViewFeature> values = [
|
||||||
|
AndroidWebViewFeature.ALGORITHMIC_DARKENING,
|
||||||
AndroidWebViewFeature.CREATE_WEB_MESSAGE_CHANNEL,
|
AndroidWebViewFeature.CREATE_WEB_MESSAGE_CHANNEL,
|
||||||
AndroidWebViewFeature.DISABLED_ACTION_MODE_MENU_ITEMS,
|
AndroidWebViewFeature.DISABLED_ACTION_MODE_MENU_ITEMS,
|
||||||
|
AndroidWebViewFeature.DOCUMENT_START_SCRIPT,
|
||||||
|
AndroidWebViewFeature.ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY,
|
||||||
AndroidWebViewFeature.FORCE_DARK,
|
AndroidWebViewFeature.FORCE_DARK,
|
||||||
AndroidWebViewFeature.FORCE_DARK_STRATEGY,
|
AndroidWebViewFeature.FORCE_DARK_STRATEGY,
|
||||||
AndroidWebViewFeature.GET_WEB_CHROME_CLIENT,
|
AndroidWebViewFeature.GET_WEB_CHROME_CLIENT,
|
||||||
|
@ -555,6 +558,7 @@ class AndroidWebViewFeature {
|
||||||
AndroidWebViewFeature.PROXY_OVERRIDE,
|
AndroidWebViewFeature.PROXY_OVERRIDE,
|
||||||
AndroidWebViewFeature.RECEIVE_HTTP_ERROR,
|
AndroidWebViewFeature.RECEIVE_HTTP_ERROR,
|
||||||
AndroidWebViewFeature.RECEIVE_WEB_RESOURCE_ERROR,
|
AndroidWebViewFeature.RECEIVE_WEB_RESOURCE_ERROR,
|
||||||
|
AndroidWebViewFeature.REQUESTED_WITH_HEADER_CONTROL,
|
||||||
AndroidWebViewFeature.SAFE_BROWSING_ALLOWLIST,
|
AndroidWebViewFeature.SAFE_BROWSING_ALLOWLIST,
|
||||||
AndroidWebViewFeature.SAFE_BROWSING_ENABLE,
|
AndroidWebViewFeature.SAFE_BROWSING_ENABLE,
|
||||||
AndroidWebViewFeature.SAFE_BROWSING_HIT,
|
AndroidWebViewFeature.SAFE_BROWSING_HIT,
|
||||||
|
@ -571,6 +575,7 @@ class AndroidWebViewFeature {
|
||||||
AndroidWebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST,
|
AndroidWebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST,
|
||||||
AndroidWebViewFeature.SHOULD_OVERRIDE_WITH_REDIRECTS,
|
AndroidWebViewFeature.SHOULD_OVERRIDE_WITH_REDIRECTS,
|
||||||
AndroidWebViewFeature.START_SAFE_BROWSING,
|
AndroidWebViewFeature.START_SAFE_BROWSING,
|
||||||
|
AndroidWebViewFeature.SUPPRESS_ERROR_PAGE,
|
||||||
AndroidWebViewFeature.TRACING_CONTROLLER_BASIC_USAGE,
|
AndroidWebViewFeature.TRACING_CONTROLLER_BASIC_USAGE,
|
||||||
AndroidWebViewFeature.VISUAL_STATE_CALLBACK,
|
AndroidWebViewFeature.VISUAL_STATE_CALLBACK,
|
||||||
AndroidWebViewFeature.WEB_MESSAGE_CALLBACK_ON_MESSAGE,
|
AndroidWebViewFeature.WEB_MESSAGE_CALLBACK_ON_MESSAGE,
|
||||||
|
@ -583,11 +588,6 @@ class AndroidWebViewFeature {
|
||||||
AndroidWebViewFeature.WEB_RESOURCE_REQUEST_IS_REDIRECT,
|
AndroidWebViewFeature.WEB_RESOURCE_REQUEST_IS_REDIRECT,
|
||||||
AndroidWebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE,
|
AndroidWebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE,
|
||||||
AndroidWebViewFeature.WEB_VIEW_RENDERER_TERMINATE,
|
AndroidWebViewFeature.WEB_VIEW_RENDERER_TERMINATE,
|
||||||
AndroidWebViewFeature.DOCUMENT_START_SCRIPT,
|
|
||||||
AndroidWebViewFeature.SUPPRESS_ERROR_PAGE,
|
|
||||||
AndroidWebViewFeature.ALGORITHMIC_DARKENING,
|
|
||||||
AndroidWebViewFeature.REQUESTED_WITH_HEADER_CONTROL,
|
|
||||||
AndroidWebViewFeature.ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY,
|
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [AndroidWebViewFeature] instance from [String] value.
|
///Gets a possible [AndroidWebViewFeature] instance from [String] value.
|
||||||
|
|
|
@ -8,95 +8,14 @@ part of 'chrome_safari_browser_settings.dart';
|
||||||
|
|
||||||
///Class that represents the settings that can be used for an [ChromeSafariBrowser] window.
|
///Class that represents the settings that can be used for an [ChromeSafariBrowser] window.
|
||||||
class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||||
///The share state that should be applied to the custom tab. The default value is [CustomTabsShareState.SHARE_STATE_DEFAULT].
|
///An additional button to be shown in `SFSafariViewController`'s toolbar.
|
||||||
|
///This allows the user to access powerful functionality from your extension without needing to first show the `UIActivityViewController`.
|
||||||
///
|
///
|
||||||
///**NOTE**: Not available in a Trusted Web Activity.
|
///**NOTE**: available on iOS 15.0+.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android
|
///- iOS
|
||||||
CustomTabsShareState? shareState;
|
ActivityButton? activityButton;
|
||||||
|
|
||||||
///Set to `false` if the title shouldn't be shown in the custom tab. The default value is `true`.
|
|
||||||
///
|
|
||||||
///**NOTE**: Not available in a Trusted Web Activity.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
bool? showTitle;
|
|
||||||
|
|
||||||
///Set the custom background color of the toolbar.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
Color? toolbarBackgroundColor;
|
|
||||||
|
|
||||||
///Sets the navigation bar color. Has no effect on Android API versions below L.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
Color? navigationBarColor;
|
|
||||||
|
|
||||||
///Sets the navigation bar divider color. Has no effect on Android API versions below P.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
Color? navigationBarDividerColor;
|
|
||||||
|
|
||||||
///Sets the color of the secondary toolbar.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
Color? secondaryToolbarColor;
|
|
||||||
|
|
||||||
///Set to `true` to enable the url bar to hide as the user scrolls down on the page. The default value is `false`.
|
|
||||||
///
|
|
||||||
///**NOTE**: Not available in a Trusted Web Activity.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
bool? enableUrlBarHiding;
|
|
||||||
|
|
||||||
///Set to `true` to enable Instant Apps. The default value is `false`.
|
|
||||||
///
|
|
||||||
///**NOTE**: Not available in a Trusted Web Activity.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
bool? instantAppsEnabled;
|
|
||||||
|
|
||||||
///Set an explicit application package name that limits
|
|
||||||
///the components this Intent will resolve to. If left to the default
|
|
||||||
///value of null, all components in all applications will considered.
|
|
||||||
///If non-null, the Intent can only match the components in the given
|
|
||||||
///application package.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
String? packageName;
|
|
||||||
|
|
||||||
///Set to `true` to enable Keep Alive. The default value is `false`.
|
|
||||||
///
|
|
||||||
///**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**:
|
|
||||||
///- 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**:
|
|
||||||
///- Android
|
|
||||||
bool? noHistory;
|
|
||||||
|
|
||||||
///Set to `true` to launch the Custom Tab as a Trusted Web Activity. The default value is `false`.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
bool? isTrustedWebActivity;
|
|
||||||
|
|
||||||
///Sets a list of additional trusted origins that the user may navigate or be redirected to from the starting uri.
|
///Sets a list of additional trusted origins that the user may navigate or be redirected to from the starting uri.
|
||||||
///
|
///
|
||||||
|
@ -106,38 +25,6 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||||
///- Android
|
///- Android
|
||||||
List<String>? additionalTrustedOrigins;
|
List<String>? additionalTrustedOrigins;
|
||||||
|
|
||||||
///Sets a display mode of a Trusted Web Activity.
|
|
||||||
///
|
|
||||||
///**NOTE**: Available only in a Trusted Web Activity.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
TrustedWebActivityDisplayMode? displayMode;
|
|
||||||
|
|
||||||
///Sets a screen orientation. This can be used e.g. to enable the locking of an orientation lock type.
|
|
||||||
///
|
|
||||||
///**NOTE**: Available only in a Trusted Web Activity.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android
|
|
||||||
TrustedWebActivityScreenOrientation? screenOrientation;
|
|
||||||
|
|
||||||
///Sets the start animations.
|
|
||||||
///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**:
|
|
||||||
///- Android
|
|
||||||
List<AndroidResource>? startAnimations;
|
|
||||||
|
|
||||||
///Sets the exit animations.
|
|
||||||
///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**:
|
|
||||||
///- Android
|
|
||||||
List<AndroidResource>? exitAnimations;
|
|
||||||
|
|
||||||
///Adds the necessary flags and extras to signal any browser supporting custom tabs to use the browser UI
|
///Adds the necessary flags and extras to signal any browser supporting custom tabs to use the browser UI
|
||||||
///at all times and avoid showing custom tab like UI.
|
///at all times and avoid showing custom tab like UI.
|
||||||
///Calling this with an intent will override any custom tabs related customizations.
|
///Calling this with an intent will override any custom tabs related customizations.
|
||||||
|
@ -147,12 +34,6 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||||
///- Android
|
///- Android
|
||||||
bool? alwaysUseBrowserUI;
|
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**:
|
|
||||||
///- iOS
|
|
||||||
bool? entersReaderIfAvailable;
|
|
||||||
|
|
||||||
///Set to `true` to enable bar collapsing. The default value is `false`.
|
///Set to `true` to enable bar collapsing. The default value is `false`.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -167,6 +48,99 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||||
///- iOS
|
///- iOS
|
||||||
DismissButtonStyle? dismissButtonStyle;
|
DismissButtonStyle? dismissButtonStyle;
|
||||||
|
|
||||||
|
///Sets a display mode of a Trusted Web Activity.
|
||||||
|
///
|
||||||
|
///**NOTE**: Available only in a Trusted Web Activity.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
TrustedWebActivityDisplayMode? displayMode;
|
||||||
|
|
||||||
|
///Set to `true` to enable the url bar to hide as the user scrolls down on the page. The default value is `false`.
|
||||||
|
///
|
||||||
|
///**NOTE**: Not available in a Trusted Web Activity.
|
||||||
|
///
|
||||||
|
///**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**:
|
||||||
|
///- iOS
|
||||||
|
bool? entersReaderIfAvailable;
|
||||||
|
|
||||||
|
///An event attribution associated with a click that caused this `SFSafariViewController` to be opened.
|
||||||
|
///This attribute is ignored if the `SFSafariViewController` url has a scheme of 'http'.
|
||||||
|
///
|
||||||
|
///**NOTE**: available on iOS 15.2+.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
UIEventAttribution? eventAttribution;
|
||||||
|
|
||||||
|
///Sets the exit animations.
|
||||||
|
///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**:
|
||||||
|
///- Android
|
||||||
|
List<AndroidResource>? exitAnimations;
|
||||||
|
|
||||||
|
///Set to `true` to enable Instant Apps. The default value is `false`.
|
||||||
|
///
|
||||||
|
///**NOTE**: Not available in a Trusted Web Activity.
|
||||||
|
///
|
||||||
|
///**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**:
|
||||||
|
///- Android
|
||||||
|
bool? isSingleInstance;
|
||||||
|
|
||||||
|
///Set to `true` to launch the Custom Tab as a Trusted Web Activity. The default value is `false`.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
bool? isTrustedWebActivity;
|
||||||
|
|
||||||
|
///Set to `true` to enable Keep Alive. The default value is `false`.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
bool? keepAliveEnabled;
|
||||||
|
|
||||||
|
///Sets the navigation bar color. Has no effect on Android API versions below L.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
Color? navigationBarColor;
|
||||||
|
|
||||||
|
///Sets the navigation bar divider color. Has no effect on Android API versions below P.
|
||||||
|
///
|
||||||
|
///**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**:
|
||||||
|
///- Android
|
||||||
|
bool? noHistory;
|
||||||
|
|
||||||
|
///Set an explicit application package name that limits
|
||||||
|
///the components this Intent will resolve to. If left to the default
|
||||||
|
///value of null, all components in all applications will considered.
|
||||||
|
///If non-null, the Intent can only match the components in the given
|
||||||
|
///application package.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
String? packageName;
|
||||||
|
|
||||||
///Set the custom background color of the navigation bar and the toolbar.
|
///Set the custom background color of the navigation bar and the toolbar.
|
||||||
///
|
///
|
||||||
///**NOTE**: available on iOS 10.0+.
|
///**NOTE**: available on iOS 10.0+.
|
||||||
|
@ -189,29 +163,55 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||||
///- iOS
|
///- iOS
|
||||||
ModalPresentationStyle? presentationStyle;
|
ModalPresentationStyle? presentationStyle;
|
||||||
|
|
||||||
|
///Sets a screen orientation. This can be used e.g. to enable the locking of an orientation lock type.
|
||||||
|
///
|
||||||
|
///**NOTE**: Available only in a Trusted Web Activity.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
TrustedWebActivityScreenOrientation? screenOrientation;
|
||||||
|
|
||||||
|
///Sets the color of the secondary toolbar.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
Color? secondaryToolbarColor;
|
||||||
|
|
||||||
|
///The share state that should be applied to the custom tab. The default value is [CustomTabsShareState.SHARE_STATE_DEFAULT].
|
||||||
|
///
|
||||||
|
///**NOTE**: Not available in a Trusted Web Activity.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
CustomTabsShareState? shareState;
|
||||||
|
|
||||||
|
///Set to `false` if the title shouldn't be shown in the custom tab. The default value is `true`.
|
||||||
|
///
|
||||||
|
///**NOTE**: Not available in a Trusted Web Activity.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
bool? showTitle;
|
||||||
|
|
||||||
|
///Sets the start animations.
|
||||||
|
///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**:
|
||||||
|
///- Android
|
||||||
|
List<AndroidResource>? startAnimations;
|
||||||
|
|
||||||
|
///Set the custom background color of the toolbar.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android
|
||||||
|
Color? toolbarBackgroundColor;
|
||||||
|
|
||||||
///Set to the custom transition style when presenting the WebView. The default value is [ModalTransitionStyle.COVER_VERTICAL].
|
///Set to the custom transition style when presenting the WebView. The default value is [ModalTransitionStyle.COVER_VERTICAL].
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
///- iOS
|
||||||
ModalTransitionStyle? transitionStyle;
|
ModalTransitionStyle? transitionStyle;
|
||||||
|
|
||||||
///An additional button to be shown in `SFSafariViewController`'s toolbar.
|
|
||||||
///This allows the user to access powerful functionality from your extension without needing to first show the `UIActivityViewController`.
|
|
||||||
///
|
|
||||||
///**NOTE**: available on iOS 15.0+.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS
|
|
||||||
ActivityButton? activityButton;
|
|
||||||
|
|
||||||
///An event attribution associated with a click that caused this `SFSafariViewController` to be opened.
|
|
||||||
///This attribute is ignored if the `SFSafariViewController` url has a scheme of 'http'.
|
|
||||||
///
|
|
||||||
///**NOTE**: available on iOS 15.2+.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS
|
|
||||||
UIEventAttribution? eventAttribution;
|
|
||||||
ChromeSafariBrowserSettings(
|
ChromeSafariBrowserSettings(
|
||||||
{this.shareState = CustomTabsShareState.SHARE_STATE_DEFAULT,
|
{this.shareState = CustomTabsShareState.SHARE_STATE_DEFAULT,
|
||||||
this.showTitle = true,
|
this.showTitle = true,
|
||||||
|
@ -257,8 +257,14 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = ChromeSafariBrowserSettings(
|
final instance = ChromeSafariBrowserSettings(
|
||||||
toolbarBackgroundColor: map['toolbarBackgroundColor'] != null
|
activityButton: ActivityButton.fromMap(
|
||||||
? UtilColor.fromStringRepresentation(map['toolbarBackgroundColor'])
|
map['activityButton']?.cast<String, dynamic>()),
|
||||||
|
displayMode: _deserializeDisplayMode(map['displayMode']),
|
||||||
|
eventAttribution: UIEventAttribution.fromMap(
|
||||||
|
map['eventAttribution']?.cast<String, dynamic>()),
|
||||||
|
exitAnimations: map['exitAnimations'] != null
|
||||||
|
? List<AndroidResource>.from(map['exitAnimations']
|
||||||
|
.map((e) => AndroidResource.fromMap(e?.cast<String, dynamic>())!))
|
||||||
: null,
|
: null,
|
||||||
navigationBarColor: map['navigationBarColor'] != null
|
navigationBarColor: map['navigationBarColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['navigationBarColor'])
|
? UtilColor.fromStringRepresentation(map['navigationBarColor'])
|
||||||
|
@ -266,51 +272,45 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||||
navigationBarDividerColor: map['navigationBarDividerColor'] != null
|
navigationBarDividerColor: map['navigationBarDividerColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['navigationBarDividerColor'])
|
? UtilColor.fromStringRepresentation(map['navigationBarDividerColor'])
|
||||||
: null,
|
: null,
|
||||||
secondaryToolbarColor: map['secondaryToolbarColor'] != null
|
|
||||||
? UtilColor.fromStringRepresentation(map['secondaryToolbarColor'])
|
|
||||||
: null,
|
|
||||||
packageName: map['packageName'],
|
packageName: map['packageName'],
|
||||||
displayMode: _deserializeDisplayMode(map['displayMode']),
|
|
||||||
startAnimations: map['startAnimations'] != null
|
|
||||||
? List<AndroidResource>.from(map['startAnimations']
|
|
||||||
.map((e) => AndroidResource.fromMap(e?.cast<String, dynamic>())!))
|
|
||||||
: null,
|
|
||||||
exitAnimations: map['exitAnimations'] != null
|
|
||||||
? List<AndroidResource>.from(map['exitAnimations']
|
|
||||||
.map((e) => AndroidResource.fromMap(e?.cast<String, dynamic>())!))
|
|
||||||
: null,
|
|
||||||
preferredBarTintColor: map['preferredBarTintColor'] != null
|
preferredBarTintColor: map['preferredBarTintColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['preferredBarTintColor'])
|
? UtilColor.fromStringRepresentation(map['preferredBarTintColor'])
|
||||||
: null,
|
: null,
|
||||||
preferredControlTintColor: map['preferredControlTintColor'] != null
|
preferredControlTintColor: map['preferredControlTintColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['preferredControlTintColor'])
|
? UtilColor.fromStringRepresentation(map['preferredControlTintColor'])
|
||||||
: null,
|
: null,
|
||||||
activityButton: ActivityButton.fromMap(
|
secondaryToolbarColor: map['secondaryToolbarColor'] != null
|
||||||
map['activityButton']?.cast<String, dynamic>()),
|
? UtilColor.fromStringRepresentation(map['secondaryToolbarColor'])
|
||||||
eventAttribution: UIEventAttribution.fromMap(
|
: null,
|
||||||
map['eventAttribution']?.cast<String, dynamic>()),
|
startAnimations: map['startAnimations'] != null
|
||||||
|
? List<AndroidResource>.from(map['startAnimations']
|
||||||
|
.map((e) => AndroidResource.fromMap(e?.cast<String, dynamic>())!))
|
||||||
|
: null,
|
||||||
|
toolbarBackgroundColor: map['toolbarBackgroundColor'] != null
|
||||||
|
? UtilColor.fromStringRepresentation(map['toolbarBackgroundColor'])
|
||||||
|
: null,
|
||||||
);
|
);
|
||||||
instance.shareState =
|
|
||||||
CustomTabsShareState.fromNativeValue(map['shareState']);
|
|
||||||
instance.showTitle = map['showTitle'];
|
|
||||||
instance.enableUrlBarHiding = map['enableUrlBarHiding'];
|
|
||||||
instance.instantAppsEnabled = map['instantAppsEnabled'];
|
|
||||||
instance.keepAliveEnabled = map['keepAliveEnabled'];
|
|
||||||
instance.isSingleInstance = map['isSingleInstance'];
|
|
||||||
instance.noHistory = map['noHistory'];
|
|
||||||
instance.isTrustedWebActivity = map['isTrustedWebActivity'];
|
|
||||||
instance.additionalTrustedOrigins =
|
instance.additionalTrustedOrigins =
|
||||||
map['additionalTrustedOrigins']?.cast<String>();
|
map['additionalTrustedOrigins']?.cast<String>();
|
||||||
instance.screenOrientation =
|
|
||||||
TrustedWebActivityScreenOrientation.fromNativeValue(
|
|
||||||
map['screenOrientation']);
|
|
||||||
instance.alwaysUseBrowserUI = map['alwaysUseBrowserUI'];
|
instance.alwaysUseBrowserUI = map['alwaysUseBrowserUI'];
|
||||||
instance.entersReaderIfAvailable = map['entersReaderIfAvailable'];
|
|
||||||
instance.barCollapsingEnabled = map['barCollapsingEnabled'];
|
instance.barCollapsingEnabled = map['barCollapsingEnabled'];
|
||||||
instance.dismissButtonStyle =
|
instance.dismissButtonStyle =
|
||||||
DismissButtonStyle.fromNativeValue(map['dismissButtonStyle']);
|
DismissButtonStyle.fromNativeValue(map['dismissButtonStyle']);
|
||||||
|
instance.enableUrlBarHiding = map['enableUrlBarHiding'];
|
||||||
|
instance.entersReaderIfAvailable = map['entersReaderIfAvailable'];
|
||||||
|
instance.instantAppsEnabled = map['instantAppsEnabled'];
|
||||||
|
instance.isSingleInstance = map['isSingleInstance'];
|
||||||
|
instance.isTrustedWebActivity = map['isTrustedWebActivity'];
|
||||||
|
instance.keepAliveEnabled = map['keepAliveEnabled'];
|
||||||
|
instance.noHistory = map['noHistory'];
|
||||||
instance.presentationStyle =
|
instance.presentationStyle =
|
||||||
ModalPresentationStyle.fromNativeValue(map['presentationStyle']);
|
ModalPresentationStyle.fromNativeValue(map['presentationStyle']);
|
||||||
|
instance.screenOrientation =
|
||||||
|
TrustedWebActivityScreenOrientation.fromNativeValue(
|
||||||
|
map['screenOrientation']);
|
||||||
|
instance.shareState =
|
||||||
|
CustomTabsShareState.fromNativeValue(map['shareState']);
|
||||||
|
instance.showTitle = map['showTitle'];
|
||||||
instance.transitionStyle =
|
instance.transitionStyle =
|
||||||
ModalTransitionStyle.fromNativeValue(map['transitionStyle']);
|
ModalTransitionStyle.fromNativeValue(map['transitionStyle']);
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -319,34 +319,34 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"shareState": shareState?.toNativeValue(),
|
"activityButton": activityButton?.toMap(),
|
||||||
"showTitle": showTitle,
|
|
||||||
"toolbarBackgroundColor": toolbarBackgroundColor?.toHex(),
|
|
||||||
"navigationBarColor": navigationBarColor?.toHex(),
|
|
||||||
"navigationBarDividerColor": navigationBarDividerColor?.toHex(),
|
|
||||||
"secondaryToolbarColor": secondaryToolbarColor?.toHex(),
|
|
||||||
"enableUrlBarHiding": enableUrlBarHiding,
|
|
||||||
"instantAppsEnabled": instantAppsEnabled,
|
|
||||||
"packageName": packageName,
|
|
||||||
"keepAliveEnabled": keepAliveEnabled,
|
|
||||||
"isSingleInstance": isSingleInstance,
|
|
||||||
"noHistory": noHistory,
|
|
||||||
"isTrustedWebActivity": isTrustedWebActivity,
|
|
||||||
"additionalTrustedOrigins": additionalTrustedOrigins,
|
"additionalTrustedOrigins": additionalTrustedOrigins,
|
||||||
"displayMode": displayMode?.toMap(),
|
|
||||||
"screenOrientation": screenOrientation?.toNativeValue(),
|
|
||||||
"startAnimations": startAnimations?.map((e) => e.toMap()).toList(),
|
|
||||||
"exitAnimations": exitAnimations?.map((e) => e.toMap()).toList(),
|
|
||||||
"alwaysUseBrowserUI": alwaysUseBrowserUI,
|
"alwaysUseBrowserUI": alwaysUseBrowserUI,
|
||||||
"entersReaderIfAvailable": entersReaderIfAvailable,
|
|
||||||
"barCollapsingEnabled": barCollapsingEnabled,
|
"barCollapsingEnabled": barCollapsingEnabled,
|
||||||
"dismissButtonStyle": dismissButtonStyle?.toNativeValue(),
|
"dismissButtonStyle": dismissButtonStyle?.toNativeValue(),
|
||||||
|
"displayMode": displayMode?.toMap(),
|
||||||
|
"enableUrlBarHiding": enableUrlBarHiding,
|
||||||
|
"entersReaderIfAvailable": entersReaderIfAvailable,
|
||||||
|
"eventAttribution": eventAttribution?.toMap(),
|
||||||
|
"exitAnimations": exitAnimations?.map((e) => e.toMap()).toList(),
|
||||||
|
"instantAppsEnabled": instantAppsEnabled,
|
||||||
|
"isSingleInstance": isSingleInstance,
|
||||||
|
"isTrustedWebActivity": isTrustedWebActivity,
|
||||||
|
"keepAliveEnabled": keepAliveEnabled,
|
||||||
|
"navigationBarColor": navigationBarColor?.toHex(),
|
||||||
|
"navigationBarDividerColor": navigationBarDividerColor?.toHex(),
|
||||||
|
"noHistory": noHistory,
|
||||||
|
"packageName": packageName,
|
||||||
"preferredBarTintColor": preferredBarTintColor?.toHex(),
|
"preferredBarTintColor": preferredBarTintColor?.toHex(),
|
||||||
"preferredControlTintColor": preferredControlTintColor?.toHex(),
|
"preferredControlTintColor": preferredControlTintColor?.toHex(),
|
||||||
"presentationStyle": presentationStyle?.toNativeValue(),
|
"presentationStyle": presentationStyle?.toNativeValue(),
|
||||||
|
"screenOrientation": screenOrientation?.toNativeValue(),
|
||||||
|
"secondaryToolbarColor": secondaryToolbarColor?.toHex(),
|
||||||
|
"shareState": shareState?.toNativeValue(),
|
||||||
|
"showTitle": showTitle,
|
||||||
|
"startAnimations": startAnimations?.map((e) => e.toMap()).toList(),
|
||||||
|
"toolbarBackgroundColor": toolbarBackgroundColor?.toHex(),
|
||||||
"transitionStyle": transitionStyle?.toNativeValue(),
|
"transitionStyle": transitionStyle?.toNativeValue(),
|
||||||
"activityButton": activityButton?.toMap(),
|
|
||||||
"eventAttribution": eventAttribution?.toMap(),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,6 +363,6 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'ChromeSafariBrowserSettings{shareState: $shareState, showTitle: $showTitle, toolbarBackgroundColor: $toolbarBackgroundColor, navigationBarColor: $navigationBarColor, navigationBarDividerColor: $navigationBarDividerColor, secondaryToolbarColor: $secondaryToolbarColor, enableUrlBarHiding: $enableUrlBarHiding, instantAppsEnabled: $instantAppsEnabled, packageName: $packageName, keepAliveEnabled: $keepAliveEnabled, isSingleInstance: $isSingleInstance, noHistory: $noHistory, isTrustedWebActivity: $isTrustedWebActivity, additionalTrustedOrigins: $additionalTrustedOrigins, displayMode: $displayMode, screenOrientation: $screenOrientation, startAnimations: $startAnimations, exitAnimations: $exitAnimations, alwaysUseBrowserUI: $alwaysUseBrowserUI, entersReaderIfAvailable: $entersReaderIfAvailable, barCollapsingEnabled: $barCollapsingEnabled, dismissButtonStyle: $dismissButtonStyle, preferredBarTintColor: $preferredBarTintColor, preferredControlTintColor: $preferredControlTintColor, presentationStyle: $presentationStyle, transitionStyle: $transitionStyle, activityButton: $activityButton, eventAttribution: $eventAttribution}';
|
return 'ChromeSafariBrowserSettings{activityButton: $activityButton, additionalTrustedOrigins: $additionalTrustedOrigins, alwaysUseBrowserUI: $alwaysUseBrowserUI, barCollapsingEnabled: $barCollapsingEnabled, dismissButtonStyle: $dismissButtonStyle, displayMode: $displayMode, enableUrlBarHiding: $enableUrlBarHiding, entersReaderIfAvailable: $entersReaderIfAvailable, eventAttribution: $eventAttribution, exitAnimations: $exitAnimations, instantAppsEnabled: $instantAppsEnabled, isSingleInstance: $isSingleInstance, isTrustedWebActivity: $isTrustedWebActivity, keepAliveEnabled: $keepAliveEnabled, navigationBarColor: $navigationBarColor, navigationBarDividerColor: $navigationBarDividerColor, noHistory: $noHistory, packageName: $packageName, preferredBarTintColor: $preferredBarTintColor, preferredControlTintColor: $preferredControlTintColor, presentationStyle: $presentationStyle, screenOrientation: $screenOrientation, secondaryToolbarColor: $secondaryToolbarColor, shareState: $shareState, showTitle: $showTitle, startAnimations: $startAnimations, toolbarBackgroundColor: $toolbarBackgroundColor, transitionStyle: $transitionStyle}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,30 @@ part of 'in_app_browser_settings.dart';
|
||||||
///This class represents all [InAppBrowser] settings available.
|
///This class represents all [InAppBrowser] settings available.
|
||||||
class InAppBrowserSettings
|
class InAppBrowserSettings
|
||||||
implements BrowserOptions, AndroidOptions, IosOptions {
|
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**:
|
||||||
|
///- Android native WebView
|
||||||
|
bool? allowGoBackWithBackButton;
|
||||||
|
|
||||||
|
///Set the custom text for the close button.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
String? closeButtonCaption;
|
||||||
|
|
||||||
|
///Set the custom color for the close button.
|
||||||
|
///
|
||||||
|
///**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**:
|
||||||
|
///- 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.
|
///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`.
|
///The default value is `false`.
|
||||||
///
|
///
|
||||||
|
@ -18,30 +42,6 @@ class InAppBrowserSettings
|
||||||
///- MacOS
|
///- MacOS
|
||||||
bool? hidden;
|
bool? hidden;
|
||||||
|
|
||||||
///Set to `true` to hide the toolbar at the top of the WebView. The default value is `false`.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
|
||||||
bool? hideToolbarTop;
|
|
||||||
|
|
||||||
///Set the custom background color of the toolbar at the top.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
|
||||||
Color? toolbarTopBackgroundColor;
|
|
||||||
|
|
||||||
///Set to `true` to hide the url bar on the toolbar at the top. The default value is `false`.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
|
||||||
bool? hideUrlBar;
|
|
||||||
|
|
||||||
///Set to `true` to hide the progress bar when the WebView is loading a page. The default value is `false`.
|
///Set to `true` to hide the progress bar when the WebView is loading a page. The default value is `false`.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -56,24 +56,33 @@ class InAppBrowserSettings
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
bool? hideTitleBar;
|
bool? hideTitleBar;
|
||||||
|
|
||||||
///Set the action bar's title.
|
///Set to `true` to hide the toolbar at the bottom of the WebView. The default value is `false`.
|
||||||
|
///
|
||||||
|
///**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**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
String? toolbarTopFixedTitle;
|
bool? hideToolbarTop;
|
||||||
|
|
||||||
///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`.
|
///Set to `true` to hide the url bar on the toolbar at the top. The default value is `false`.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
bool? closeOnCannotGoBack;
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
bool? hideUrlBar;
|
||||||
|
|
||||||
///Set to `false` to block the InAppBrowser WebView going back when the user click on the Android back button. The default value is `true`.
|
///Set the custom modal presentation style when presenting the WebView. The default value is [ModalPresentationStyle.FULL_SCREEN].
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- iOS
|
||||||
bool? allowGoBackWithBackButton;
|
ModalPresentationStyle? presentationStyle;
|
||||||
|
|
||||||
///Set to `true` to close the InAppBrowser when the user click on the Android back button. The default value is `false`.
|
///Set to `true` to close the InAppBrowser when the user click on the Android back button. The default value is `false`.
|
||||||
///
|
///
|
||||||
|
@ -81,30 +90,6 @@ class InAppBrowserSettings
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
bool? shouldCloseOnBackButtonPressed;
|
bool? shouldCloseOnBackButtonPressed;
|
||||||
|
|
||||||
///Set to `true` to set the toolbar at the top translucent. The default value is `true`.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS
|
|
||||||
bool? toolbarTopTranslucent;
|
|
||||||
|
|
||||||
///Set the tint color to apply to the navigation bar background.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS
|
|
||||||
Color? toolbarTopBarTintColor;
|
|
||||||
|
|
||||||
///Set the tint color to apply to the navigation items and bar button items.
|
|
||||||
///
|
|
||||||
///**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**:
|
|
||||||
///- iOS
|
|
||||||
bool? hideToolbarBottom;
|
|
||||||
|
|
||||||
///Set the custom background color of the toolbar at the bottom.
|
///Set the custom background color of the toolbar at the bottom.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -123,23 +108,38 @@ class InAppBrowserSettings
|
||||||
///- iOS
|
///- iOS
|
||||||
bool? toolbarBottomTranslucent;
|
bool? toolbarBottomTranslucent;
|
||||||
|
|
||||||
///Set the custom text for the close button.
|
///Set the custom background color of the toolbar at the top.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
String? closeButtonCaption;
|
///- MacOS
|
||||||
|
Color? toolbarTopBackgroundColor;
|
||||||
|
|
||||||
///Set the custom color for the close button.
|
///Set the tint color to apply to the navigation bar background.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
///- iOS
|
||||||
Color? closeButtonColor;
|
Color? toolbarTopBarTintColor;
|
||||||
|
|
||||||
///Set the custom modal presentation style when presenting the WebView. The default value is [ModalPresentationStyle.FULL_SCREEN].
|
///Set the action bar's title.
|
||||||
|
///
|
||||||
|
///**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**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
///- iOS
|
||||||
ModalPresentationStyle? presentationStyle;
|
Color? toolbarTopTintColor;
|
||||||
|
|
||||||
|
///Set to `true` to set the toolbar at the top translucent. The default value is `true`.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
bool? toolbarTopTranslucent;
|
||||||
|
|
||||||
///Set to the custom transition style when presenting the WebView. The default value is [ModalTransitionStyle.COVER_VERTICAL].
|
///Set to the custom transition style when presenting the WebView. The default value is [ModalTransitionStyle.COVER_VERTICAL].
|
||||||
///
|
///
|
||||||
|
@ -147,13 +147,6 @@ class InAppBrowserSettings
|
||||||
///- iOS
|
///- iOS
|
||||||
ModalTransitionStyle? transitionStyle;
|
ModalTransitionStyle? transitionStyle;
|
||||||
|
|
||||||
///How the browser window should be added to the main window.
|
|
||||||
///The default value is [WindowType.CHILD].
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
WindowType? windowType;
|
|
||||||
|
|
||||||
///The window’s alpha value.
|
///The window’s alpha value.
|
||||||
///The default value is `1.0`.
|
///The default value is `1.0`.
|
||||||
///
|
///
|
||||||
|
@ -161,6 +154,13 @@ class InAppBrowserSettings
|
||||||
///- MacOS
|
///- MacOS
|
||||||
double? windowAlphaValue;
|
double? windowAlphaValue;
|
||||||
|
|
||||||
|
///Sets the origin and size of the window’s frame rectangle according to a given frame rectangle,
|
||||||
|
///thereby setting its position and size onscreen.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
InAppWebViewRect? windowFrame;
|
||||||
|
|
||||||
///Flags that describe the window’s current style, such as if it’s resizable or in full-screen mode.
|
///Flags that describe the window’s current style, such as if it’s resizable or in full-screen mode.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -175,38 +175,38 @@ class InAppBrowserSettings
|
||||||
///- MacOS
|
///- MacOS
|
||||||
WindowTitlebarSeparatorStyle? windowTitlebarSeparatorStyle;
|
WindowTitlebarSeparatorStyle? windowTitlebarSeparatorStyle;
|
||||||
|
|
||||||
///Sets the origin and size of the window’s frame rectangle according to a given frame rectangle,
|
///How the browser window should be added to the main window.
|
||||||
///thereby setting its position and size onscreen.
|
///The default value is [WindowType.CHILD].
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- MacOS
|
///- MacOS
|
||||||
InAppWebViewRect? windowFrame;
|
WindowType? windowType;
|
||||||
InAppBrowserSettings(
|
InAppBrowserSettings(
|
||||||
{this.hidden = false,
|
{this.allowGoBackWithBackButton = true,
|
||||||
this.hideToolbarTop = false,
|
this.closeButtonCaption,
|
||||||
this.toolbarTopBackgroundColor,
|
this.closeButtonColor,
|
||||||
this.hideUrlBar = false,
|
this.closeOnCannotGoBack = true,
|
||||||
|
this.hidden = false,
|
||||||
this.hideProgressBar = false,
|
this.hideProgressBar = false,
|
||||||
this.hideTitleBar = false,
|
this.hideTitleBar = false,
|
||||||
this.toolbarTopFixedTitle,
|
|
||||||
this.closeOnCannotGoBack = true,
|
|
||||||
this.allowGoBackWithBackButton = true,
|
|
||||||
this.shouldCloseOnBackButtonPressed = false,
|
|
||||||
this.toolbarTopTranslucent = true,
|
|
||||||
this.toolbarTopTintColor,
|
|
||||||
this.hideToolbarBottom = false,
|
this.hideToolbarBottom = false,
|
||||||
|
this.hideToolbarTop = false,
|
||||||
|
this.hideUrlBar = false,
|
||||||
|
this.presentationStyle = ModalPresentationStyle.FULL_SCREEN,
|
||||||
|
this.shouldCloseOnBackButtonPressed = false,
|
||||||
this.toolbarBottomBackgroundColor,
|
this.toolbarBottomBackgroundColor,
|
||||||
this.toolbarBottomTintColor,
|
this.toolbarBottomTintColor,
|
||||||
this.toolbarBottomTranslucent = true,
|
this.toolbarBottomTranslucent = true,
|
||||||
this.closeButtonCaption,
|
this.toolbarTopBackgroundColor,
|
||||||
this.closeButtonColor,
|
this.toolbarTopFixedTitle,
|
||||||
this.presentationStyle = ModalPresentationStyle.FULL_SCREEN,
|
this.toolbarTopTintColor,
|
||||||
|
this.toolbarTopTranslucent = true,
|
||||||
this.transitionStyle = ModalTransitionStyle.COVER_VERTICAL,
|
this.transitionStyle = ModalTransitionStyle.COVER_VERTICAL,
|
||||||
this.windowType,
|
|
||||||
this.windowAlphaValue = 1.0,
|
this.windowAlphaValue = 1.0,
|
||||||
|
this.windowFrame,
|
||||||
this.windowStyleMask,
|
this.windowStyleMask,
|
||||||
this.windowTitlebarSeparatorStyle,
|
this.windowTitlebarSeparatorStyle,
|
||||||
this.windowFrame});
|
this.windowType});
|
||||||
|
|
||||||
///Gets a possible [InAppBrowserSettings] instance from a [Map] value.
|
///Gets a possible [InAppBrowserSettings] instance from a [Map] value.
|
||||||
static InAppBrowserSettings? fromMap(Map<String, dynamic>? map) {
|
static InAppBrowserSettings? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -214,12 +214,9 @@ class InAppBrowserSettings
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = InAppBrowserSettings(
|
final instance = InAppBrowserSettings(
|
||||||
toolbarTopBackgroundColor: map['toolbarTopBackgroundColor'] != null
|
closeButtonCaption: map['closeButtonCaption'],
|
||||||
? UtilColor.fromStringRepresentation(map['toolbarTopBackgroundColor'])
|
closeButtonColor: map['closeButtonColor'] != null
|
||||||
: null,
|
? UtilColor.fromStringRepresentation(map['closeButtonColor'])
|
||||||
toolbarTopFixedTitle: map['toolbarTopFixedTitle'],
|
|
||||||
toolbarTopTintColor: map['toolbarTopTintColor'] != null
|
|
||||||
? UtilColor.fromStringRepresentation(map['toolbarTopTintColor'])
|
|
||||||
: null,
|
: null,
|
||||||
toolbarBottomBackgroundColor: map['toolbarBottomBackgroundColor'] != null
|
toolbarBottomBackgroundColor: map['toolbarBottomBackgroundColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(
|
? UtilColor.fromStringRepresentation(
|
||||||
|
@ -228,35 +225,38 @@ class InAppBrowserSettings
|
||||||
toolbarBottomTintColor: map['toolbarBottomTintColor'] != null
|
toolbarBottomTintColor: map['toolbarBottomTintColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['toolbarBottomTintColor'])
|
? UtilColor.fromStringRepresentation(map['toolbarBottomTintColor'])
|
||||||
: null,
|
: null,
|
||||||
closeButtonCaption: map['closeButtonCaption'],
|
toolbarTopBackgroundColor: map['toolbarTopBackgroundColor'] != null
|
||||||
closeButtonColor: map['closeButtonColor'] != null
|
? UtilColor.fromStringRepresentation(map['toolbarTopBackgroundColor'])
|
||||||
? UtilColor.fromStringRepresentation(map['closeButtonColor'])
|
|
||||||
: null,
|
: null,
|
||||||
windowType: WindowType.fromNativeValue(map['windowType']),
|
toolbarTopFixedTitle: map['toolbarTopFixedTitle'],
|
||||||
|
toolbarTopTintColor: map['toolbarTopTintColor'] != null
|
||||||
|
? UtilColor.fromStringRepresentation(map['toolbarTopTintColor'])
|
||||||
|
: null,
|
||||||
|
windowFrame:
|
||||||
|
InAppWebViewRect.fromMap(map['windowFrame']?.cast<String, dynamic>()),
|
||||||
windowStyleMask: WindowStyleMask.fromNativeValue(map['windowStyleMask']),
|
windowStyleMask: WindowStyleMask.fromNativeValue(map['windowStyleMask']),
|
||||||
windowTitlebarSeparatorStyle:
|
windowTitlebarSeparatorStyle:
|
||||||
WindowTitlebarSeparatorStyle.fromNativeValue(
|
WindowTitlebarSeparatorStyle.fromNativeValue(
|
||||||
map['windowTitlebarSeparatorStyle']),
|
map['windowTitlebarSeparatorStyle']),
|
||||||
windowFrame:
|
windowType: WindowType.fromNativeValue(map['windowType']),
|
||||||
InAppWebViewRect.fromMap(map['windowFrame']?.cast<String, dynamic>()),
|
|
||||||
);
|
);
|
||||||
|
instance.allowGoBackWithBackButton = map['allowGoBackWithBackButton'];
|
||||||
|
instance.closeOnCannotGoBack = map['closeOnCannotGoBack'];
|
||||||
instance.hidden = map['hidden'];
|
instance.hidden = map['hidden'];
|
||||||
instance.hideToolbarTop = map['hideToolbarTop'];
|
|
||||||
instance.hideUrlBar = map['hideUrlBar'];
|
|
||||||
instance.hideProgressBar = map['hideProgressBar'];
|
instance.hideProgressBar = map['hideProgressBar'];
|
||||||
instance.hideTitleBar = map['hideTitleBar'];
|
instance.hideTitleBar = map['hideTitleBar'];
|
||||||
instance.closeOnCannotGoBack = map['closeOnCannotGoBack'];
|
instance.hideToolbarBottom = map['hideToolbarBottom'];
|
||||||
instance.allowGoBackWithBackButton = map['allowGoBackWithBackButton'];
|
instance.hideToolbarTop = map['hideToolbarTop'];
|
||||||
|
instance.hideUrlBar = map['hideUrlBar'];
|
||||||
|
instance.presentationStyle =
|
||||||
|
ModalPresentationStyle.fromNativeValue(map['presentationStyle']);
|
||||||
instance.shouldCloseOnBackButtonPressed =
|
instance.shouldCloseOnBackButtonPressed =
|
||||||
map['shouldCloseOnBackButtonPressed'];
|
map['shouldCloseOnBackButtonPressed'];
|
||||||
instance.toolbarTopTranslucent = map['toolbarTopTranslucent'];
|
instance.toolbarBottomTranslucent = map['toolbarBottomTranslucent'];
|
||||||
instance.toolbarTopBarTintColor = map['toolbarTopBarTintColor'] != null
|
instance.toolbarTopBarTintColor = map['toolbarTopBarTintColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['toolbarTopBarTintColor'])
|
? UtilColor.fromStringRepresentation(map['toolbarTopBarTintColor'])
|
||||||
: null;
|
: null;
|
||||||
instance.hideToolbarBottom = map['hideToolbarBottom'];
|
instance.toolbarTopTranslucent = map['toolbarTopTranslucent'];
|
||||||
instance.toolbarBottomTranslucent = map['toolbarBottomTranslucent'];
|
|
||||||
instance.presentationStyle =
|
|
||||||
ModalPresentationStyle.fromNativeValue(map['presentationStyle']);
|
|
||||||
instance.transitionStyle =
|
instance.transitionStyle =
|
||||||
ModalTransitionStyle.fromNativeValue(map['transitionStyle']);
|
ModalTransitionStyle.fromNativeValue(map['transitionStyle']);
|
||||||
instance.windowAlphaValue = map['windowAlphaValue'];
|
instance.windowAlphaValue = map['windowAlphaValue'];
|
||||||
|
@ -266,33 +266,33 @@ class InAppBrowserSettings
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
|
"allowGoBackWithBackButton": allowGoBackWithBackButton,
|
||||||
|
"closeButtonCaption": closeButtonCaption,
|
||||||
|
"closeButtonColor": closeButtonColor?.toHex(),
|
||||||
|
"closeOnCannotGoBack": closeOnCannotGoBack,
|
||||||
"hidden": hidden,
|
"hidden": hidden,
|
||||||
"hideToolbarTop": hideToolbarTop,
|
|
||||||
"toolbarTopBackgroundColor": toolbarTopBackgroundColor?.toHex(),
|
|
||||||
"hideUrlBar": hideUrlBar,
|
|
||||||
"hideProgressBar": hideProgressBar,
|
"hideProgressBar": hideProgressBar,
|
||||||
"hideTitleBar": hideTitleBar,
|
"hideTitleBar": hideTitleBar,
|
||||||
"toolbarTopFixedTitle": toolbarTopFixedTitle,
|
|
||||||
"closeOnCannotGoBack": closeOnCannotGoBack,
|
|
||||||
"allowGoBackWithBackButton": allowGoBackWithBackButton,
|
|
||||||
"shouldCloseOnBackButtonPressed": shouldCloseOnBackButtonPressed,
|
|
||||||
"toolbarTopTranslucent": toolbarTopTranslucent,
|
|
||||||
"toolbarTopBarTintColor": toolbarTopBarTintColor?.toHex(),
|
|
||||||
"toolbarTopTintColor": toolbarTopTintColor?.toHex(),
|
|
||||||
"hideToolbarBottom": hideToolbarBottom,
|
"hideToolbarBottom": hideToolbarBottom,
|
||||||
|
"hideToolbarTop": hideToolbarTop,
|
||||||
|
"hideUrlBar": hideUrlBar,
|
||||||
|
"presentationStyle": presentationStyle?.toNativeValue(),
|
||||||
|
"shouldCloseOnBackButtonPressed": shouldCloseOnBackButtonPressed,
|
||||||
"toolbarBottomBackgroundColor": toolbarBottomBackgroundColor?.toHex(),
|
"toolbarBottomBackgroundColor": toolbarBottomBackgroundColor?.toHex(),
|
||||||
"toolbarBottomTintColor": toolbarBottomTintColor?.toHex(),
|
"toolbarBottomTintColor": toolbarBottomTintColor?.toHex(),
|
||||||
"toolbarBottomTranslucent": toolbarBottomTranslucent,
|
"toolbarBottomTranslucent": toolbarBottomTranslucent,
|
||||||
"closeButtonCaption": closeButtonCaption,
|
"toolbarTopBackgroundColor": toolbarTopBackgroundColor?.toHex(),
|
||||||
"closeButtonColor": closeButtonColor?.toHex(),
|
"toolbarTopBarTintColor": toolbarTopBarTintColor?.toHex(),
|
||||||
"presentationStyle": presentationStyle?.toNativeValue(),
|
"toolbarTopFixedTitle": toolbarTopFixedTitle,
|
||||||
|
"toolbarTopTintColor": toolbarTopTintColor?.toHex(),
|
||||||
|
"toolbarTopTranslucent": toolbarTopTranslucent,
|
||||||
"transitionStyle": transitionStyle?.toNativeValue(),
|
"transitionStyle": transitionStyle?.toNativeValue(),
|
||||||
"windowType": windowType?.toNativeValue(),
|
|
||||||
"windowAlphaValue": windowAlphaValue,
|
"windowAlphaValue": windowAlphaValue,
|
||||||
|
"windowFrame": windowFrame?.toMap(),
|
||||||
"windowStyleMask": windowStyleMask?.toNativeValue(),
|
"windowStyleMask": windowStyleMask?.toNativeValue(),
|
||||||
"windowTitlebarSeparatorStyle":
|
"windowTitlebarSeparatorStyle":
|
||||||
windowTitlebarSeparatorStyle?.toNativeValue(),
|
windowTitlebarSeparatorStyle?.toNativeValue(),
|
||||||
"windowFrame": windowFrame?.toMap(),
|
"windowType": windowType?.toNativeValue(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,6 +308,6 @@ class InAppBrowserSettings
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'InAppBrowserSettings{hidden: $hidden, hideToolbarTop: $hideToolbarTop, toolbarTopBackgroundColor: $toolbarTopBackgroundColor, hideUrlBar: $hideUrlBar, hideProgressBar: $hideProgressBar, hideTitleBar: $hideTitleBar, toolbarTopFixedTitle: $toolbarTopFixedTitle, closeOnCannotGoBack: $closeOnCannotGoBack, allowGoBackWithBackButton: $allowGoBackWithBackButton, shouldCloseOnBackButtonPressed: $shouldCloseOnBackButtonPressed, toolbarTopTranslucent: $toolbarTopTranslucent, toolbarTopBarTintColor: $toolbarTopBarTintColor, toolbarTopTintColor: $toolbarTopTintColor, hideToolbarBottom: $hideToolbarBottom, toolbarBottomBackgroundColor: $toolbarBottomBackgroundColor, toolbarBottomTintColor: $toolbarBottomTintColor, toolbarBottomTranslucent: $toolbarBottomTranslucent, closeButtonCaption: $closeButtonCaption, closeButtonColor: $closeButtonColor, presentationStyle: $presentationStyle, transitionStyle: $transitionStyle, windowType: $windowType, windowAlphaValue: $windowAlphaValue, windowStyleMask: $windowStyleMask, windowTitlebarSeparatorStyle: $windowTitlebarSeparatorStyle, windowFrame: $windowFrame}';
|
return 'InAppBrowserSettings{allowGoBackWithBackButton: $allowGoBackWithBackButton, closeButtonCaption: $closeButtonCaption, closeButtonColor: $closeButtonColor, closeOnCannotGoBack: $closeOnCannotGoBack, hidden: $hidden, hideProgressBar: $hideProgressBar, hideTitleBar: $hideTitleBar, hideToolbarBottom: $hideToolbarBottom, hideToolbarTop: $hideToolbarTop, hideUrlBar: $hideUrlBar, presentationStyle: $presentationStyle, shouldCloseOnBackButtonPressed: $shouldCloseOnBackButtonPressed, toolbarBottomBackgroundColor: $toolbarBottomBackgroundColor, toolbarBottomTintColor: $toolbarBottomTintColor, toolbarBottomTranslucent: $toolbarBottomTranslucent, toolbarTopBackgroundColor: $toolbarTopBackgroundColor, toolbarTopBarTintColor: $toolbarTopBarTintColor, toolbarTopFixedTitle: $toolbarTopFixedTitle, toolbarTopTintColor: $toolbarTopTintColor, toolbarTopTranslucent: $toolbarTopTranslucent, transitionStyle: $transitionStyle, windowAlphaValue: $windowAlphaValue, windowFrame: $windowFrame, windowStyleMask: $windowStyleMask, windowTitlebarSeparatorStyle: $windowTitlebarSeparatorStyle, windowType: $windowType}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import '../pull_to_refresh/pull_to_refresh_controller.dart';
|
||||||
import '../pull_to_refresh/pull_to_refresh_settings.dart';
|
import '../pull_to_refresh/pull_to_refresh_settings.dart';
|
||||||
import '../types/disposable.dart';
|
import '../types/disposable.dart';
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.HeadlessInAppWebView}
|
||||||
///Class that represents a WebView in headless mode.
|
///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.
|
///It can be used to run a WebView in background without attaching an `InAppWebView` to the widget tree.
|
||||||
///
|
///
|
||||||
|
@ -27,6 +28,7 @@ import '../types/disposable.dart';
|
||||||
///- iOS
|
///- iOS
|
||||||
///- Web
|
///- Web
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
class HeadlessInAppWebView implements WebView, Disposable {
|
class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
///View ID.
|
///View ID.
|
||||||
late final String id;
|
late final String id;
|
||||||
|
@ -41,7 +43,7 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
///WebView Controller that can be used to access the [InAppWebViewController] API.
|
///WebView Controller that can be used to access the [InAppWebViewController] API.
|
||||||
late final InAppWebViewController webViewController;
|
late final InAppWebViewController webViewController;
|
||||||
|
|
||||||
///The window id of a [CreateWindowAction.windowId].
|
///{@macro flutter_inappwebview.WebView.windowId}
|
||||||
final int? windowId;
|
final int? windowId;
|
||||||
|
|
||||||
///The WebView initial size in pixels.
|
///The WebView initial size in pixels.
|
||||||
|
@ -50,8 +52,15 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
///`Size(-1, -1)` will match both width and height of the current device screen size.
|
///`Size(-1, -1)` will match both width and height of the current device screen size.
|
||||||
///
|
///
|
||||||
///**NOTE for Android**: `Size` width and height values will be converted to `int` values because they cannot have `double` values.
|
///**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
|
||||||
final Size initialSize;
|
final Size initialSize;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.HeadlessInAppWebView}
|
||||||
HeadlessInAppWebView(
|
HeadlessInAppWebView(
|
||||||
{this.initialSize = const Size(-1, -1),
|
{this.initialSize = const Size(-1, -1),
|
||||||
this.windowId,
|
this.windowId,
|
||||||
|
@ -357,34 +366,44 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
return MapSize.fromMap(sizeMap);
|
return MapSize.fromMap(sizeMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialData}
|
||||||
@override
|
@override
|
||||||
final InAppWebViewInitialData? initialData;
|
final InAppWebViewInitialData? initialData;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialFile}
|
||||||
@override
|
@override
|
||||||
final String? initialFile;
|
final String? initialFile;
|
||||||
|
|
||||||
|
///Use [initialSettings] instead.
|
||||||
@override
|
@override
|
||||||
@Deprecated('Use initialSettings instead')
|
@Deprecated('Use initialSettings instead')
|
||||||
final InAppWebViewGroupOptions? initialOptions;
|
final InAppWebViewGroupOptions? initialOptions;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialSettings}
|
||||||
@override
|
@override
|
||||||
final InAppWebViewSettings? initialSettings;
|
final InAppWebViewSettings? initialSettings;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.contextMenu}
|
||||||
@override
|
@override
|
||||||
final ContextMenu? contextMenu;
|
final ContextMenu? contextMenu;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialUrlRequest}
|
||||||
@override
|
@override
|
||||||
final URLRequest? initialUrlRequest;
|
final URLRequest? initialUrlRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialUserScripts}
|
||||||
@override
|
@override
|
||||||
final UnmodifiableListView<UserScript>? initialUserScripts;
|
final UnmodifiableListView<UserScript>? initialUserScripts;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.pullToRefreshController}
|
||||||
@override
|
@override
|
||||||
final PullToRefreshController? pullToRefreshController;
|
final PullToRefreshController? pullToRefreshController;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.findInteractionController}
|
||||||
@override
|
@override
|
||||||
final FindInteractionController? findInteractionController;
|
final FindInteractionController? findInteractionController;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.implementation}
|
||||||
@override
|
@override
|
||||||
final WebViewImplementation implementation;
|
final WebViewImplementation implementation;
|
||||||
|
|
||||||
|
@ -413,10 +432,12 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
|
Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
|
||||||
Uri url, SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
Uri url, SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onPageCommitVisible}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, WebUri? url)?
|
void Function(InAppWebViewController controller, WebUri? url)?
|
||||||
onPageCommitVisible;
|
onPageCommitVisible;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onTitleChanged}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, String? title)?
|
void Function(InAppWebViewController controller, String? title)?
|
||||||
onTitleChanged;
|
onTitleChanged;
|
||||||
|
@ -447,31 +468,38 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
|
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onAjaxProgress}
|
||||||
@override
|
@override
|
||||||
Future<AjaxRequestAction> Function(
|
Future<AjaxRequestAction> Function(
|
||||||
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
||||||
onAjaxProgress;
|
onAjaxProgress;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onAjaxReadyStateChange}
|
||||||
@override
|
@override
|
||||||
Future<AjaxRequestAction?> Function(
|
Future<AjaxRequestAction?> Function(
|
||||||
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
||||||
onAjaxReadyStateChange;
|
onAjaxReadyStateChange;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onConsoleMessage}
|
||||||
@override
|
@override
|
||||||
void Function(
|
void Function(
|
||||||
InAppWebViewController controller, ConsoleMessage consoleMessage)?
|
InAppWebViewController controller, ConsoleMessage consoleMessage)?
|
||||||
onConsoleMessage;
|
onConsoleMessage;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onCreateWindow}
|
||||||
@override
|
@override
|
||||||
Future<bool?> Function(InAppWebViewController controller,
|
Future<bool?> Function(InAppWebViewController controller,
|
||||||
CreateWindowAction createWindowAction)? onCreateWindow;
|
CreateWindowAction createWindowAction)? onCreateWindow;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onCloseWindow}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller)? onCloseWindow;
|
void Function(InAppWebViewController controller)? onCloseWindow;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onWindowFocus}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller)? onWindowFocus;
|
void Function(InAppWebViewController controller)? onWindowFocus;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onWindowBlur}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller)? onWindowBlur;
|
void Function(InAppWebViewController controller)? onWindowBlur;
|
||||||
|
|
||||||
|
@ -480,6 +508,7 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, Uri url)? onDownloadStart;
|
void Function(InAppWebViewController controller, Uri url)? onDownloadStart;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onDownloadStartRequest}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller,
|
void Function(InAppWebViewController controller,
|
||||||
DownloadStartRequest downloadStartRequest)? onDownloadStartRequest;
|
DownloadStartRequest downloadStartRequest)? onDownloadStartRequest;
|
||||||
|
@ -490,16 +519,19 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
void Function(InAppWebViewController controller, int activeMatchOrdinal,
|
void Function(InAppWebViewController controller, int activeMatchOrdinal,
|
||||||
int numberOfMatches, bool isDoneCounting)? onFindResultReceived;
|
int numberOfMatches, bool isDoneCounting)? onFindResultReceived;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onJsAlert}
|
||||||
@override
|
@override
|
||||||
Future<JsAlertResponse?> Function(
|
Future<JsAlertResponse?> Function(
|
||||||
InAppWebViewController controller, JsAlertRequest jsAlertRequest)?
|
InAppWebViewController controller, JsAlertRequest jsAlertRequest)?
|
||||||
onJsAlert;
|
onJsAlert;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onJsConfirm}
|
||||||
@override
|
@override
|
||||||
Future<JsConfirmResponse?> Function(
|
Future<JsConfirmResponse?> Function(
|
||||||
InAppWebViewController controller, JsConfirmRequest jsConfirmRequest)?
|
InAppWebViewController controller, JsConfirmRequest jsConfirmRequest)?
|
||||||
onJsConfirm;
|
onJsConfirm;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onJsPrompt}
|
||||||
@override
|
@override
|
||||||
Future<JsPromptResponse?> Function(
|
Future<JsPromptResponse?> Function(
|
||||||
InAppWebViewController controller, JsPromptRequest jsPromptRequest)?
|
InAppWebViewController controller, JsPromptRequest jsPromptRequest)?
|
||||||
|
@ -511,6 +543,7 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
void Function(InAppWebViewController controller, Uri? url, int code,
|
void Function(InAppWebViewController controller, Uri? url, int code,
|
||||||
String message)? onLoadError;
|
String message)? onLoadError;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedError}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, WebResourceRequest request,
|
void Function(InAppWebViewController controller, WebResourceRequest request,
|
||||||
WebResourceError error)? onReceivedError;
|
WebResourceError error)? onReceivedError;
|
||||||
|
@ -521,9 +554,12 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
void Function(InAppWebViewController controller, Uri? url, int statusCode,
|
void Function(InAppWebViewController controller, Uri? url, int statusCode,
|
||||||
String description)? onLoadHttpError;
|
String description)? onLoadHttpError;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedHttpError}
|
||||||
|
@override
|
||||||
void Function(InAppWebViewController controller, WebResourceRequest request,
|
void Function(InAppWebViewController controller, WebResourceRequest request,
|
||||||
WebResourceResponse errorResponse)? onReceivedHttpError;
|
WebResourceResponse errorResponse)? onReceivedHttpError;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLoadResource}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, LoadedResource resource)?
|
void Function(InAppWebViewController controller, LoadedResource resource)?
|
||||||
onLoadResource;
|
onLoadResource;
|
||||||
|
@ -534,17 +570,21 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
Future<CustomSchemeResponse?> Function(
|
Future<CustomSchemeResponse?> Function(
|
||||||
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
|
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLoadResourceWithCustomScheme}
|
||||||
@override
|
@override
|
||||||
Future<CustomSchemeResponse?> Function(
|
Future<CustomSchemeResponse?> Function(
|
||||||
InAppWebViewController controller, WebResourceRequest request)?
|
InAppWebViewController controller, WebResourceRequest request)?
|
||||||
onLoadResourceWithCustomScheme;
|
onLoadResourceWithCustomScheme;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLoadStart}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, WebUri? url)? onLoadStart;
|
void Function(InAppWebViewController controller, WebUri? url)? onLoadStart;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLoadStop}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, WebUri? url)? onLoadStop;
|
void Function(InAppWebViewController controller, WebUri? url)? onLoadStop;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLongPressHitTestResult}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller,
|
void Function(InAppWebViewController controller,
|
||||||
InAppWebViewHitTestResult hitTestResult)? onLongPressHitTestResult;
|
InAppWebViewHitTestResult hitTestResult)? onLongPressHitTestResult;
|
||||||
|
@ -554,62 +594,77 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, Uri? url)? onPrint;
|
void Function(InAppWebViewController controller, Uri? url)? onPrint;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onPrintRequest}
|
||||||
@override
|
@override
|
||||||
Future<bool?> Function(InAppWebViewController controller, WebUri? url,
|
Future<bool?> Function(InAppWebViewController controller, WebUri? url,
|
||||||
PrintJobController? printJobController)? onPrintRequest;
|
PrintJobController? printJobController)? onPrintRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onProgressChanged}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, int progress)?
|
void Function(InAppWebViewController controller, int progress)?
|
||||||
onProgressChanged;
|
onProgressChanged;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedClientCertRequest}
|
||||||
@override
|
@override
|
||||||
Future<ClientCertResponse?> Function(InAppWebViewController controller,
|
Future<ClientCertResponse?> Function(InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? onReceivedClientCertRequest;
|
URLAuthenticationChallenge challenge)? onReceivedClientCertRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedHttpAuthRequest}
|
||||||
@override
|
@override
|
||||||
Future<HttpAuthResponse?> Function(InAppWebViewController controller,
|
Future<HttpAuthResponse?> Function(InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
|
URLAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedServerTrustAuthRequest}
|
||||||
@override
|
@override
|
||||||
Future<ServerTrustAuthResponse?> Function(InAppWebViewController controller,
|
Future<ServerTrustAuthResponse?> Function(InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? onReceivedServerTrustAuthRequest;
|
URLAuthenticationChallenge challenge)? onReceivedServerTrustAuthRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onScrollChanged}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, int x, int y)?
|
void Function(InAppWebViewController controller, int x, int y)?
|
||||||
onScrollChanged;
|
onScrollChanged;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onUpdateVisitedHistory}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, WebUri? url, bool? isReload)?
|
void Function(InAppWebViewController controller, WebUri? url, bool? isReload)?
|
||||||
onUpdateVisitedHistory;
|
onUpdateVisitedHistory;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onWebViewCreated}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller)? onWebViewCreated;
|
void Function(InAppWebViewController controller)? onWebViewCreated;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldInterceptAjaxRequest}
|
||||||
@override
|
@override
|
||||||
Future<AjaxRequest?> Function(
|
Future<AjaxRequest?> Function(
|
||||||
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
||||||
shouldInterceptAjaxRequest;
|
shouldInterceptAjaxRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldInterceptFetchRequest}
|
||||||
@override
|
@override
|
||||||
Future<FetchRequest?> Function(
|
Future<FetchRequest?> Function(
|
||||||
InAppWebViewController controller, FetchRequest fetchRequest)?
|
InAppWebViewController controller, FetchRequest fetchRequest)?
|
||||||
shouldInterceptFetchRequest;
|
shouldInterceptFetchRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldOverrideUrlLoading}
|
||||||
@override
|
@override
|
||||||
Future<NavigationActionPolicy?> Function(
|
Future<NavigationActionPolicy?> Function(
|
||||||
InAppWebViewController controller, NavigationAction navigationAction)?
|
InAppWebViewController controller, NavigationAction navigationAction)?
|
||||||
shouldOverrideUrlLoading;
|
shouldOverrideUrlLoading;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onEnterFullscreen}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller)? onEnterFullscreen;
|
void Function(InAppWebViewController controller)? onEnterFullscreen;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onExitFullscreen}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller)? onExitFullscreen;
|
void Function(InAppWebViewController controller)? onExitFullscreen;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onOverScrolled}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, int x, int y, bool clampedX,
|
void Function(InAppWebViewController controller, int x, int y, bool clampedX,
|
||||||
bool clampedY)? onOverScrolled;
|
bool clampedY)? onOverScrolled;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onZoomScaleChanged}
|
||||||
@override
|
@override
|
||||||
void Function(
|
void Function(
|
||||||
InAppWebViewController controller, double oldScale, double newScale)?
|
InAppWebViewController controller, double oldScale, double newScale)?
|
||||||
|
@ -680,88 +735,108 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
void Function(InAppWebViewController controller, LoginRequest loginRequest)?
|
void Function(InAppWebViewController controller, LoginRequest loginRequest)?
|
||||||
androidOnReceivedLoginRequest;
|
androidOnReceivedLoginRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onDidReceiveServerRedirectForProvisionalNavigation}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller)?
|
void Function(InAppWebViewController controller)?
|
||||||
onDidReceiveServerRedirectForProvisionalNavigation;
|
onDidReceiveServerRedirectForProvisionalNavigation;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onFormResubmission}
|
||||||
@override
|
@override
|
||||||
Future<FormResubmissionAction?> Function(
|
Future<FormResubmissionAction?> Function(
|
||||||
InAppWebViewController controller, WebUri? url)? onFormResubmission;
|
InAppWebViewController controller, WebUri? url)? onFormResubmission;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onGeolocationPermissionsHidePrompt}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller)?
|
void Function(InAppWebViewController controller)?
|
||||||
onGeolocationPermissionsHidePrompt;
|
onGeolocationPermissionsHidePrompt;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onGeolocationPermissionsShowPrompt}
|
||||||
@override
|
@override
|
||||||
Future<GeolocationPermissionShowPromptResponse?> Function(
|
Future<GeolocationPermissionShowPromptResponse?> Function(
|
||||||
InAppWebViewController controller, String origin)?
|
InAppWebViewController controller, String origin)?
|
||||||
onGeolocationPermissionsShowPrompt;
|
onGeolocationPermissionsShowPrompt;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onJsBeforeUnload}
|
||||||
@override
|
@override
|
||||||
Future<JsBeforeUnloadResponse?> Function(InAppWebViewController controller,
|
Future<JsBeforeUnloadResponse?> Function(InAppWebViewController controller,
|
||||||
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onNavigationResponse}
|
||||||
@override
|
@override
|
||||||
Future<NavigationResponseAction?> Function(InAppWebViewController controller,
|
Future<NavigationResponseAction?> Function(InAppWebViewController controller,
|
||||||
NavigationResponse navigationResponse)? onNavigationResponse;
|
NavigationResponse navigationResponse)? onNavigationResponse;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onPermissionRequest}
|
||||||
@override
|
@override
|
||||||
Future<PermissionResponse?> Function(InAppWebViewController controller,
|
Future<PermissionResponse?> Function(InAppWebViewController controller,
|
||||||
PermissionRequest permissionRequest)? onPermissionRequest;
|
PermissionRequest permissionRequest)? onPermissionRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedIcon}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, Uint8List icon)?
|
void Function(InAppWebViewController controller, Uint8List icon)?
|
||||||
onReceivedIcon;
|
onReceivedIcon;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedLoginRequest}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller, LoginRequest loginRequest)?
|
void Function(InAppWebViewController controller, LoginRequest loginRequest)?
|
||||||
onReceivedLoginRequest;
|
onReceivedLoginRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onPermissionRequestCanceled}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller,
|
void Function(InAppWebViewController controller,
|
||||||
PermissionRequest permissionRequest)? onPermissionRequestCanceled;
|
PermissionRequest permissionRequest)? onPermissionRequestCanceled;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onRequestFocus}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)? onRequestFocus;
|
void Function(InAppWebViewController controller)? onRequestFocus;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedTouchIconUrl}
|
||||||
@override
|
@override
|
||||||
void Function(
|
void Function(
|
||||||
InAppWebViewController controller, WebUri url, bool precomposed)?
|
InAppWebViewController controller, WebUri url, bool precomposed)?
|
||||||
onReceivedTouchIconUrl;
|
onReceivedTouchIconUrl;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onRenderProcessGone}
|
||||||
@override
|
@override
|
||||||
void Function(
|
void Function(
|
||||||
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
||||||
onRenderProcessGone;
|
onRenderProcessGone;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onRenderProcessResponsive}
|
||||||
@override
|
@override
|
||||||
Future<WebViewRenderProcessAction?> Function(
|
Future<WebViewRenderProcessAction?> Function(
|
||||||
InAppWebViewController controller, WebUri? url)?
|
InAppWebViewController controller, WebUri? url)?
|
||||||
onRenderProcessResponsive;
|
onRenderProcessResponsive;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onRenderProcessUnresponsive}
|
||||||
@override
|
@override
|
||||||
Future<WebViewRenderProcessAction?> Function(
|
Future<WebViewRenderProcessAction?> Function(
|
||||||
InAppWebViewController controller, WebUri? url)?
|
InAppWebViewController controller, WebUri? url)?
|
||||||
onRenderProcessUnresponsive;
|
onRenderProcessUnresponsive;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onSafeBrowsingHit}
|
||||||
@override
|
@override
|
||||||
Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
|
Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
|
||||||
WebUri url, SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
|
WebUri url, SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onWebContentProcessDidTerminate}
|
||||||
@override
|
@override
|
||||||
void Function(InAppWebViewController controller)?
|
void Function(InAppWebViewController controller)?
|
||||||
onWebContentProcessDidTerminate;
|
onWebContentProcessDidTerminate;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldAllowDeprecatedTLS}
|
||||||
@override
|
@override
|
||||||
Future<ShouldAllowDeprecatedTLSAction?> Function(
|
Future<ShouldAllowDeprecatedTLSAction?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldInterceptRequest}
|
||||||
@override
|
@override
|
||||||
Future<WebResourceResponse?> Function(
|
Future<WebResourceResponse?> Function(
|
||||||
InAppWebViewController controller, WebResourceRequest request)?
|
InAppWebViewController controller, WebResourceRequest request)?
|
||||||
shouldInterceptRequest;
|
shouldInterceptRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onCameraCaptureStateChanged}
|
||||||
@override
|
@override
|
||||||
Future<void> Function(
|
Future<void> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
|
@ -769,6 +844,7 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
MediaCaptureState? newState,
|
MediaCaptureState? newState,
|
||||||
)? onCameraCaptureStateChanged;
|
)? onCameraCaptureStateChanged;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onMicrophoneCaptureStateChanged}
|
||||||
@override
|
@override
|
||||||
Future<void> Function(
|
Future<void> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
|
@ -776,8 +852,9 @@ class HeadlessInAppWebView implements WebView, Disposable {
|
||||||
MediaCaptureState? newState,
|
MediaCaptureState? newState,
|
||||||
)? onMicrophoneCaptureStateChanged;
|
)? onMicrophoneCaptureStateChanged;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onContentSizeChanged}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, Size oldContentSize,
|
void Function(InAppWebViewController controller, Size oldContentSize,
|
||||||
Size newContentSize)? onContentSizeChanged;
|
Size newContentSize)? onContentSizeChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,12 +24,14 @@ import 'in_app_webview_controller.dart';
|
||||||
import 'in_app_webview_settings.dart';
|
import 'in_app_webview_settings.dart';
|
||||||
import '../pull_to_refresh/main.dart';
|
import '../pull_to_refresh/main.dart';
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.InAppWebView}
|
||||||
///Flutter Widget for adding an **inline native WebView** integrated in the flutter widget tree.
|
///Flutter Widget for adding an **inline native WebView** integrated in the flutter widget tree.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
class InAppWebView extends StatefulWidget implements WebView {
|
class InAppWebView extends StatefulWidget implements WebView {
|
||||||
/// `gestureRecognizers` specifies which gestures should be consumed by the WebView.
|
/// `gestureRecognizers` specifies which gestures should be consumed by the WebView.
|
||||||
/// It is possible for other gesture recognizers to be competing with the web view on pointer
|
/// It is possible for other gesture recognizers to be competing with the web view on pointer
|
||||||
|
@ -40,11 +42,7 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
/// were not claimed by any other gesture recognizer.
|
/// were not claimed by any other gesture recognizer.
|
||||||
final Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers;
|
final Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers;
|
||||||
|
|
||||||
///The window id of a [CreateWindowAction.windowId].
|
///{@macro flutter_inappwebview.WebView.windowId}
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
///- iOS
|
|
||||||
@override
|
@override
|
||||||
final int? windowId;
|
final int? windowId;
|
||||||
|
|
||||||
|
@ -56,6 +54,7 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
///- Web
|
///- Web
|
||||||
final HeadlessInAppWebView? headlessWebView;
|
final HeadlessInAppWebView? headlessWebView;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.InAppWebView}
|
||||||
const InAppWebView({
|
const InAppWebView({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.windowId,
|
this.windowId,
|
||||||
|
@ -202,9 +201,11 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
Uri url,
|
Uri url,
|
||||||
SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialData}
|
||||||
@override
|
@override
|
||||||
final InAppWebViewInitialData? initialData;
|
final InAppWebViewInitialData? initialData;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialFile}
|
||||||
@override
|
@override
|
||||||
final String? initialFile;
|
final String? initialFile;
|
||||||
|
|
||||||
|
@ -213,31 +214,40 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
@Deprecated('Use initialSettings instead')
|
@Deprecated('Use initialSettings instead')
|
||||||
final InAppWebViewGroupOptions? initialOptions;
|
final InAppWebViewGroupOptions? initialOptions;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialSettings}
|
||||||
@override
|
@override
|
||||||
final InAppWebViewSettings? initialSettings;
|
final InAppWebViewSettings? initialSettings;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialUrlRequest}
|
||||||
@override
|
@override
|
||||||
final URLRequest? initialUrlRequest;
|
final URLRequest? initialUrlRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.implementation}
|
||||||
@override
|
@override
|
||||||
final WebViewImplementation implementation;
|
final WebViewImplementation implementation;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.initialUserScripts}
|
||||||
@override
|
@override
|
||||||
final UnmodifiableListView<UserScript>? initialUserScripts;
|
final UnmodifiableListView<UserScript>? initialUserScripts;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.pullToRefreshController}
|
||||||
@override
|
@override
|
||||||
final PullToRefreshController? pullToRefreshController;
|
final PullToRefreshController? pullToRefreshController;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.findInteractionController}
|
||||||
@override
|
@override
|
||||||
final FindInteractionController? findInteractionController;
|
final FindInteractionController? findInteractionController;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.contextMenu}
|
||||||
@override
|
@override
|
||||||
final ContextMenu? contextMenu;
|
final ContextMenu? contextMenu;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onPageCommitVisible}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, WebUri? url)?
|
final void Function(InAppWebViewController controller, WebUri? url)?
|
||||||
onPageCommitVisible;
|
onPageCommitVisible;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onTitleChanged}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, String? title)?
|
final void Function(InAppWebViewController controller, String? title)?
|
||||||
onTitleChanged;
|
onTitleChanged;
|
||||||
|
@ -268,31 +278,38 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
|
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onAjaxProgress}
|
||||||
@override
|
@override
|
||||||
final Future<AjaxRequestAction> Function(
|
final Future<AjaxRequestAction> Function(
|
||||||
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
||||||
onAjaxProgress;
|
onAjaxProgress;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onAjaxReadyStateChange}
|
||||||
@override
|
@override
|
||||||
final Future<AjaxRequestAction?> Function(
|
final Future<AjaxRequestAction?> Function(
|
||||||
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
||||||
onAjaxReadyStateChange;
|
onAjaxReadyStateChange;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onConsoleMessage}
|
||||||
@override
|
@override
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, ConsoleMessage consoleMessage)?
|
InAppWebViewController controller, ConsoleMessage consoleMessage)?
|
||||||
onConsoleMessage;
|
onConsoleMessage;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onCreateWindow}
|
||||||
@override
|
@override
|
||||||
final Future<bool?> Function(InAppWebViewController controller,
|
final Future<bool?> Function(InAppWebViewController controller,
|
||||||
CreateWindowAction createWindowAction)? onCreateWindow;
|
CreateWindowAction createWindowAction)? onCreateWindow;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onCloseWindow}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)? onCloseWindow;
|
final void Function(InAppWebViewController controller)? onCloseWindow;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onWindowFocus}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)? onWindowFocus;
|
final void Function(InAppWebViewController controller)? onWindowFocus;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onWindowBlur}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)? onWindowBlur;
|
final void Function(InAppWebViewController controller)? onWindowBlur;
|
||||||
|
|
||||||
|
@ -315,6 +332,7 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
final void Function(InAppWebViewController controller, Uri url)?
|
final void Function(InAppWebViewController controller, Uri url)?
|
||||||
onDownloadStart;
|
onDownloadStart;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onDownloadStartRequest}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller,
|
final void Function(InAppWebViewController controller,
|
||||||
DownloadStartRequest downloadStartRequest)? onDownloadStartRequest;
|
DownloadStartRequest downloadStartRequest)? onDownloadStartRequest;
|
||||||
|
@ -325,16 +343,19 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
final void Function(InAppWebViewController controller, int activeMatchOrdinal,
|
final void Function(InAppWebViewController controller, int activeMatchOrdinal,
|
||||||
int numberOfMatches, bool isDoneCounting)? onFindResultReceived;
|
int numberOfMatches, bool isDoneCounting)? onFindResultReceived;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onJsAlert}
|
||||||
@override
|
@override
|
||||||
final Future<JsAlertResponse?> Function(
|
final Future<JsAlertResponse?> Function(
|
||||||
InAppWebViewController controller, JsAlertRequest jsAlertRequest)?
|
InAppWebViewController controller, JsAlertRequest jsAlertRequest)?
|
||||||
onJsAlert;
|
onJsAlert;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onJsConfirm}
|
||||||
@override
|
@override
|
||||||
final Future<JsConfirmResponse?> Function(
|
final Future<JsConfirmResponse?> Function(
|
||||||
InAppWebViewController controller, JsConfirmRequest jsConfirmRequest)?
|
InAppWebViewController controller, JsConfirmRequest jsConfirmRequest)?
|
||||||
onJsConfirm;
|
onJsConfirm;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onJsPrompt}
|
||||||
@override
|
@override
|
||||||
final Future<JsPromptResponse?> Function(
|
final Future<JsPromptResponse?> Function(
|
||||||
InAppWebViewController controller, JsPromptRequest jsPromptRequest)?
|
InAppWebViewController controller, JsPromptRequest jsPromptRequest)?
|
||||||
|
@ -346,6 +367,7 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
final void Function(InAppWebViewController controller, Uri? url, int code,
|
final void Function(InAppWebViewController controller, Uri? url, int code,
|
||||||
String message)? onLoadError;
|
String message)? onLoadError;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedError}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller,
|
final void Function(InAppWebViewController controller,
|
||||||
WebResourceRequest request, WebResourceError error)? onReceivedError;
|
WebResourceRequest request, WebResourceError error)? onReceivedError;
|
||||||
|
@ -356,12 +378,14 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
final void Function(InAppWebViewController controller, Uri? url,
|
final void Function(InAppWebViewController controller, Uri? url,
|
||||||
int statusCode, String description)? onLoadHttpError;
|
int statusCode, String description)? onLoadHttpError;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedHttpError}
|
||||||
@override
|
@override
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
WebResourceRequest request,
|
WebResourceRequest request,
|
||||||
WebResourceResponse errorResponse)? onReceivedHttpError;
|
WebResourceResponse errorResponse)? onReceivedHttpError;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLoadResource}
|
||||||
@override
|
@override
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, LoadedResource resource)?
|
InAppWebViewController controller, LoadedResource resource)?
|
||||||
|
@ -373,19 +397,23 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
final Future<CustomSchemeResponse?> Function(
|
final Future<CustomSchemeResponse?> Function(
|
||||||
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
|
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLoadResourceWithCustomScheme}
|
||||||
@override
|
@override
|
||||||
final Future<CustomSchemeResponse?> Function(
|
final Future<CustomSchemeResponse?> Function(
|
||||||
InAppWebViewController controller, WebResourceRequest request)?
|
InAppWebViewController controller, WebResourceRequest request)?
|
||||||
onLoadResourceWithCustomScheme;
|
onLoadResourceWithCustomScheme;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLoadStart}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, WebUri? url)?
|
final void Function(InAppWebViewController controller, WebUri? url)?
|
||||||
onLoadStart;
|
onLoadStart;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLoadStop}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, WebUri? url)?
|
final void Function(InAppWebViewController controller, WebUri? url)?
|
||||||
onLoadStop;
|
onLoadStop;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onLongPressHitTestResult}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller,
|
final void Function(InAppWebViewController controller,
|
||||||
InAppWebViewHitTestResult hitTestResult)? onLongPressHitTestResult;
|
InAppWebViewHitTestResult hitTestResult)? onLongPressHitTestResult;
|
||||||
|
@ -395,64 +423,79 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, Uri? url)? onPrint;
|
final void Function(InAppWebViewController controller, Uri? url)? onPrint;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onPrintRequest}
|
||||||
@override
|
@override
|
||||||
final Future<bool?> Function(InAppWebViewController controller, WebUri? url,
|
final Future<bool?> Function(InAppWebViewController controller, WebUri? url,
|
||||||
PrintJobController? printJobController)? onPrintRequest;
|
PrintJobController? printJobController)? onPrintRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onProgressChanged}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, int progress)?
|
final void Function(InAppWebViewController controller, int progress)?
|
||||||
onProgressChanged;
|
onProgressChanged;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedClientCertRequest}
|
||||||
@override
|
@override
|
||||||
final Future<ClientCertResponse?> Function(InAppWebViewController controller,
|
final Future<ClientCertResponse?> Function(InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? onReceivedClientCertRequest;
|
URLAuthenticationChallenge challenge)? onReceivedClientCertRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedHttpAuthRequest}
|
||||||
@override
|
@override
|
||||||
final Future<HttpAuthResponse?> Function(InAppWebViewController controller,
|
final Future<HttpAuthResponse?> Function(InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
|
URLAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedServerTrustAuthRequest}
|
||||||
@override
|
@override
|
||||||
final Future<ServerTrustAuthResponse?> Function(
|
final Future<ServerTrustAuthResponse?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? onReceivedServerTrustAuthRequest;
|
URLAuthenticationChallenge challenge)? onReceivedServerTrustAuthRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onScrollChanged}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, int x, int y)?
|
final void Function(InAppWebViewController controller, int x, int y)?
|
||||||
onScrollChanged;
|
onScrollChanged;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onUpdateVisitedHistory}
|
||||||
@override
|
@override
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, WebUri? url, bool? isReload)?
|
InAppWebViewController controller, WebUri? url, bool? isReload)?
|
||||||
onUpdateVisitedHistory;
|
onUpdateVisitedHistory;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onWebViewCreated}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)? onWebViewCreated;
|
final void Function(InAppWebViewController controller)? onWebViewCreated;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldInterceptAjaxRequest}
|
||||||
@override
|
@override
|
||||||
final Future<AjaxRequest?> Function(
|
final Future<AjaxRequest?> Function(
|
||||||
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
||||||
shouldInterceptAjaxRequest;
|
shouldInterceptAjaxRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldInterceptFetchRequest}
|
||||||
@override
|
@override
|
||||||
final Future<FetchRequest?> Function(
|
final Future<FetchRequest?> Function(
|
||||||
InAppWebViewController controller, FetchRequest fetchRequest)?
|
InAppWebViewController controller, FetchRequest fetchRequest)?
|
||||||
shouldInterceptFetchRequest;
|
shouldInterceptFetchRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldOverrideUrlLoading}
|
||||||
@override
|
@override
|
||||||
final Future<NavigationActionPolicy?> Function(
|
final Future<NavigationActionPolicy?> Function(
|
||||||
InAppWebViewController controller, NavigationAction navigationAction)?
|
InAppWebViewController controller, NavigationAction navigationAction)?
|
||||||
shouldOverrideUrlLoading;
|
shouldOverrideUrlLoading;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onEnterFullscreen}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)? onEnterFullscreen;
|
final void Function(InAppWebViewController controller)? onEnterFullscreen;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onExitFullscreen}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)? onExitFullscreen;
|
final void Function(InAppWebViewController controller)? onExitFullscreen;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onOverScrolled}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, int x, int y,
|
final void Function(InAppWebViewController controller, int x, int y,
|
||||||
bool clampedX, bool clampedY)? onOverScrolled;
|
bool clampedX, bool clampedY)? onOverScrolled;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onZoomScaleChanged}
|
||||||
@override
|
@override
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, double oldScale, double newScale)?
|
InAppWebViewController controller, double oldScale, double newScale)?
|
||||||
|
@ -513,93 +556,113 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
InAppWebViewController controller, LoginRequest loginRequest)?
|
InAppWebViewController controller, LoginRequest loginRequest)?
|
||||||
androidOnReceivedLoginRequest;
|
androidOnReceivedLoginRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onDidReceiveServerRedirectForProvisionalNavigation}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)?
|
final void Function(InAppWebViewController controller)?
|
||||||
onDidReceiveServerRedirectForProvisionalNavigation;
|
onDidReceiveServerRedirectForProvisionalNavigation;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onFormResubmission}
|
||||||
@override
|
@override
|
||||||
final Future<FormResubmissionAction?> Function(
|
final Future<FormResubmissionAction?> Function(
|
||||||
InAppWebViewController controller, WebUri? url)? onFormResubmission;
|
InAppWebViewController controller, WebUri? url)? onFormResubmission;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onGeolocationPermissionsHidePrompt}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)?
|
final void Function(InAppWebViewController controller)?
|
||||||
onGeolocationPermissionsHidePrompt;
|
onGeolocationPermissionsHidePrompt;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onGeolocationPermissionsShowPrompt}
|
||||||
@override
|
@override
|
||||||
final Future<GeolocationPermissionShowPromptResponse?> Function(
|
final Future<GeolocationPermissionShowPromptResponse?> Function(
|
||||||
InAppWebViewController controller, String origin)?
|
InAppWebViewController controller, String origin)?
|
||||||
onGeolocationPermissionsShowPrompt;
|
onGeolocationPermissionsShowPrompt;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onJsBeforeUnload}
|
||||||
@override
|
@override
|
||||||
final Future<JsBeforeUnloadResponse?> Function(
|
final Future<JsBeforeUnloadResponse?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onNavigationResponse}
|
||||||
@override
|
@override
|
||||||
final Future<NavigationResponseAction?> Function(
|
final Future<NavigationResponseAction?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
NavigationResponse navigationResponse)? onNavigationResponse;
|
NavigationResponse navigationResponse)? onNavigationResponse;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onPermissionRequest}
|
||||||
@override
|
@override
|
||||||
final Future<PermissionResponse?> Function(InAppWebViewController controller,
|
final Future<PermissionResponse?> Function(InAppWebViewController controller,
|
||||||
PermissionRequest permissionRequest)? onPermissionRequest;
|
PermissionRequest permissionRequest)? onPermissionRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedIcon}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, Uint8List icon)?
|
final void Function(InAppWebViewController controller, Uint8List icon)?
|
||||||
onReceivedIcon;
|
onReceivedIcon;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedLoginRequest}
|
||||||
@override
|
@override
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, LoginRequest loginRequest)?
|
InAppWebViewController controller, LoginRequest loginRequest)?
|
||||||
onReceivedLoginRequest;
|
onReceivedLoginRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onPermissionRequestCanceled}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller,
|
final void Function(InAppWebViewController controller,
|
||||||
PermissionRequest permissionRequest)? onPermissionRequestCanceled;
|
PermissionRequest permissionRequest)? onPermissionRequestCanceled;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onRequestFocus}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)? onRequestFocus;
|
final void Function(InAppWebViewController controller)? onRequestFocus;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onReceivedTouchIconUrl}
|
||||||
@override
|
@override
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, WebUri url, bool precomposed)?
|
InAppWebViewController controller, WebUri url, bool precomposed)?
|
||||||
onReceivedTouchIconUrl;
|
onReceivedTouchIconUrl;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onRenderProcessGone}
|
||||||
@override
|
@override
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
||||||
onRenderProcessGone;
|
onRenderProcessGone;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onRenderProcessResponsive}
|
||||||
@override
|
@override
|
||||||
final Future<WebViewRenderProcessAction?> Function(
|
final Future<WebViewRenderProcessAction?> Function(
|
||||||
InAppWebViewController controller, WebUri? url)?
|
InAppWebViewController controller, WebUri? url)?
|
||||||
onRenderProcessResponsive;
|
onRenderProcessResponsive;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onRenderProcessUnresponsive}
|
||||||
@override
|
@override
|
||||||
final Future<WebViewRenderProcessAction?> Function(
|
final Future<WebViewRenderProcessAction?> Function(
|
||||||
InAppWebViewController controller, WebUri? url)?
|
InAppWebViewController controller, WebUri? url)?
|
||||||
onRenderProcessUnresponsive;
|
onRenderProcessUnresponsive;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onSafeBrowsingHit}
|
||||||
@override
|
@override
|
||||||
final Future<SafeBrowsingResponse?> Function(
|
final Future<SafeBrowsingResponse?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
WebUri url,
|
WebUri url,
|
||||||
SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
|
SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onWebContentProcessDidTerminate}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller)?
|
final void Function(InAppWebViewController controller)?
|
||||||
onWebContentProcessDidTerminate;
|
onWebContentProcessDidTerminate;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldAllowDeprecatedTLS}
|
||||||
@override
|
@override
|
||||||
final Future<ShouldAllowDeprecatedTLSAction?> Function(
|
final Future<ShouldAllowDeprecatedTLSAction?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.shouldInterceptRequest}
|
||||||
@override
|
@override
|
||||||
final Future<WebResourceResponse?> Function(
|
final Future<WebResourceResponse?> Function(
|
||||||
InAppWebViewController controller, WebResourceRequest request)?
|
InAppWebViewController controller, WebResourceRequest request)?
|
||||||
shouldInterceptRequest;
|
shouldInterceptRequest;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onCameraCaptureStateChanged}
|
||||||
@override
|
@override
|
||||||
final Future<void> Function(
|
final Future<void> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
|
@ -607,6 +670,7 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
MediaCaptureState? newState,
|
MediaCaptureState? newState,
|
||||||
)? onCameraCaptureStateChanged;
|
)? onCameraCaptureStateChanged;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onMicrophoneCaptureStateChanged}
|
||||||
@override
|
@override
|
||||||
final Future<void> Function(
|
final Future<void> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
|
@ -614,6 +678,7 @@ class InAppWebView extends StatefulWidget implements WebView {
|
||||||
MediaCaptureState? newState,
|
MediaCaptureState? newState,
|
||||||
)? onMicrophoneCaptureStateChanged;
|
)? onMicrophoneCaptureStateChanged;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView.onContentSizeChanged}
|
||||||
@override
|
@override
|
||||||
final void Function(InAppWebViewController controller, Size oldContentSize,
|
final void Function(InAppWebViewController controller, Size oldContentSize,
|
||||||
Size newContentSize)? onContentSizeChanged;
|
Size newContentSize)? onContentSizeChanged;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -18,7 +18,9 @@ import '../print_job/main.dart';
|
||||||
|
|
||||||
import '../debug_logging_settings.dart';
|
import '../debug_logging_settings.dart';
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView}
|
||||||
///Abstract class that represents a WebView. Used by [InAppWebView], [HeadlessInAppWebView] and the WebView of [InAppBrowser].
|
///Abstract class that represents a WebView. Used by [InAppWebView], [HeadlessInAppWebView] and the WebView of [InAppBrowser].
|
||||||
|
///{@endtemplate}
|
||||||
abstract class WebView {
|
abstract class WebView {
|
||||||
///Debug settings used by [InAppWebView], [HeadlessInAppWebView] and [InAppBrowser].
|
///Debug settings used by [InAppWebView], [HeadlessInAppWebView] and [InAppBrowser].
|
||||||
///The default value excludes the [WebView.onScrollChanged], [WebView.onOverScrolled] and [WebView.onReceivedIcon] events.
|
///The default value excludes the [WebView.onScrollChanged], [WebView.onOverScrolled] and [WebView.onReceivedIcon] events.
|
||||||
|
@ -30,9 +32,17 @@ abstract class WebView {
|
||||||
RegExp(r"onReceivedIcon")
|
RegExp(r"onReceivedIcon")
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.windowId}
|
||||||
///The window id of a [CreateWindowAction.windowId].
|
///The window id of a [CreateWindowAction.windowId].
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final int? windowId;
|
final int? windowId;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onWebViewCreated}
|
||||||
///Event fired when the [WebView] is created.
|
///Event fired when the [WebView] is created.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -40,8 +50,10 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)? onWebViewCreated;
|
final void Function(InAppWebViewController controller)? onWebViewCreated;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onLoadStart}
|
||||||
///Event fired when the [WebView] starts to load an [url].
|
///Event fired when the [WebView] starts to load an [url].
|
||||||
///
|
///
|
||||||
///**NOTE for Web**: it will be dispatched at the same time of [onLoadStop] event
|
///**NOTE for Web**: it will be dispatched at the same time of [onLoadStop] event
|
||||||
|
@ -54,9 +66,11 @@ abstract class WebView {
|
||||||
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview))
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller, WebUri? url)?
|
final void Function(InAppWebViewController controller, WebUri? url)?
|
||||||
onLoadStart;
|
onLoadStart;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onLoadStop}
|
||||||
///Event fired when the [WebView] finishes loading an [url].
|
///Event fired when the [WebView] finishes loading an [url].
|
||||||
///
|
///
|
||||||
///**NOTE for Web**: If `window.location.href` isn't accessible inside the iframe,
|
///**NOTE for Web**: If `window.location.href` isn't accessible inside the iframe,
|
||||||
|
@ -67,6 +81,7 @@ abstract class WebView {
|
||||||
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455629-webview))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455629-webview))
|
||||||
///- Web ([Official API - Window.onload](https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event))
|
///- Web ([Official API - Window.onload](https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller, WebUri? url)?
|
final void Function(InAppWebViewController controller, WebUri? url)?
|
||||||
onLoadStop;
|
onLoadStop;
|
||||||
|
|
||||||
|
@ -75,12 +90,14 @@ abstract class WebView {
|
||||||
final void Function(InAppWebViewController controller, Uri? url, int code,
|
final void Function(InAppWebViewController controller, Uri? url, int code,
|
||||||
String message)? onLoadError;
|
String message)? onLoadError;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onReceivedError}
|
||||||
///Event fired when the [WebView] encounters an [error] loading a [request].
|
///Event fired when the [WebView] encounters an [error] loading a [request].
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455623-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller,
|
final void Function(InAppWebViewController controller,
|
||||||
WebResourceRequest request, WebResourceError error)? onReceivedError;
|
WebResourceRequest request, WebResourceError error)? onReceivedError;
|
||||||
|
|
||||||
|
@ -89,6 +106,7 @@ abstract class WebView {
|
||||||
final void Function(InAppWebViewController controller, Uri? url,
|
final void Function(InAppWebViewController controller, Uri? url,
|
||||||
int statusCode, String description)? onLoadHttpError;
|
int statusCode, String description)? onLoadHttpError;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onReceivedHttpError}
|
||||||
///Event fired when the [WebView] receives an HTTP error.
|
///Event fired when the [WebView] receives an HTTP error.
|
||||||
///
|
///
|
||||||
///[request] represents the originating request.
|
///[request] represents the originating request.
|
||||||
|
@ -101,20 +119,24 @@ abstract class WebView {
|
||||||
///- 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)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
WebResourceRequest request,
|
WebResourceRequest request,
|
||||||
WebResourceResponse errorResponse)? onReceivedHttpError;
|
WebResourceResponse errorResponse)? onReceivedHttpError;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onProgressChanged}
|
||||||
///Event fired when the current [progress] of loading a page is changed.
|
///Event fired when the current [progress] of loading a page is changed.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView ([Official API - WebChromeClient.onProgressChanged](https://developer.android.com/reference/android/webkit/WebChromeClient#onProgressChanged(android.webkit.WebView,%20int)))
|
///- Android native WebView ([Official API - WebChromeClient.onProgressChanged](https://developer.android.com/reference/android/webkit/WebChromeClient#onProgressChanged(android.webkit.WebView,%20int)))
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller, int progress)?
|
final void Function(InAppWebViewController controller, int progress)?
|
||||||
onProgressChanged;
|
onProgressChanged;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onConsoleMessage}
|
||||||
///Event fired when the [WebView] receives a [ConsoleMessage].
|
///Event fired when the [WebView] receives a [ConsoleMessage].
|
||||||
///
|
///
|
||||||
///**NOTE for Web**: this event will be called only if the iframe has the same origin.
|
///**NOTE for Web**: this event will be called only if the iframe has the same origin.
|
||||||
|
@ -124,10 +146,12 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, ConsoleMessage consoleMessage)?
|
InAppWebViewController controller, ConsoleMessage consoleMessage)?
|
||||||
onConsoleMessage;
|
onConsoleMessage;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.shouldOverrideUrlLoading}
|
||||||
///Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
|
///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.
|
///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.
|
||||||
|
@ -145,10 +169,12 @@ abstract class WebView {
|
||||||
///- Android native WebView ([Official API - WebViewClient.shouldOverrideUrlLoading](https://developer.android.com/reference/android/webkit/WebViewClient#shouldOverrideUrlLoading(android.webkit.WebView,%20java.lang.String)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455641-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<NavigationActionPolicy?> Function(
|
final Future<NavigationActionPolicy?> Function(
|
||||||
InAppWebViewController controller, NavigationAction navigationAction)?
|
InAppWebViewController controller, NavigationAction navigationAction)?
|
||||||
shouldOverrideUrlLoading;
|
shouldOverrideUrlLoading;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onLoadResource}
|
||||||
///Event fired when the [WebView] loads a resource.
|
///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`.
|
///**NOTE**: In order to be able to listen this event, you need to set [InAppWebViewSettings.useOnLoadResource] and [InAppWebViewSettings.javaScriptEnabled] setting to `true`.
|
||||||
|
@ -157,10 +183,12 @@ abstract class WebView {
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, LoadedResource resource)?
|
InAppWebViewController controller, LoadedResource resource)?
|
||||||
onLoadResource;
|
onLoadResource;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onScrollChanged}
|
||||||
///Event fired when the [WebView] scrolls.
|
///Event fired when the [WebView] scrolls.
|
||||||
///
|
///
|
||||||
///[x] represents the current horizontal scroll origin in pixels.
|
///[x] represents the current horizontal scroll origin in pixels.
|
||||||
|
@ -176,6 +204,7 @@ abstract class WebView {
|
||||||
///- iOS ([Official API - UIScrollViewDelegate.scrollViewDidScroll](https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619392-scrollviewdidscroll))
|
///- 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))
|
///- Web ([Official API - Window.onscroll](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onscroll))
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller, int x, int y)?
|
final void Function(InAppWebViewController controller, int x, int y)?
|
||||||
onScrollChanged;
|
onScrollChanged;
|
||||||
|
|
||||||
|
@ -184,6 +213,7 @@ abstract class WebView {
|
||||||
final void Function(InAppWebViewController controller, Uri url)?
|
final void Function(InAppWebViewController controller, Uri url)?
|
||||||
onDownloadStart;
|
onDownloadStart;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onDownloadStartRequest}
|
||||||
///Event fired when [WebView] recognizes a downloadable file.
|
///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.
|
///To download the file, you can use the [flutter_downloader](https://pub.dev/packages/flutter_downloader) plugin.
|
||||||
///
|
///
|
||||||
|
@ -195,6 +225,7 @@ abstract class WebView {
|
||||||
///- Android native WebView ([Official API - WebView.setDownloadListener](https://developer.android.com/reference/android/webkit/WebView#setDownloadListener(android.webkit.DownloadListener)))
|
///- Android native WebView ([Official API - WebView.setDownloadListener](https://developer.android.com/reference/android/webkit/WebView#setDownloadListener(android.webkit.DownloadListener)))
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller,
|
final void Function(InAppWebViewController controller,
|
||||||
DownloadStartRequest downloadStartRequest)? onDownloadStartRequest;
|
DownloadStartRequest downloadStartRequest)? onDownloadStartRequest;
|
||||||
|
|
||||||
|
@ -203,6 +234,7 @@ abstract class WebView {
|
||||||
final Future<CustomSchemeResponse?> Function(
|
final Future<CustomSchemeResponse?> Function(
|
||||||
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
|
InAppWebViewController controller, Uri url)? onLoadResourceCustomScheme;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onLoadResourceWithCustomScheme}
|
||||||
///Event fired when the [WebView] finds the `custom-scheme` while loading a resource.
|
///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`.
|
///Here you can handle the url [request] and return a [CustomSchemeResponse] to load a specific resource encoded to `base64`.
|
||||||
///
|
///
|
||||||
|
@ -210,10 +242,12 @@ abstract class WebView {
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler))
|
///- iOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler))
|
||||||
///- MacOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler))
|
///- MacOS ([Official API - WKURLSchemeHandler](https://developer.apple.com/documentation/webkit/wkurlschemehandler))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<CustomSchemeResponse?> Function(
|
final Future<CustomSchemeResponse?> Function(
|
||||||
InAppWebViewController controller, WebResourceRequest request)?
|
InAppWebViewController controller, WebResourceRequest request)?
|
||||||
onLoadResourceWithCustomScheme;
|
onLoadResourceWithCustomScheme;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onCreateWindow}
|
||||||
///Event fired when the [WebView] requests the host application to create a new window,
|
///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.
|
///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.
|
///If the host application chooses to honor this request, it should return `true` from this method, create a new WebView to host the window.
|
||||||
|
@ -251,9 +285,11 @@ abstract class WebView {
|
||||||
///- iOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536907-webview))
|
///- 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))
|
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536907-webview))
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final Future<bool?> Function(InAppWebViewController controller,
|
final Future<bool?> Function(InAppWebViewController controller,
|
||||||
CreateWindowAction createWindowAction)? onCreateWindow;
|
CreateWindowAction createWindowAction)? onCreateWindow;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onCloseWindow}
|
||||||
///Event fired when the host application should close the given WebView and remove it from the view system if necessary.
|
///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.
|
///At this point, WebCore has stopped any loading in this window and has removed any cross-scripting ability in javascript.
|
||||||
///
|
///
|
||||||
|
@ -261,8 +297,10 @@ abstract class WebView {
|
||||||
///- Android native WebView ([Official API - WebChromeClient.onCloseWindow](https://developer.android.com/reference/android/webkit/WebChromeClient#onCloseWindow(android.webkit.WebView)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKUIDelegate.webViewDidClose](https://developer.apple.com/documentation/webkit/wkuidelegate/1537390-webviewdidclose))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)? onCloseWindow;
|
final void Function(InAppWebViewController controller)? onCloseWindow;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onWindowFocus}
|
||||||
///Event fired when the JavaScript `window` object of the WebView has received focus.
|
///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.
|
///This is the result of the `focus` JavaScript event applied to the `window` object.
|
||||||
///
|
///
|
||||||
|
@ -273,8 +311,10 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web ([Official API - Window.onfocus](https://developer.mozilla.org/en-US/docs/Web/API/Window/focus_event))
|
///- Web ([Official API - Window.onfocus](https://developer.mozilla.org/en-US/docs/Web/API/Window/focus_event))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)? onWindowFocus;
|
final void Function(InAppWebViewController controller)? onWindowFocus;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onWindowBlur}
|
||||||
///Event fired when the JavaScript `window` object of the WebView has lost focus.
|
///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.
|
///This is the result of the `blur` JavaScript event applied to the `window` object.
|
||||||
///
|
///
|
||||||
|
@ -285,8 +325,10 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web ([Official API - Window.onblur](https://developer.mozilla.org/en-US/docs/Web/API/Window/blur_event))
|
///- Web ([Official API - Window.onblur](https://developer.mozilla.org/en-US/docs/Web/API/Window/blur_event))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)? onWindowBlur;
|
final void Function(InAppWebViewController controller)? onWindowBlur;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onJsAlert}
|
||||||
///Event fired when javascript calls the `alert()` method to display an alert dialog.
|
///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.
|
///If [JsAlertResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
|
||||||
///
|
///
|
||||||
|
@ -296,10 +338,12 @@ abstract class WebView {
|
||||||
///- 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)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1537406-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<JsAlertResponse?> Function(
|
final Future<JsAlertResponse?> Function(
|
||||||
InAppWebViewController controller, JsAlertRequest jsAlertRequest)?
|
InAppWebViewController controller, JsAlertRequest jsAlertRequest)?
|
||||||
onJsAlert;
|
onJsAlert;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onJsConfirm}
|
||||||
///Event fired when javascript calls the `confirm()` method to display a confirm dialog.
|
///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.
|
///If [JsConfirmResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
|
||||||
///
|
///
|
||||||
|
@ -309,10 +353,12 @@ abstract class WebView {
|
||||||
///- 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)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<JsConfirmResponse?> Function(
|
final Future<JsConfirmResponse?> Function(
|
||||||
InAppWebViewController controller, JsConfirmRequest jsConfirmRequest)?
|
InAppWebViewController controller, JsConfirmRequest jsConfirmRequest)?
|
||||||
onJsConfirm;
|
onJsConfirm;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onJsPrompt}
|
||||||
///Event fired when javascript calls the `prompt()` method to display a prompt dialog.
|
///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.
|
///If [JsPromptResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
|
||||||
///
|
///
|
||||||
|
@ -322,10 +368,12 @@ abstract class WebView {
|
||||||
///- 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)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKUIDelegate.webView](https://developer.apple.com/documentation/webkit/wkuidelegate/1538086-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<JsPromptResponse?> Function(
|
final Future<JsPromptResponse?> Function(
|
||||||
InAppWebViewController controller, JsPromptRequest jsPromptRequest)?
|
InAppWebViewController controller, JsPromptRequest jsPromptRequest)?
|
||||||
onJsPrompt;
|
onJsPrompt;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onReceivedHttpAuthRequest}
|
||||||
///Event fired when the WebView received an HTTP authentication request. The default behavior is to cancel the request.
|
///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].
|
///[challenge] contains data about host, port, protocol, realm, etc. as specified in the [URLAuthenticationChallenge].
|
||||||
|
@ -334,9 +382,11 @@ abstract class WebView {
|
||||||
///- 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)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<HttpAuthResponse?> Function(InAppWebViewController controller,
|
final Future<HttpAuthResponse?> Function(InAppWebViewController controller,
|
||||||
HttpAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
|
HttpAuthenticationChallenge challenge)? onReceivedHttpAuthRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onReceivedServerTrustAuthRequest}
|
||||||
///Event fired when the WebView need to perform server trust authentication (certificate validation).
|
///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].
|
///The host application must return either [ServerTrustAuthResponse] instance with [ServerTrustAuthResponseAction.CANCEL] or [ServerTrustAuthResponseAction.PROCEED].
|
||||||
///
|
///
|
||||||
|
@ -346,10 +396,12 @@ abstract class WebView {
|
||||||
///- 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)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<ServerTrustAuthResponse?> Function(
|
final Future<ServerTrustAuthResponse?> Function(
|
||||||
InAppWebViewController controller, ServerTrustChallenge challenge)?
|
InAppWebViewController controller, ServerTrustChallenge challenge)?
|
||||||
onReceivedServerTrustAuthRequest;
|
onReceivedServerTrustAuthRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onReceivedClientCertRequest}
|
||||||
///Notify the host application to handle an SSL client certificate request.
|
///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]
|
///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.
|
///is called and does not call [onReceivedClientCertRequest] again for the same host and port pair.
|
||||||
|
@ -361,6 +413,7 @@ abstract class WebView {
|
||||||
///- Android native WebView ([Official API - WebViewClient.onReceivedClientCertRequest](https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedClientCertRequest(android.webkit.WebView,%20android.webkit.ClientCertRequest)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<ClientCertResponse?> Function(
|
final Future<ClientCertResponse?> Function(
|
||||||
InAppWebViewController controller, ClientCertChallenge challenge)?
|
InAppWebViewController controller, ClientCertChallenge challenge)?
|
||||||
onReceivedClientCertRequest;
|
onReceivedClientCertRequest;
|
||||||
|
@ -370,6 +423,7 @@ abstract class WebView {
|
||||||
final void Function(InAppWebViewController controller, int activeMatchOrdinal,
|
final void Function(InAppWebViewController controller, int activeMatchOrdinal,
|
||||||
int numberOfMatches, bool isDoneCounting)? onFindResultReceived;
|
int numberOfMatches, bool isDoneCounting)? onFindResultReceived;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.shouldInterceptAjaxRequest}
|
||||||
///Event fired when an `XMLHttpRequest` is sent to a server.
|
///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.
|
///It gives the host application a chance to take control over the request before sending it.
|
||||||
///
|
///
|
||||||
|
@ -385,10 +439,12 @@ abstract class WebView {
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final Future<AjaxRequest?> Function(
|
final Future<AjaxRequest?> Function(
|
||||||
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
||||||
shouldInterceptAjaxRequest;
|
shouldInterceptAjaxRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onAjaxReadyStateChange}
|
||||||
///Event fired whenever the `readyState` attribute of an `XMLHttpRequest` changes.
|
///Event fired whenever the `readyState` attribute of an `XMLHttpRequest` changes.
|
||||||
///It gives the host application a chance to abort the request.
|
///It gives the host application a chance to abort the request.
|
||||||
///
|
///
|
||||||
|
@ -404,10 +460,12 @@ abstract class WebView {
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final Future<AjaxRequestAction?> Function(
|
final Future<AjaxRequestAction?> Function(
|
||||||
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
||||||
onAjaxReadyStateChange;
|
onAjaxReadyStateChange;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onAjaxProgress}
|
||||||
///Event fired as an `XMLHttpRequest` progress.
|
///Event fired as an `XMLHttpRequest` progress.
|
||||||
///It gives the host application a chance to abort the request.
|
///It gives the host application a chance to abort the request.
|
||||||
///
|
///
|
||||||
|
@ -423,10 +481,12 @@ abstract class WebView {
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final Future<AjaxRequestAction?> Function(
|
final Future<AjaxRequestAction?> Function(
|
||||||
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
InAppWebViewController controller, AjaxRequest ajaxRequest)?
|
||||||
onAjaxProgress;
|
onAjaxProgress;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.shouldInterceptFetchRequest}
|
||||||
///Event fired when a request is sent to a server through [Fetch API](https://developer.mozilla.org/it/docs/Web/API/Fetch_API).
|
///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.
|
///It gives the host application a chance to take control over the request before sending it.
|
||||||
///
|
///
|
||||||
|
@ -442,10 +502,12 @@ abstract class WebView {
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final Future<FetchRequest?> Function(
|
final Future<FetchRequest?> Function(
|
||||||
InAppWebViewController controller, FetchRequest fetchRequest)?
|
InAppWebViewController controller, FetchRequest fetchRequest)?
|
||||||
shouldInterceptFetchRequest;
|
shouldInterceptFetchRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onUpdateVisitedHistory}
|
||||||
///Event fired when the host application updates its visited links database.
|
///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
|
///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
|
///javascript **[History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API)** functions (`pushState()`, `replaceState()`) and `onpopstate` event
|
||||||
|
@ -462,6 +524,7 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, WebUri? url, bool? isReload)?
|
InAppWebViewController controller, WebUri? url, bool? isReload)?
|
||||||
onUpdateVisitedHistory;
|
onUpdateVisitedHistory;
|
||||||
|
@ -470,6 +533,7 @@ abstract class WebView {
|
||||||
@Deprecated("Use onPrintRequest instead")
|
@Deprecated("Use onPrintRequest instead")
|
||||||
final void Function(InAppWebViewController controller, Uri? url)? onPrint;
|
final void Function(InAppWebViewController controller, Uri? url)? onPrint;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onPrintRequest}
|
||||||
///Event fired when `window.print()` is called from JavaScript side.
|
///Event fired when `window.print()` is called from JavaScript side.
|
||||||
///Return `true` if you want to handle the print job.
|
///Return `true` if you want to handle the print job.
|
||||||
///Otherwise return `false`, so the [PrintJobController] will be handled and disposed automatically by the system.
|
///Otherwise return `false`, so the [PrintJobController] will be handled and disposed automatically by the system.
|
||||||
|
@ -486,9 +550,11 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final Future<bool?> Function(InAppWebViewController controller, WebUri? url,
|
final Future<bool?> Function(InAppWebViewController controller, WebUri? url,
|
||||||
PrintJobController? printJobController)? onPrintRequest;
|
PrintJobController? printJobController)? onPrintRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onLongPressHitTestResult}
|
||||||
///Event fired when an HTML element of the webview has been clicked and held.
|
///Event fired when an HTML element of the webview has been clicked and held.
|
||||||
///
|
///
|
||||||
///[hitTestResult] represents the hit result for hitting an HTML elements.
|
///[hitTestResult] represents the hit result for hitting an HTML elements.
|
||||||
|
@ -496,9 +562,11 @@ abstract class WebView {
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView ([Official API - View.setOnLongClickListener](https://developer.android.com/reference/android/view/View#setOnLongClickListener(android.view.View.OnLongClickListener)))
|
///- 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))
|
///- iOS ([Official API - UILongPressGestureRecognizer](https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller,
|
final void Function(InAppWebViewController controller,
|
||||||
InAppWebViewHitTestResult hitTestResult)? onLongPressHitTestResult;
|
InAppWebViewHitTestResult hitTestResult)? onLongPressHitTestResult;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onEnterFullscreen}
|
||||||
///Event fired when the current page has entered full screen mode.
|
///Event fired when the current page has entered full screen mode.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -506,8 +574,10 @@ abstract class WebView {
|
||||||
///- iOS ([Official API - UIWindow.didBecomeVisibleNotification](https://developer.apple.com/documentation/uikit/uiwindow/1621621-didbecomevisiblenotification))
|
///- 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))
|
///- MacOS ([Official API - NSWindow.didEnterFullScreenNotification](https://developer.apple.com/documentation/appkit/nswindow/1419651-didenterfullscreennotification))
|
||||||
///- Web ([Official API - Document.onfullscreenchange](https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event))
|
///- Web ([Official API - Document.onfullscreenchange](https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)? onEnterFullscreen;
|
final void Function(InAppWebViewController controller)? onEnterFullscreen;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onExitFullscreen}
|
||||||
///Event fired when the current page has exited full screen mode.
|
///Event fired when the current page has exited full screen mode.
|
||||||
///
|
///
|
||||||
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebChromeClient#onHideCustomView()
|
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebChromeClient#onHideCustomView()
|
||||||
|
@ -519,8 +589,10 @@ abstract class WebView {
|
||||||
///- iOS ([Official API - UIWindow.didBecomeHiddenNotification](https://developer.apple.com/documentation/uikit/uiwindow/1621617-didbecomehiddennotification))
|
///- 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))
|
///- MacOS ([Official API - NSWindow.didExitFullScreenNotification](https://developer.apple.com/documentation/appkit/nswindow/1419177-didexitfullscreennotification))
|
||||||
///- Web ([Official API - Document.onfullscreenchange](https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event))
|
///- Web ([Official API - Document.onfullscreenchange](https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)? onExitFullscreen;
|
final void Function(InAppWebViewController controller)? onExitFullscreen;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onPageCommitVisible}
|
||||||
///Called when the web view begins to receive web content.
|
///Called when the web view begins to receive web content.
|
||||||
///
|
///
|
||||||
///This event occurs early in the document loading process, and as such
|
///This event occurs early in the document loading process, and as such
|
||||||
|
@ -532,9 +604,11 @@ abstract class WebView {
|
||||||
///- Android native WebView ([Official API - WebViewClient.onPageCommitVisible](https://developer.android.com/reference/android/webkit/WebViewClient#onPageCommitVisible(android.webkit.WebView,%20java.lang.String)))
|
///- 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))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455635-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller, WebUri? url)?
|
final void Function(InAppWebViewController controller, WebUri? url)?
|
||||||
onPageCommitVisible;
|
onPageCommitVisible;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onTitleChanged}
|
||||||
///Event fired when a change in the document title occurred.
|
///Event fired when a change in the document title occurred.
|
||||||
///
|
///
|
||||||
///[title] represents the string containing the new title of the document.
|
///[title] represents the string containing the new title of the document.
|
||||||
|
@ -546,9 +620,11 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller, String? title)?
|
final void Function(InAppWebViewController controller, String? title)?
|
||||||
onTitleChanged;
|
onTitleChanged;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onOverScrolled}
|
||||||
///Event fired to respond to the results of an over-scroll operation.
|
///Event fired to respond to the results of an over-scroll operation.
|
||||||
///
|
///
|
||||||
///[x] represents the new X scroll value in pixels.
|
///[x] represents the new X scroll value in pixels.
|
||||||
|
@ -562,9 +638,11 @@ abstract class WebView {
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView ([Official API - WebView.onOverScrolled](https://developer.android.com/reference/android/webkit/WebView#onOverScrolled(int,%20int,%20boolean,%20boolean)))
|
///- Android native WebView ([Official API - WebView.onOverScrolled](https://developer.android.com/reference/android/webkit/WebView#onOverScrolled(int,%20int,%20boolean,%20boolean)))
|
||||||
///- iOS
|
///- iOS
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller, int x, int y,
|
final void Function(InAppWebViewController controller, int x, int y,
|
||||||
bool clampedX, bool clampedY)? onOverScrolled;
|
bool clampedX, bool clampedY)? onOverScrolled;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onZoomScaleChanged}
|
||||||
///Event fired when the zoom scale of the WebView has changed.
|
///Event fired when the zoom scale of the WebView has changed.
|
||||||
///
|
///
|
||||||
///[oldScale] The old zoom scale factor.
|
///[oldScale] The old zoom scale factor.
|
||||||
|
@ -577,6 +655,7 @@ abstract class WebView {
|
||||||
///- Android native WebView ([Official API - WebViewClient.onScaleChanged](https://developer.android.com/reference/android/webkit/WebViewClient#onScaleChanged(android.webkit.WebView,%20float,%20float)))
|
///- 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))
|
///- iOS ([Official API - UIScrollViewDelegate.scrollViewDidZoom](https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom))
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(
|
final void Function(
|
||||||
InAppWebViewController controller, double oldScale, double newScale)?
|
InAppWebViewController controller, double oldScale, double newScale)?
|
||||||
onZoomScaleChanged;
|
onZoomScaleChanged;
|
||||||
|
@ -588,6 +667,7 @@ abstract class WebView {
|
||||||
Uri url,
|
Uri url,
|
||||||
SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
SafeBrowsingThreat? threatType)? androidOnSafeBrowsingHit;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onSafeBrowsingHit}
|
||||||
///Event fired when the webview notifies that a loading URL has been flagged by Safe Browsing.
|
///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.
|
///The default behavior is to show an interstitial to the user, with the reporting checkbox visible.
|
||||||
///
|
///
|
||||||
|
@ -599,6 +679,7 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(
|
final Future<SafeBrowsingResponse?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
WebUri url,
|
WebUri url,
|
||||||
|
@ -611,6 +692,7 @@ abstract class WebView {
|
||||||
String origin,
|
String origin,
|
||||||
List<String> resources)? androidOnPermissionRequest;
|
List<String> resources)? androidOnPermissionRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onPermissionRequest}
|
||||||
///Event fired when the WebView is requesting permission to access the specified resources and the permission currently isn't granted or denied.
|
///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
|
///[permissionRequest] represents the permission request with an array of resources the web content wants to access
|
||||||
|
@ -626,6 +708,7 @@ abstract class WebView {
|
||||||
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequest](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequest(android.webkit.PermissionRequest)))
|
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequest](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequest(android.webkit.PermissionRequest)))
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final Future<PermissionResponse?> Function(InAppWebViewController controller,
|
final Future<PermissionResponse?> Function(InAppWebViewController controller,
|
||||||
PermissionRequest permissionRequest)? onPermissionRequest;
|
PermissionRequest permissionRequest)? onPermissionRequest;
|
||||||
|
|
||||||
|
@ -635,6 +718,7 @@ abstract class WebView {
|
||||||
InAppWebViewController controller, String origin)?
|
InAppWebViewController controller, String origin)?
|
||||||
androidOnGeolocationPermissionsShowPrompt;
|
androidOnGeolocationPermissionsShowPrompt;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.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.
|
///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.
|
///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.
|
///On non-secure origins geolocation requests are automatically denied.
|
||||||
|
@ -643,6 +727,7 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(
|
final Future<GeolocationPermissionShowPromptResponse?> Function(
|
||||||
InAppWebViewController controller, String origin)?
|
InAppWebViewController controller, String origin)?
|
||||||
onGeolocationPermissionsShowPrompt;
|
onGeolocationPermissionsShowPrompt;
|
||||||
|
@ -652,11 +737,13 @@ abstract class WebView {
|
||||||
final void Function(InAppWebViewController controller)?
|
final void Function(InAppWebViewController controller)?
|
||||||
androidOnGeolocationPermissionsHidePrompt;
|
androidOnGeolocationPermissionsHidePrompt;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onGeolocationPermissionsHidePrompt}
|
||||||
///Notify the host application that a request for Geolocation permissions, made with a previous call to [onGeolocationPermissionsShowPrompt] has been canceled.
|
///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.
|
///Any related UI should therefore be hidden.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsHidePrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsHidePrompt()))
|
///- Android native WebView ([Official API - WebChromeClient.onGeolocationPermissionsHidePrompt](https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsHidePrompt()))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)?
|
final void Function(InAppWebViewController controller)?
|
||||||
onGeolocationPermissionsHidePrompt;
|
onGeolocationPermissionsHidePrompt;
|
||||||
|
|
||||||
|
@ -666,6 +753,7 @@ abstract class WebView {
|
||||||
InAppWebViewController controller, WebResourceRequest request)?
|
InAppWebViewController controller, WebResourceRequest request)?
|
||||||
androidShouldInterceptRequest;
|
androidShouldInterceptRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.shouldInterceptRequest}
|
||||||
///Notify the host application of a resource request and allow the application to return the data.
|
///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.
|
///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.
|
///Otherwise, the return response and data will be used.
|
||||||
|
@ -682,6 +770,7 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(
|
final Future<WebResourceResponse?> Function(
|
||||||
InAppWebViewController controller, WebResourceRequest request)?
|
InAppWebViewController controller, WebResourceRequest request)?
|
||||||
shouldInterceptRequest;
|
shouldInterceptRequest;
|
||||||
|
@ -692,6 +781,7 @@ abstract class WebView {
|
||||||
InAppWebViewController controller, Uri? url)?
|
InAppWebViewController controller, Uri? url)?
|
||||||
androidOnRenderProcessUnresponsive;
|
androidOnRenderProcessUnresponsive;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.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.
|
///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.
|
///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.
|
||||||
|
@ -711,6 +801,7 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(
|
final Future<WebViewRenderProcessAction?> Function(
|
||||||
InAppWebViewController controller, WebUri? url)?
|
InAppWebViewController controller, WebUri? url)?
|
||||||
onRenderProcessUnresponsive;
|
onRenderProcessUnresponsive;
|
||||||
|
@ -721,6 +812,7 @@ abstract class WebView {
|
||||||
InAppWebViewController controller, Uri? url)?
|
InAppWebViewController controller, Uri? url)?
|
||||||
androidOnRenderProcessResponsive;
|
androidOnRenderProcessResponsive;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onRenderProcessResponsive}
|
||||||
///Event called once when an unresponsive renderer currently associated with the WebView becomes responsive.
|
///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],
|
///After a WebView renderer becomes unresponsive, which is notified to the application by [onRenderProcessUnresponsive],
|
||||||
|
@ -733,6 +825,7 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(
|
final Future<WebViewRenderProcessAction?> Function(
|
||||||
InAppWebViewController controller, WebUri? url)?
|
InAppWebViewController controller, WebUri? url)?
|
||||||
onRenderProcessResponsive;
|
onRenderProcessResponsive;
|
||||||
|
@ -743,6 +836,7 @@ abstract class WebView {
|
||||||
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
||||||
androidOnRenderProcessGone;
|
androidOnRenderProcessGone;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onRenderProcessGone}
|
||||||
///Event fired when the given WebView's render process has exited.
|
///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 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.
|
///The WebView should be removed from the view hierarchy, all references to it should be cleaned up.
|
||||||
|
@ -753,6 +847,7 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(
|
final void Function(
|
||||||
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
||||||
onRenderProcessGone;
|
onRenderProcessGone;
|
||||||
|
@ -762,10 +857,12 @@ abstract class WebView {
|
||||||
final Future<FormResubmissionAction?> Function(
|
final Future<FormResubmissionAction?> Function(
|
||||||
InAppWebViewController controller, Uri? url)? androidOnFormResubmission;
|
InAppWebViewController controller, Uri? url)? androidOnFormResubmission;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.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.
|
///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**:
|
///**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)))
|
///- 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(
|
final Future<FormResubmissionAction?> Function(
|
||||||
InAppWebViewController controller, WebUri? url)? onFormResubmission;
|
InAppWebViewController controller, WebUri? url)? onFormResubmission;
|
||||||
|
|
||||||
|
@ -780,12 +877,14 @@ abstract class WebView {
|
||||||
final void Function(InAppWebViewController controller, Uint8List icon)?
|
final void Function(InAppWebViewController controller, Uint8List icon)?
|
||||||
androidOnReceivedIcon;
|
androidOnReceivedIcon;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onReceivedIcon}
|
||||||
///Event fired when there is new favicon for the current page.
|
///Event fired when there is new favicon for the current page.
|
||||||
///
|
///
|
||||||
///[icon] represents the favicon for the current page.
|
///[icon] represents the favicon for the current page.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(InAppWebViewController controller, Uint8List icon)?
|
final void Function(InAppWebViewController controller, Uint8List icon)?
|
||||||
onReceivedIcon;
|
onReceivedIcon;
|
||||||
|
|
||||||
|
@ -795,6 +894,7 @@ abstract class WebView {
|
||||||
InAppWebViewController controller, Uri url, bool precomposed)?
|
InAppWebViewController controller, Uri url, bool precomposed)?
|
||||||
androidOnReceivedTouchIconUrl;
|
androidOnReceivedTouchIconUrl;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onReceivedTouchIconUrl}
|
||||||
///Event fired when there is an url for an apple-touch-icon.
|
///Event fired when there is an url for an apple-touch-icon.
|
||||||
///
|
///
|
||||||
///[url] represents the icon url.
|
///[url] represents the icon url.
|
||||||
|
@ -803,6 +903,7 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(
|
final void Function(
|
||||||
InAppWebViewController controller, WebUri url, bool precomposed)?
|
InAppWebViewController controller, WebUri url, bool precomposed)?
|
||||||
onReceivedTouchIconUrl;
|
onReceivedTouchIconUrl;
|
||||||
|
@ -813,6 +914,7 @@ abstract class WebView {
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
JsBeforeUnloadRequest jsBeforeUnloadRequest)? androidOnJsBeforeUnload;
|
JsBeforeUnloadRequest jsBeforeUnloadRequest)? androidOnJsBeforeUnload;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onJsBeforeUnload}
|
||||||
///Event fired when the client should display a dialog to confirm navigation away from the current page.
|
///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.
|
///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.
|
///If [JsBeforeUnloadResponse.handledByClient] is `true`, WebView will assume that the client will handle the confirm dialog.
|
||||||
|
@ -825,6 +927,7 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(
|
final Future<JsBeforeUnloadResponse?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
||||||
|
@ -835,16 +938,19 @@ abstract class WebView {
|
||||||
InAppWebViewController controller, LoginRequest loginRequest)?
|
InAppWebViewController controller, LoginRequest loginRequest)?
|
||||||
androidOnReceivedLoginRequest;
|
androidOnReceivedLoginRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onReceivedLoginRequest}
|
||||||
///Event fired when a request to automatically log in the user has been processed.
|
///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.
|
///[loginRequest] contains the realm, account and args of the login request.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**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)))
|
///- 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(
|
final void Function(
|
||||||
InAppWebViewController controller, LoginRequest loginRequest)?
|
InAppWebViewController controller, LoginRequest loginRequest)?
|
||||||
onReceivedLoginRequest;
|
onReceivedLoginRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onPermissionRequestCanceled}
|
||||||
///Notify the host application that the given permission request has been canceled. Any related UI should therefore be hidden.
|
///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
|
///[permissionRequest] represents the permission request that needs be canceled
|
||||||
|
@ -855,14 +961,17 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequestCanceled](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequestCanceled(android.webkit.PermissionRequest)))
|
///- Android native WebView ([Official API - WebChromeClient.onPermissionRequestCanceled](https://developer.android.com/reference/android/webkit/WebChromeClient#onPermissionRequestCanceled(android.webkit.PermissionRequest)))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller,
|
final void Function(InAppWebViewController controller,
|
||||||
PermissionRequest permissionRequest)? onPermissionRequestCanceled;
|
PermissionRequest permissionRequest)? onPermissionRequestCanceled;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onRequestFocus}
|
||||||
///Request display and focus for this WebView.
|
///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.
|
///This may happen due to another WebView opening a link in this WebView and requesting that this WebView be displayed.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView ([Official API - WebChromeClient.onRequestFocus](https://developer.android.com/reference/android/webkit/WebChromeClient#onRequestFocus(android.webkit.WebView)))
|
///- Android native WebView ([Official API - WebChromeClient.onRequestFocus](https://developer.android.com/reference/android/webkit/WebChromeClient#onRequestFocus(android.webkit.WebView)))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)? onRequestFocus;
|
final void Function(InAppWebViewController controller)? onRequestFocus;
|
||||||
|
|
||||||
///Use [onWebContentProcessDidTerminate] instead.
|
///Use [onWebContentProcessDidTerminate] instead.
|
||||||
|
@ -870,11 +979,13 @@ abstract class WebView {
|
||||||
final void Function(InAppWebViewController controller)?
|
final void Function(InAppWebViewController controller)?
|
||||||
iosOnWebContentProcessDidTerminate;
|
iosOnWebContentProcessDidTerminate;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onWebContentProcessDidTerminate}
|
||||||
///Invoked when the web view's web content process is terminated.
|
///Invoked when the web view's web content process is terminated.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webViewWebContentProcessDidTerminate](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)?
|
final void Function(InAppWebViewController controller)?
|
||||||
onWebContentProcessDidTerminate;
|
onWebContentProcessDidTerminate;
|
||||||
|
|
||||||
|
@ -883,11 +994,13 @@ abstract class WebView {
|
||||||
final void Function(InAppWebViewController controller)?
|
final void Function(InAppWebViewController controller)?
|
||||||
iosOnDidReceiveServerRedirectForProvisionalNavigation;
|
iosOnDidReceiveServerRedirectForProvisionalNavigation;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onDidReceiveServerRedirectForProvisionalNavigation}
|
||||||
///Called when a web view receives a server redirect.
|
///Called when a web view receives a server redirect.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455627-webview))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455627-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller)?
|
final void Function(InAppWebViewController controller)?
|
||||||
onDidReceiveServerRedirectForProvisionalNavigation;
|
onDidReceiveServerRedirectForProvisionalNavigation;
|
||||||
|
|
||||||
|
@ -897,6 +1010,7 @@ abstract class WebView {
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
IOSWKNavigationResponse navigationResponse)? iosOnNavigationResponse;
|
IOSWKNavigationResponse navigationResponse)? iosOnNavigationResponse;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onNavigationResponse}
|
||||||
///Called when a web view asks for permission to navigate to new content after the response to the navigation request is known.
|
///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.
|
///[navigationResponse] represents the navigation response.
|
||||||
|
@ -906,6 +1020,7 @@ abstract class WebView {
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<NavigationResponseAction?> Function(
|
final Future<NavigationResponseAction?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
NavigationResponse navigationResponse)? onNavigationResponse;
|
NavigationResponse navigationResponse)? onNavigationResponse;
|
||||||
|
@ -916,6 +1031,7 @@ abstract class WebView {
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
|
URLAuthenticationChallenge challenge)? iosShouldAllowDeprecatedTLS;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.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).
|
///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.
|
///[challenge] represents the authentication challenge.
|
||||||
|
@ -927,10 +1043,12 @@ abstract class WebView {
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview))
|
///- 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))
|
///- MacOS ([Official API - WKNavigationDelegate.webView](https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview))
|
||||||
|
///{@endtemplate}
|
||||||
final Future<ShouldAllowDeprecatedTLSAction?> Function(
|
final Future<ShouldAllowDeprecatedTLSAction?> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onCameraCaptureStateChanged}
|
||||||
///Event fired when a change in the camera capture state occurred.
|
///Event fired when a change in the camera capture state occurred.
|
||||||
///
|
///
|
||||||
///**NOTE for iOS**: available only on iOS 15.0+.
|
///**NOTE for iOS**: available only on iOS 15.0+.
|
||||||
|
@ -940,12 +1058,14 @@ abstract class WebView {
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final Future<void> Function(
|
final Future<void> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
MediaCaptureState? oldState,
|
MediaCaptureState? oldState,
|
||||||
MediaCaptureState? newState,
|
MediaCaptureState? newState,
|
||||||
)? onCameraCaptureStateChanged;
|
)? onCameraCaptureStateChanged;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onMicrophoneCaptureStateChanged}
|
||||||
///Event fired when a change in the microphone capture state occurred.
|
///Event fired when a change in the microphone capture state occurred.
|
||||||
///
|
///
|
||||||
///**NOTE for iOS**: available only on iOS 15.0+.
|
///**NOTE for iOS**: available only on iOS 15.0+.
|
||||||
|
@ -955,12 +1075,14 @@ abstract class WebView {
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final Future<void> Function(
|
final Future<void> Function(
|
||||||
InAppWebViewController controller,
|
InAppWebViewController controller,
|
||||||
MediaCaptureState? oldState,
|
MediaCaptureState? oldState,
|
||||||
MediaCaptureState? newState,
|
MediaCaptureState? newState,
|
||||||
)? onMicrophoneCaptureStateChanged;
|
)? onMicrophoneCaptureStateChanged;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.onContentSizeChanged}
|
||||||
///Event fired when the content size of the [WebView] changes.
|
///Event fired when the content size of the [WebView] changes.
|
||||||
///
|
///
|
||||||
///[oldContentSize] represents the old content size value.
|
///[oldContentSize] represents the old content size value.
|
||||||
|
@ -969,9 +1091,11 @@ abstract class WebView {
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
///- iOS
|
||||||
|
///{@endtemplate}
|
||||||
final void Function(InAppWebViewController controller, Size oldContentSize,
|
final void Function(InAppWebViewController controller, Size oldContentSize,
|
||||||
Size newContentSize)? onContentSizeChanged;
|
Size newContentSize)? onContentSizeChanged;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.initialUrlRequest}
|
||||||
///Initial url request that will be loaded.
|
///Initial url request that will be loaded.
|
||||||
///
|
///
|
||||||
///**NOTE for Android**: when loading an URL Request using "POST" method, headers are ignored.
|
///**NOTE for Android**: when loading an URL Request using "POST" method, headers are ignored.
|
||||||
|
@ -981,8 +1105,10 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final URLRequest? initialUrlRequest;
|
final URLRequest? initialUrlRequest;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.initialFile}
|
||||||
///Initial asset file that will be loaded. See [InAppWebViewController.loadFile] for explanation.
|
///Initial asset file that will be loaded. See [InAppWebViewController.loadFile] for explanation.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -990,8 +1116,10 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final String? initialFile;
|
final String? initialFile;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.initialData}
|
||||||
///Initial [InAppWebViewInitialData] that will be loaded.
|
///Initial [InAppWebViewInitialData] that will be loaded.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -999,12 +1127,14 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final InAppWebViewInitialData? initialData;
|
final InAppWebViewInitialData? initialData;
|
||||||
|
|
||||||
///Use [initialSettings] instead.
|
///Use [initialSettings] instead.
|
||||||
@Deprecated('Use initialSettings instead')
|
@Deprecated('Use initialSettings instead')
|
||||||
final InAppWebViewGroupOptions? initialOptions;
|
final InAppWebViewGroupOptions? initialOptions;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.initialSettings}
|
||||||
///Initial settings that will be used.
|
///Initial settings that will be used.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -1012,15 +1142,19 @@ abstract class WebView {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
///- Web
|
///- Web
|
||||||
|
///{@endtemplate}
|
||||||
final InAppWebViewSettings? initialSettings;
|
final InAppWebViewSettings? initialSettings;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.contextMenu}
|
||||||
///Context menu which contains custom menu items to be shown when [ContextMenu] is presented.
|
///Context menu which contains custom menu items to be shown when [ContextMenu] is presented.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
|
///{@endtemplate}
|
||||||
final ContextMenu? contextMenu;
|
final ContextMenu? contextMenu;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.initialUserScripts}
|
||||||
///Initial list of user scripts to be loaded at start or end of a page loading.
|
///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],
|
///To add or remove user scripts, you have to use the [InAppWebViewController]'s methods such as [InAppWebViewController.addUserScript],
|
||||||
///[InAppWebViewController.removeUserScript], [InAppWebViewController.removeAllUserScripts], etc.
|
///[InAppWebViewController.removeUserScript], [InAppWebViewController.removeAllUserScripts], etc.
|
||||||
|
@ -1033,8 +1167,10 @@ abstract class WebView {
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final UnmodifiableListView<UserScript>? initialUserScripts;
|
final UnmodifiableListView<UserScript>? initialUserScripts;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.pullToRefreshController}
|
||||||
///Represents the pull-to-refresh feature controller.
|
///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`.
|
///**NOTE for Android**: to be able to use the "pull-to-refresh" feature, [InAppWebViewSettings.useHybridComposition] must be `true`.
|
||||||
|
@ -1042,20 +1178,26 @@ abstract class WebView {
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
|
///{@endtemplate}
|
||||||
final PullToRefreshController? pullToRefreshController;
|
final PullToRefreshController? pullToRefreshController;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.findInteractionController}
|
||||||
///Represents the find interaction feature controller.
|
///Represents the find interaction feature controller.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
|
///{@endtemplate}
|
||||||
final FindInteractionController? findInteractionController;
|
final FindInteractionController? findInteractionController;
|
||||||
|
|
||||||
|
///{@template flutter_inappwebview.WebView.implementation}
|
||||||
///Represents the WebView native implementation to be used.
|
///Represents the WebView native implementation to be used.
|
||||||
///The default value is [WebViewImplementation.NATIVE].
|
///The default value is [WebViewImplementation.NATIVE].
|
||||||
|
///{@endtemplate}
|
||||||
final WebViewImplementation implementation;
|
final WebViewImplementation implementation;
|
||||||
|
|
||||||
|
///{@macro flutter_inappwebview.WebView}
|
||||||
WebView(
|
WebView(
|
||||||
{this.windowId,
|
{this.windowId,
|
||||||
this.onWebViewCreated,
|
this.onWebViewCreated,
|
||||||
|
|
|
@ -8,6 +8,78 @@ part of 'print_job_settings.dart';
|
||||||
|
|
||||||
///Class that represents the settings of a [PrintJobController].
|
///Class that represents the settings of a [PrintJobController].
|
||||||
class PrintJobSettings {
|
class PrintJobSettings {
|
||||||
|
///`true` to animate the display of the sheet, `false` to display the sheet immediately.
|
||||||
|
///
|
||||||
|
///**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**:
|
||||||
|
///- MacOS
|
||||||
|
bool? canSpawnSeparateThread;
|
||||||
|
|
||||||
|
///The color mode.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
|
///- MacOS
|
||||||
|
PrintJobColorMode? colorMode;
|
||||||
|
|
||||||
|
///How many copies to print.
|
||||||
|
///The default value is `1`.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
int? copies;
|
||||||
|
|
||||||
|
///If `true`, produce detailed reports when an error occurs.
|
||||||
|
///The default value is `false`.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
bool? detailedErrorReporting;
|
||||||
|
|
||||||
|
///The duplex mode to use for the print job.
|
||||||
|
///
|
||||||
|
///**NOTE for Android native WebView**: available only on Android 23+.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
|
///- iOS
|
||||||
|
PrintJobDuplexMode? duplexMode;
|
||||||
|
|
||||||
|
///A fax number.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
String? faxNumber;
|
||||||
|
|
||||||
|
///An integer value that specifies the first page in the print job.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
int? firstPage;
|
||||||
|
|
||||||
|
///The height of the page footer.
|
||||||
|
///
|
||||||
|
///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**:
|
||||||
|
///- iOS
|
||||||
|
double? footerHeight;
|
||||||
|
|
||||||
|
///Force rendering quality.
|
||||||
|
///
|
||||||
|
///**NOTE for iOS**: available only on iOS 14.5+.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
PrintJobRenderingQuality? forceRenderingQuality;
|
||||||
|
|
||||||
///Set this to `true` to handle the [PrintJobController].
|
///Set this to `true` to handle the [PrintJobController].
|
||||||
///Otherwise, it will be handled and disposed automatically by the system.
|
///Otherwise, it will be handled and disposed automatically by the system.
|
||||||
///The default value is `false`.
|
///The default value is `false`.
|
||||||
|
@ -18,6 +90,48 @@ class PrintJobSettings {
|
||||||
///- MacOS
|
///- MacOS
|
||||||
bool? handledByClient;
|
bool? handledByClient;
|
||||||
|
|
||||||
|
///If `true`, a standard header and footer are added outside the margins of each page.
|
||||||
|
///The default value is `true`.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
bool? headerAndFooter;
|
||||||
|
|
||||||
|
///The height of the page header.
|
||||||
|
///
|
||||||
|
///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**:
|
||||||
|
///- iOS
|
||||||
|
double? headerHeight;
|
||||||
|
|
||||||
|
///The horizontal pagination mode.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
PrintJobPaginationMode? horizontalPagination;
|
||||||
|
|
||||||
|
///Indicates whether the image is centered horizontally.
|
||||||
|
///The default value is `true`.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
bool? isHorizontallyCentered;
|
||||||
|
|
||||||
|
///Indicates whether the image is centered vertically.
|
||||||
|
///The default value is `true`.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
bool? isVerticallyCentered;
|
||||||
|
|
||||||
|
///The action specified for the job.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
PrintJobDisposition? jobDisposition;
|
||||||
|
|
||||||
///The name of the print job.
|
///The name of the print job.
|
||||||
///An application should set this property to a name appropriate to the content being printed.
|
///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.
|
///The default job name is the current webpage title concatenated with the "Document" word at the end.
|
||||||
|
@ -28,34 +142,17 @@ class PrintJobSettings {
|
||||||
///- MacOS
|
///- MacOS
|
||||||
String? jobName;
|
String? jobName;
|
||||||
|
|
||||||
///`true` to animate the display of the sheet, `false` to display the sheet immediately.
|
///An URL containing the location to which the job file will be saved when the [jobDisposition] is [PrintJobDisposition.SAVE].
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
|
||||||
bool? animated;
|
|
||||||
|
|
||||||
///The orientation of the printed content, portrait or landscape.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
///- MacOS
|
||||||
PrintJobOrientation? orientation;
|
WebUri? jobSavingURL;
|
||||||
|
|
||||||
///The number of pages to render.
|
///An integer value that specifies the last page in the print job.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
///- MacOS
|
||||||
int? numberOfPages;
|
int? lastPage;
|
||||||
|
|
||||||
///Force rendering quality.
|
|
||||||
///
|
|
||||||
///**NOTE for iOS**: available only on iOS 14.5+.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS
|
|
||||||
PrintJobRenderingQuality? forceRenderingQuality;
|
|
||||||
|
|
||||||
///The margins for each printed page.
|
///The margins for each printed page.
|
||||||
///Margins define the white space around the content where the left margin defines
|
///Margins define the white space around the content where the left margin defines
|
||||||
|
@ -66,149 +163,6 @@ class PrintJobSettings {
|
||||||
///- MacOS
|
///- MacOS
|
||||||
EdgeInsets? margins;
|
EdgeInsets? margins;
|
||||||
|
|
||||||
///The media size.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
PrintJobMediaSize? mediaSize;
|
|
||||||
|
|
||||||
///The color mode.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
///- MacOS
|
|
||||||
PrintJobColorMode? colorMode;
|
|
||||||
|
|
||||||
///The duplex mode to use for the print job.
|
|
||||||
///
|
|
||||||
///**NOTE for Android native WebView**: available only on Android 23+.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
///- iOS
|
|
||||||
PrintJobDuplexMode? duplexMode;
|
|
||||||
|
|
||||||
///The kind of printable content.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS
|
|
||||||
PrintJobOutputType? outputType;
|
|
||||||
|
|
||||||
///The supported resolution in DPI (dots per inch).
|
|
||||||
///
|
|
||||||
///**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**:
|
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
|
||||||
bool? showsNumberOfCopies;
|
|
||||||
|
|
||||||
///A Boolean value that determines whether the paper selection menu displays.
|
|
||||||
///The default value of this property is `false`.
|
|
||||||
///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**:
|
|
||||||
///- iOS
|
|
||||||
bool? showsPaperSelectionForLoadedPapers;
|
|
||||||
|
|
||||||
///A Boolean value that determines whether the printing options include the paper orientation control when available.
|
|
||||||
///The default value is `true`.
|
|
||||||
///
|
|
||||||
///**NOTE for iOS**: available only on iOS 15.0+.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
|
||||||
bool? showsPaperOrientation;
|
|
||||||
|
|
||||||
///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**:
|
|
||||||
///- 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**:
|
|
||||||
///- 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**:
|
|
||||||
///- 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**:
|
|
||||||
///- 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**:
|
|
||||||
///- 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**:
|
|
||||||
///- MacOS
|
|
||||||
bool? showsPrintSelection;
|
|
||||||
|
|
||||||
///A Boolean value that determines whether the print operation displays a print panel.
|
|
||||||
///The default value is `true`.
|
|
||||||
///
|
|
||||||
///This property does not affect the display of a progress panel;
|
|
||||||
///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**:
|
|
||||||
///- MacOS
|
|
||||||
bool? showsPrintPanel;
|
|
||||||
|
|
||||||
///A Boolean value that determines whether the print operation displays a progress panel.
|
|
||||||
///The default value is `true`.
|
|
||||||
///
|
|
||||||
///This property does not affect the display of a print panel;
|
|
||||||
///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**:
|
|
||||||
///- MacOS
|
|
||||||
bool? showsProgressPanel;
|
|
||||||
|
|
||||||
///The height of the page footer.
|
|
||||||
///
|
|
||||||
///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**:
|
|
||||||
///- iOS
|
|
||||||
double? footerHeight;
|
|
||||||
|
|
||||||
///The height of the page header.
|
|
||||||
///
|
|
||||||
///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**:
|
|
||||||
///- iOS
|
|
||||||
double? headerHeight;
|
|
||||||
|
|
||||||
///The maximum height of the content area.
|
///The maximum height of the content area.
|
||||||
///
|
///
|
||||||
///The Print Formatter uses this value to determine where the content rectangle begins on the first page.
|
///The Print Formatter uses this value to determine where the content rectangle begins on the first page.
|
||||||
|
@ -230,107 +184,11 @@ class PrintJobSettings {
|
||||||
///- iOS
|
///- iOS
|
||||||
double? maximumContentWidth;
|
double? maximumContentWidth;
|
||||||
|
|
||||||
///The current scaling factor. From `0.0` to `1.0`.
|
///The media size.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- MacOS
|
///- Android native WebView
|
||||||
double? scalingFactor;
|
PrintJobMediaSize? mediaSize;
|
||||||
|
|
||||||
///The action specified for the job.
|
|
||||||
///
|
|
||||||
///**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**:
|
|
||||||
///- MacOS
|
|
||||||
WebUri? jobSavingURL;
|
|
||||||
|
|
||||||
///The name of the currently selected paper size.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
String? paperName;
|
|
||||||
|
|
||||||
///The horizontal pagination mode.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
PrintJobPaginationMode? horizontalPagination;
|
|
||||||
|
|
||||||
///The vertical pagination to the specified mode.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
PrintJobPaginationMode? verticalPagination;
|
|
||||||
|
|
||||||
///Indicates whether the image is centered horizontally.
|
|
||||||
///The default value is `true`.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
bool? isHorizontallyCentered;
|
|
||||||
|
|
||||||
///Indicates whether the image is centered vertically.
|
|
||||||
///The default value is `true`.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
bool? isVerticallyCentered;
|
|
||||||
|
|
||||||
///The print order for the pages of the operation.
|
|
||||||
///
|
|
||||||
///**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**:
|
|
||||||
///- MacOS
|
|
||||||
bool? canSpawnSeparateThread;
|
|
||||||
|
|
||||||
///How many copies to print.
|
|
||||||
///The default value is `1`.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
int? copies;
|
|
||||||
|
|
||||||
///An integer value that specifies the first page in the print job.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
int? firstPage;
|
|
||||||
|
|
||||||
///An integer value that specifies the last page in the print job.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
int? lastPage;
|
|
||||||
|
|
||||||
///If `true`, produce detailed reports when an error occurs.
|
|
||||||
///The default value is `false`.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
bool? detailedErrorReporting;
|
|
||||||
|
|
||||||
///A fax number.
|
|
||||||
///
|
|
||||||
///**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**:
|
|
||||||
///- MacOS
|
|
||||||
bool? headerAndFooter;
|
|
||||||
|
|
||||||
///If `true`, collates output.
|
///If `true`, collates output.
|
||||||
///
|
///
|
||||||
|
@ -338,6 +196,33 @@ class PrintJobSettings {
|
||||||
///- MacOS
|
///- MacOS
|
||||||
bool? mustCollate;
|
bool? mustCollate;
|
||||||
|
|
||||||
|
///The number of pages to render.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
int? numberOfPages;
|
||||||
|
|
||||||
|
///The orientation of the printed content, portrait or landscape.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
PrintJobOrientation? orientation;
|
||||||
|
|
||||||
|
///The kind of printable content.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
PrintJobOutputType? outputType;
|
||||||
|
|
||||||
|
///The print order for the pages of the operation.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
PrintJobPageOrder? pageOrder;
|
||||||
|
|
||||||
///The number of logical pages to be tiled horizontally on a physical sheet of paper.
|
///The number of logical pages to be tiled horizontally on a physical sheet of paper.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -350,59 +235,174 @@ class PrintJobSettings {
|
||||||
///- MacOS
|
///- MacOS
|
||||||
int? pagesDown;
|
int? pagesDown;
|
||||||
|
|
||||||
|
///The name of the currently selected paper size.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
String? paperName;
|
||||||
|
|
||||||
|
///The supported resolution in DPI (dots per inch).
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
|
PrintJobResolution? resolution;
|
||||||
|
|
||||||
|
///The current scaling factor. From `0.0` to `1.0`.
|
||||||
|
///
|
||||||
|
///**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**:
|
||||||
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
bool? showsNumberOfCopies;
|
||||||
|
|
||||||
|
///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**:
|
||||||
|
///- 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**:
|
||||||
|
///- MacOS
|
||||||
|
bool? showsPageSetupAccessory;
|
||||||
|
|
||||||
|
///A Boolean value that determines whether the printing options include the paper orientation control when available.
|
||||||
|
///The default value is `true`.
|
||||||
|
///
|
||||||
|
///**NOTE for iOS**: available only on iOS 15.0+.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
bool? showsPaperOrientation;
|
||||||
|
|
||||||
|
///A Boolean value that determines whether the paper selection menu displays.
|
||||||
|
///The default value of this property is `false`.
|
||||||
|
///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**:
|
||||||
|
///- 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**:
|
||||||
|
///- 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**:
|
||||||
|
///- MacOS
|
||||||
|
bool? showsPreview;
|
||||||
|
|
||||||
|
///A Boolean value that determines whether the print operation displays a print panel.
|
||||||
|
///The default value is `true`.
|
||||||
|
///
|
||||||
|
///This property does not affect the display of a progress panel;
|
||||||
|
///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**:
|
||||||
|
///- 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**:
|
||||||
|
///- MacOS
|
||||||
|
bool? showsPrintSelection;
|
||||||
|
|
||||||
|
///A Boolean value that determines whether the print operation displays a progress panel.
|
||||||
|
///The default value is `true`.
|
||||||
|
///
|
||||||
|
///This property does not affect the display of a print panel;
|
||||||
|
///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**:
|
||||||
|
///- 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**:
|
||||||
|
///- MacOS
|
||||||
|
bool? showsScaling;
|
||||||
|
|
||||||
///A timestamp that specifies the time at which printing should begin.
|
///A timestamp that specifies the time at which printing should begin.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- MacOS
|
///- MacOS
|
||||||
int? time;
|
int? time;
|
||||||
|
|
||||||
|
///The vertical pagination to the specified mode.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
PrintJobPaginationMode? verticalPagination;
|
||||||
PrintJobSettings(
|
PrintJobSettings(
|
||||||
{this.handledByClient = false,
|
{this.animated = true,
|
||||||
this.jobName,
|
this.canSpawnSeparateThread = true,
|
||||||
this.animated = true,
|
|
||||||
this.orientation,
|
|
||||||
this.numberOfPages,
|
|
||||||
this.forceRenderingQuality,
|
|
||||||
this.margins,
|
|
||||||
this.mediaSize,
|
|
||||||
this.colorMode,
|
this.colorMode,
|
||||||
|
this.copies = 1,
|
||||||
|
this.detailedErrorReporting = false,
|
||||||
this.duplexMode,
|
this.duplexMode,
|
||||||
this.outputType,
|
this.faxNumber,
|
||||||
this.resolution,
|
this.firstPage,
|
||||||
this.showsNumberOfCopies = true,
|
|
||||||
this.showsPaperSelectionForLoadedPapers = false,
|
|
||||||
this.showsPaperOrientation = true,
|
|
||||||
this.showsPaperSize = true,
|
|
||||||
this.showsScaling = true,
|
|
||||||
this.showsPageRange = true,
|
|
||||||
this.showsPageSetupAccessory = true,
|
|
||||||
this.showsPreview = true,
|
|
||||||
this.showsPrintSelection = true,
|
|
||||||
this.showsPrintPanel = true,
|
|
||||||
this.showsProgressPanel = true,
|
|
||||||
this.footerHeight,
|
this.footerHeight,
|
||||||
|
this.forceRenderingQuality,
|
||||||
|
this.handledByClient = false,
|
||||||
|
this.headerAndFooter = true,
|
||||||
this.headerHeight,
|
this.headerHeight,
|
||||||
this.maximumContentHeight,
|
|
||||||
this.maximumContentWidth,
|
|
||||||
this.scalingFactor,
|
|
||||||
this.jobDisposition,
|
|
||||||
this.jobSavingURL,
|
|
||||||
this.paperName,
|
|
||||||
this.horizontalPagination,
|
this.horizontalPagination,
|
||||||
this.verticalPagination,
|
|
||||||
this.isHorizontallyCentered = true,
|
this.isHorizontallyCentered = true,
|
||||||
this.isVerticallyCentered = true,
|
this.isVerticallyCentered = true,
|
||||||
this.pageOrder,
|
this.jobDisposition,
|
||||||
this.canSpawnSeparateThread = true,
|
this.jobName,
|
||||||
this.copies = 1,
|
this.jobSavingURL,
|
||||||
this.firstPage,
|
|
||||||
this.lastPage,
|
this.lastPage,
|
||||||
this.detailedErrorReporting = false,
|
this.margins,
|
||||||
this.faxNumber,
|
this.maximumContentHeight,
|
||||||
this.headerAndFooter = true,
|
this.maximumContentWidth,
|
||||||
|
this.mediaSize,
|
||||||
this.mustCollate,
|
this.mustCollate,
|
||||||
|
this.numberOfPages,
|
||||||
|
this.orientation,
|
||||||
|
this.outputType,
|
||||||
|
this.pageOrder,
|
||||||
this.pagesAcross,
|
this.pagesAcross,
|
||||||
this.pagesDown,
|
this.pagesDown,
|
||||||
this.time});
|
this.paperName,
|
||||||
|
this.resolution,
|
||||||
|
this.scalingFactor,
|
||||||
|
this.showsNumberOfCopies = true,
|
||||||
|
this.showsPageRange = true,
|
||||||
|
this.showsPageSetupAccessory = true,
|
||||||
|
this.showsPaperOrientation = true,
|
||||||
|
this.showsPaperSelectionForLoadedPapers = false,
|
||||||
|
this.showsPaperSize = true,
|
||||||
|
this.showsPreview = true,
|
||||||
|
this.showsPrintPanel = true,
|
||||||
|
this.showsPrintSelection = true,
|
||||||
|
this.showsProgressPanel = true,
|
||||||
|
this.showsScaling = true,
|
||||||
|
this.time,
|
||||||
|
this.verticalPagination});
|
||||||
|
|
||||||
///Gets a possible [PrintJobSettings] instance from a [Map] value.
|
///Gets a possible [PrintJobSettings] instance from a [Map] value.
|
||||||
static PrintJobSettings? fromMap(Map<String, dynamic>? map) {
|
static PrintJobSettings? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -410,115 +410,115 @@ class PrintJobSettings {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = PrintJobSettings(
|
final instance = PrintJobSettings(
|
||||||
jobName: map['jobName'],
|
|
||||||
orientation: PrintJobOrientation.fromNativeValue(map['orientation']),
|
|
||||||
numberOfPages: map['numberOfPages'],
|
|
||||||
forceRenderingQuality: PrintJobRenderingQuality.fromNativeValue(
|
|
||||||
map['forceRenderingQuality']),
|
|
||||||
margins: MapEdgeInsets.fromMap(map['margins']?.cast<String, dynamic>()),
|
|
||||||
mediaSize:
|
|
||||||
PrintJobMediaSize.fromMap(map['mediaSize']?.cast<String, dynamic>()),
|
|
||||||
colorMode: PrintJobColorMode.fromNativeValue(map['colorMode']),
|
colorMode: PrintJobColorMode.fromNativeValue(map['colorMode']),
|
||||||
duplexMode: PrintJobDuplexMode.fromNativeValue(map['duplexMode']),
|
duplexMode: PrintJobDuplexMode.fromNativeValue(map['duplexMode']),
|
||||||
outputType: PrintJobOutputType.fromNativeValue(map['outputType']),
|
faxNumber: map['faxNumber'],
|
||||||
resolution: PrintJobResolution.fromMap(
|
firstPage: map['firstPage'],
|
||||||
map['resolution']?.cast<String, dynamic>()),
|
|
||||||
footerHeight: map['footerHeight'],
|
footerHeight: map['footerHeight'],
|
||||||
|
forceRenderingQuality: PrintJobRenderingQuality.fromNativeValue(
|
||||||
|
map['forceRenderingQuality']),
|
||||||
headerHeight: map['headerHeight'],
|
headerHeight: map['headerHeight'],
|
||||||
maximumContentHeight: map['maximumContentHeight'],
|
|
||||||
maximumContentWidth: map['maximumContentWidth'],
|
|
||||||
scalingFactor: map['scalingFactor'],
|
|
||||||
jobDisposition:
|
|
||||||
PrintJobDisposition.fromNativeValue(map['jobDisposition']),
|
|
||||||
jobSavingURL:
|
|
||||||
map['jobSavingURL'] != null ? WebUri(map['jobSavingURL']) : null,
|
|
||||||
paperName: map['paperName'],
|
|
||||||
horizontalPagination:
|
horizontalPagination:
|
||||||
PrintJobPaginationMode.fromNativeValue(map['horizontalPagination']),
|
PrintJobPaginationMode.fromNativeValue(map['horizontalPagination']),
|
||||||
verticalPagination:
|
jobDisposition:
|
||||||
PrintJobPaginationMode.fromNativeValue(map['verticalPagination']),
|
PrintJobDisposition.fromNativeValue(map['jobDisposition']),
|
||||||
pageOrder: PrintJobPageOrder.fromNativeValue(map['pageOrder']),
|
jobName: map['jobName'],
|
||||||
firstPage: map['firstPage'],
|
jobSavingURL:
|
||||||
|
map['jobSavingURL'] != null ? WebUri(map['jobSavingURL']) : null,
|
||||||
lastPage: map['lastPage'],
|
lastPage: map['lastPage'],
|
||||||
faxNumber: map['faxNumber'],
|
margins: MapEdgeInsets.fromMap(map['margins']?.cast<String, dynamic>()),
|
||||||
|
maximumContentHeight: map['maximumContentHeight'],
|
||||||
|
maximumContentWidth: map['maximumContentWidth'],
|
||||||
|
mediaSize:
|
||||||
|
PrintJobMediaSize.fromMap(map['mediaSize']?.cast<String, dynamic>()),
|
||||||
mustCollate: map['mustCollate'],
|
mustCollate: map['mustCollate'],
|
||||||
|
numberOfPages: map['numberOfPages'],
|
||||||
|
orientation: PrintJobOrientation.fromNativeValue(map['orientation']),
|
||||||
|
outputType: PrintJobOutputType.fromNativeValue(map['outputType']),
|
||||||
|
pageOrder: PrintJobPageOrder.fromNativeValue(map['pageOrder']),
|
||||||
pagesAcross: map['pagesAcross'],
|
pagesAcross: map['pagesAcross'],
|
||||||
pagesDown: map['pagesDown'],
|
pagesDown: map['pagesDown'],
|
||||||
|
paperName: map['paperName'],
|
||||||
|
resolution: PrintJobResolution.fromMap(
|
||||||
|
map['resolution']?.cast<String, dynamic>()),
|
||||||
|
scalingFactor: map['scalingFactor'],
|
||||||
time: map['time'],
|
time: map['time'],
|
||||||
|
verticalPagination:
|
||||||
|
PrintJobPaginationMode.fromNativeValue(map['verticalPagination']),
|
||||||
);
|
);
|
||||||
instance.handledByClient = map['handledByClient'];
|
|
||||||
instance.animated = map['animated'];
|
instance.animated = map['animated'];
|
||||||
instance.showsNumberOfCopies = map['showsNumberOfCopies'];
|
|
||||||
instance.showsPaperSelectionForLoadedPapers =
|
|
||||||
map['showsPaperSelectionForLoadedPapers'];
|
|
||||||
instance.showsPaperOrientation = map['showsPaperOrientation'];
|
|
||||||
instance.showsPaperSize = map['showsPaperSize'];
|
|
||||||
instance.showsScaling = map['showsScaling'];
|
|
||||||
instance.showsPageRange = map['showsPageRange'];
|
|
||||||
instance.showsPageSetupAccessory = map['showsPageSetupAccessory'];
|
|
||||||
instance.showsPreview = map['showsPreview'];
|
|
||||||
instance.showsPrintSelection = map['showsPrintSelection'];
|
|
||||||
instance.showsPrintPanel = map['showsPrintPanel'];
|
|
||||||
instance.showsProgressPanel = map['showsProgressPanel'];
|
|
||||||
instance.isHorizontallyCentered = map['isHorizontallyCentered'];
|
|
||||||
instance.isVerticallyCentered = map['isVerticallyCentered'];
|
|
||||||
instance.canSpawnSeparateThread = map['canSpawnSeparateThread'];
|
instance.canSpawnSeparateThread = map['canSpawnSeparateThread'];
|
||||||
instance.copies = map['copies'];
|
instance.copies = map['copies'];
|
||||||
instance.detailedErrorReporting = map['detailedErrorReporting'];
|
instance.detailedErrorReporting = map['detailedErrorReporting'];
|
||||||
|
instance.handledByClient = map['handledByClient'];
|
||||||
instance.headerAndFooter = map['headerAndFooter'];
|
instance.headerAndFooter = map['headerAndFooter'];
|
||||||
|
instance.isHorizontallyCentered = map['isHorizontallyCentered'];
|
||||||
|
instance.isVerticallyCentered = map['isVerticallyCentered'];
|
||||||
|
instance.showsNumberOfCopies = map['showsNumberOfCopies'];
|
||||||
|
instance.showsPageRange = map['showsPageRange'];
|
||||||
|
instance.showsPageSetupAccessory = map['showsPageSetupAccessory'];
|
||||||
|
instance.showsPaperOrientation = map['showsPaperOrientation'];
|
||||||
|
instance.showsPaperSelectionForLoadedPapers =
|
||||||
|
map['showsPaperSelectionForLoadedPapers'];
|
||||||
|
instance.showsPaperSize = map['showsPaperSize'];
|
||||||
|
instance.showsPreview = map['showsPreview'];
|
||||||
|
instance.showsPrintPanel = map['showsPrintPanel'];
|
||||||
|
instance.showsPrintSelection = map['showsPrintSelection'];
|
||||||
|
instance.showsProgressPanel = map['showsProgressPanel'];
|
||||||
|
instance.showsScaling = map['showsScaling'];
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"handledByClient": handledByClient,
|
|
||||||
"jobName": jobName,
|
|
||||||
"animated": animated,
|
"animated": animated,
|
||||||
"orientation": orientation?.toNativeValue(),
|
"canSpawnSeparateThread": canSpawnSeparateThread,
|
||||||
"numberOfPages": numberOfPages,
|
|
||||||
"forceRenderingQuality": forceRenderingQuality?.toNativeValue(),
|
|
||||||
"margins": margins?.toMap(),
|
|
||||||
"mediaSize": mediaSize?.toMap(),
|
|
||||||
"colorMode": colorMode?.toNativeValue(),
|
"colorMode": colorMode?.toNativeValue(),
|
||||||
|
"copies": copies,
|
||||||
|
"detailedErrorReporting": detailedErrorReporting,
|
||||||
"duplexMode": duplexMode?.toNativeValue(),
|
"duplexMode": duplexMode?.toNativeValue(),
|
||||||
"outputType": outputType?.toNativeValue(),
|
"faxNumber": faxNumber,
|
||||||
"resolution": resolution?.toMap(),
|
"firstPage": firstPage,
|
||||||
"showsNumberOfCopies": showsNumberOfCopies,
|
|
||||||
"showsPaperSelectionForLoadedPapers": showsPaperSelectionForLoadedPapers,
|
|
||||||
"showsPaperOrientation": showsPaperOrientation,
|
|
||||||
"showsPaperSize": showsPaperSize,
|
|
||||||
"showsScaling": showsScaling,
|
|
||||||
"showsPageRange": showsPageRange,
|
|
||||||
"showsPageSetupAccessory": showsPageSetupAccessory,
|
|
||||||
"showsPreview": showsPreview,
|
|
||||||
"showsPrintSelection": showsPrintSelection,
|
|
||||||
"showsPrintPanel": showsPrintPanel,
|
|
||||||
"showsProgressPanel": showsProgressPanel,
|
|
||||||
"footerHeight": footerHeight,
|
"footerHeight": footerHeight,
|
||||||
|
"forceRenderingQuality": forceRenderingQuality?.toNativeValue(),
|
||||||
|
"handledByClient": handledByClient,
|
||||||
|
"headerAndFooter": headerAndFooter,
|
||||||
"headerHeight": headerHeight,
|
"headerHeight": headerHeight,
|
||||||
"maximumContentHeight": maximumContentHeight,
|
|
||||||
"maximumContentWidth": maximumContentWidth,
|
|
||||||
"scalingFactor": scalingFactor,
|
|
||||||
"jobDisposition": jobDisposition?.toNativeValue(),
|
|
||||||
"jobSavingURL": jobSavingURL?.toString(),
|
|
||||||
"paperName": paperName,
|
|
||||||
"horizontalPagination": horizontalPagination?.toNativeValue(),
|
"horizontalPagination": horizontalPagination?.toNativeValue(),
|
||||||
"verticalPagination": verticalPagination?.toNativeValue(),
|
|
||||||
"isHorizontallyCentered": isHorizontallyCentered,
|
"isHorizontallyCentered": isHorizontallyCentered,
|
||||||
"isVerticallyCentered": isVerticallyCentered,
|
"isVerticallyCentered": isVerticallyCentered,
|
||||||
"pageOrder": pageOrder?.toNativeValue(),
|
"jobDisposition": jobDisposition?.toNativeValue(),
|
||||||
"canSpawnSeparateThread": canSpawnSeparateThread,
|
"jobName": jobName,
|
||||||
"copies": copies,
|
"jobSavingURL": jobSavingURL?.toString(),
|
||||||
"firstPage": firstPage,
|
|
||||||
"lastPage": lastPage,
|
"lastPage": lastPage,
|
||||||
"detailedErrorReporting": detailedErrorReporting,
|
"margins": margins?.toMap(),
|
||||||
"faxNumber": faxNumber,
|
"maximumContentHeight": maximumContentHeight,
|
||||||
"headerAndFooter": headerAndFooter,
|
"maximumContentWidth": maximumContentWidth,
|
||||||
|
"mediaSize": mediaSize?.toMap(),
|
||||||
"mustCollate": mustCollate,
|
"mustCollate": mustCollate,
|
||||||
|
"numberOfPages": numberOfPages,
|
||||||
|
"orientation": orientation?.toNativeValue(),
|
||||||
|
"outputType": outputType?.toNativeValue(),
|
||||||
|
"pageOrder": pageOrder?.toNativeValue(),
|
||||||
"pagesAcross": pagesAcross,
|
"pagesAcross": pagesAcross,
|
||||||
"pagesDown": pagesDown,
|
"pagesDown": pagesDown,
|
||||||
|
"paperName": paperName,
|
||||||
|
"resolution": resolution?.toMap(),
|
||||||
|
"scalingFactor": scalingFactor,
|
||||||
|
"showsNumberOfCopies": showsNumberOfCopies,
|
||||||
|
"showsPageRange": showsPageRange,
|
||||||
|
"showsPageSetupAccessory": showsPageSetupAccessory,
|
||||||
|
"showsPaperOrientation": showsPaperOrientation,
|
||||||
|
"showsPaperSelectionForLoadedPapers": showsPaperSelectionForLoadedPapers,
|
||||||
|
"showsPaperSize": showsPaperSize,
|
||||||
|
"showsPreview": showsPreview,
|
||||||
|
"showsPrintPanel": showsPrintPanel,
|
||||||
|
"showsPrintSelection": showsPrintSelection,
|
||||||
|
"showsProgressPanel": showsProgressPanel,
|
||||||
|
"showsScaling": showsScaling,
|
||||||
"time": time,
|
"time": time,
|
||||||
|
"verticalPagination": verticalPagination?.toNativeValue(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,6 +534,6 @@ class PrintJobSettings {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'PrintJobSettings{handledByClient: $handledByClient, jobName: $jobName, animated: $animated, orientation: $orientation, numberOfPages: $numberOfPages, forceRenderingQuality: $forceRenderingQuality, margins: $margins, mediaSize: $mediaSize, colorMode: $colorMode, duplexMode: $duplexMode, outputType: $outputType, resolution: $resolution, showsNumberOfCopies: $showsNumberOfCopies, showsPaperSelectionForLoadedPapers: $showsPaperSelectionForLoadedPapers, showsPaperOrientation: $showsPaperOrientation, showsPaperSize: $showsPaperSize, showsScaling: $showsScaling, showsPageRange: $showsPageRange, showsPageSetupAccessory: $showsPageSetupAccessory, showsPreview: $showsPreview, showsPrintSelection: $showsPrintSelection, showsPrintPanel: $showsPrintPanel, showsProgressPanel: $showsProgressPanel, footerHeight: $footerHeight, headerHeight: $headerHeight, maximumContentHeight: $maximumContentHeight, maximumContentWidth: $maximumContentWidth, scalingFactor: $scalingFactor, jobDisposition: $jobDisposition, jobSavingURL: $jobSavingURL, paperName: $paperName, horizontalPagination: $horizontalPagination, verticalPagination: $verticalPagination, isHorizontallyCentered: $isHorizontallyCentered, isVerticallyCentered: $isVerticallyCentered, pageOrder: $pageOrder, canSpawnSeparateThread: $canSpawnSeparateThread, copies: $copies, firstPage: $firstPage, lastPage: $lastPage, detailedErrorReporting: $detailedErrorReporting, faxNumber: $faxNumber, headerAndFooter: $headerAndFooter, mustCollate: $mustCollate, pagesAcross: $pagesAcross, pagesDown: $pagesDown, time: $time}';
|
return 'PrintJobSettings{animated: $animated, canSpawnSeparateThread: $canSpawnSeparateThread, colorMode: $colorMode, copies: $copies, detailedErrorReporting: $detailedErrorReporting, duplexMode: $duplexMode, faxNumber: $faxNumber, firstPage: $firstPage, footerHeight: $footerHeight, forceRenderingQuality: $forceRenderingQuality, handledByClient: $handledByClient, headerAndFooter: $headerAndFooter, headerHeight: $headerHeight, horizontalPagination: $horizontalPagination, isHorizontallyCentered: $isHorizontallyCentered, isVerticallyCentered: $isVerticallyCentered, jobDisposition: $jobDisposition, jobName: $jobName, jobSavingURL: $jobSavingURL, lastPage: $lastPage, margins: $margins, maximumContentHeight: $maximumContentHeight, maximumContentWidth: $maximumContentWidth, mediaSize: $mediaSize, mustCollate: $mustCollate, numberOfPages: $numberOfPages, orientation: $orientation, outputType: $outputType, pageOrder: $pageOrder, pagesAcross: $pagesAcross, pagesDown: $pagesDown, paperName: $paperName, resolution: $resolution, scalingFactor: $scalingFactor, showsNumberOfCopies: $showsNumberOfCopies, showsPageRange: $showsPageRange, showsPageSetupAccessory: $showsPageSetupAccessory, showsPaperOrientation: $showsPaperOrientation, showsPaperSelectionForLoadedPapers: $showsPaperSelectionForLoadedPapers, showsPaperSize: $showsPaperSize, showsPreview: $showsPreview, showsPrintPanel: $showsPrintPanel, showsPrintSelection: $showsPrintSelection, showsProgressPanel: $showsProgressPanel, showsScaling: $showsScaling, time: $time, verticalPagination: $verticalPagination}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,20 +8,11 @@ part of 'pull_to_refresh_settings.dart';
|
||||||
|
|
||||||
///Pull-To-Refresh Settings
|
///Pull-To-Refresh Settings
|
||||||
class PullToRefreshSettings {
|
class PullToRefreshSettings {
|
||||||
///Sets whether the pull-to-refresh feature is enabled or not.
|
///The title text to display in the refresh control.
|
||||||
///The default value is `true`.
|
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
|
||||||
///- iOS
|
///- iOS
|
||||||
bool? enabled;
|
AttributedString? attributedTitle;
|
||||||
|
|
||||||
///The color of the refresh control.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
///- iOS
|
|
||||||
Color? color;
|
|
||||||
|
|
||||||
///The background color of the refresh control.
|
///The background color of the refresh control.
|
||||||
///
|
///
|
||||||
|
@ -30,17 +21,26 @@ class PullToRefreshSettings {
|
||||||
///- iOS
|
///- iOS
|
||||||
Color? backgroundColor;
|
Color? backgroundColor;
|
||||||
|
|
||||||
|
///The color of the refresh control.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
|
///- iOS
|
||||||
|
Color? color;
|
||||||
|
|
||||||
///The distance to trigger a sync in dips.
|
///The distance to trigger a sync in dips.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
int? distanceToTriggerSync;
|
int? distanceToTriggerSync;
|
||||||
|
|
||||||
///The distance in pixels that the refresh indicator can be pulled beyond its resting position.
|
///Sets whether the pull-to-refresh feature is enabled or not.
|
||||||
|
///The default value is `true`.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
int? slingshotDistance;
|
///- iOS
|
||||||
|
bool? enabled;
|
||||||
|
|
||||||
///The size of the refresh indicator.
|
///The size of the refresh indicator.
|
||||||
///
|
///
|
||||||
|
@ -48,19 +48,19 @@ class PullToRefreshSettings {
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
PullToRefreshSize? size;
|
PullToRefreshSize? size;
|
||||||
|
|
||||||
///The title text to display in the refresh control.
|
///The distance in pixels that the refresh indicator can be pulled beyond its resting position.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
///- Android native WebView
|
||||||
AttributedString? attributedTitle;
|
int? slingshotDistance;
|
||||||
PullToRefreshSettings(
|
PullToRefreshSettings(
|
||||||
{this.enabled = true,
|
{this.attributedTitle,
|
||||||
this.color,
|
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
|
this.color,
|
||||||
this.distanceToTriggerSync,
|
this.distanceToTriggerSync,
|
||||||
this.slingshotDistance,
|
this.enabled = true,
|
||||||
this.size,
|
this.size,
|
||||||
this.attributedTitle});
|
this.slingshotDistance});
|
||||||
|
|
||||||
///Gets a possible [PullToRefreshSettings] instance from a [Map] value.
|
///Gets a possible [PullToRefreshSettings] instance from a [Map] value.
|
||||||
static PullToRefreshSettings? fromMap(Map<String, dynamic>? map) {
|
static PullToRefreshSettings? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -68,17 +68,17 @@ class PullToRefreshSettings {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = PullToRefreshSettings(
|
final instance = PullToRefreshSettings(
|
||||||
color: map['color'] != null
|
attributedTitle: AttributedString.fromMap(
|
||||||
? UtilColor.fromStringRepresentation(map['color'])
|
map['attributedTitle']?.cast<String, dynamic>()),
|
||||||
: null,
|
|
||||||
backgroundColor: map['backgroundColor'] != null
|
backgroundColor: map['backgroundColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['backgroundColor'])
|
? UtilColor.fromStringRepresentation(map['backgroundColor'])
|
||||||
: null,
|
: null,
|
||||||
|
color: map['color'] != null
|
||||||
|
? UtilColor.fromStringRepresentation(map['color'])
|
||||||
|
: null,
|
||||||
distanceToTriggerSync: map['distanceToTriggerSync'],
|
distanceToTriggerSync: map['distanceToTriggerSync'],
|
||||||
slingshotDistance: map['slingshotDistance'],
|
|
||||||
size: PullToRefreshSize.fromNativeValue(map['size']),
|
size: PullToRefreshSize.fromNativeValue(map['size']),
|
||||||
attributedTitle: AttributedString.fromMap(
|
slingshotDistance: map['slingshotDistance'],
|
||||||
map['attributedTitle']?.cast<String, dynamic>()),
|
|
||||||
);
|
);
|
||||||
instance.enabled = map['enabled'];
|
instance.enabled = map['enabled'];
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -87,13 +87,13 @@ class PullToRefreshSettings {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"enabled": enabled,
|
|
||||||
"color": color?.toHex(),
|
|
||||||
"backgroundColor": backgroundColor?.toHex(),
|
|
||||||
"distanceToTriggerSync": distanceToTriggerSync,
|
|
||||||
"slingshotDistance": slingshotDistance,
|
|
||||||
"size": size?.toNativeValue(),
|
|
||||||
"attributedTitle": attributedTitle?.toMap(),
|
"attributedTitle": attributedTitle?.toMap(),
|
||||||
|
"backgroundColor": backgroundColor?.toHex(),
|
||||||
|
"color": color?.toHex(),
|
||||||
|
"distanceToTriggerSync": distanceToTriggerSync,
|
||||||
|
"enabled": enabled,
|
||||||
|
"size": size?.toNativeValue(),
|
||||||
|
"slingshotDistance": slingshotDistance,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +109,6 @@ class PullToRefreshSettings {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'PullToRefreshSettings{enabled: $enabled, color: $color, backgroundColor: $backgroundColor, distanceToTriggerSync: $distanceToTriggerSync, slingshotDistance: $slingshotDistance, size: $size, attributedTitle: $attributedTitle}';
|
return 'PullToRefreshSettings{attributedTitle: $attributedTitle, backgroundColor: $backgroundColor, color: $color, distanceToTriggerSync: $distanceToTriggerSync, enabled: $enabled, size: $size, slingshotDistance: $slingshotDistance}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,21 +19,21 @@ class ActionModeMenuItem {
|
||||||
///No menu items should be disabled.
|
///No menu items should be disabled.
|
||||||
static const MENU_ITEM_NONE = ActionModeMenuItem._internal(0, 0);
|
static const MENU_ITEM_NONE = ActionModeMenuItem._internal(0, 0);
|
||||||
|
|
||||||
|
///Disable all the action mode menu items for text processing.
|
||||||
|
static const MENU_ITEM_PROCESS_TEXT = ActionModeMenuItem._internal(4, 4);
|
||||||
|
|
||||||
///Disable menu item "Share".
|
///Disable menu item "Share".
|
||||||
static const MENU_ITEM_SHARE = ActionModeMenuItem._internal(1, 1);
|
static const MENU_ITEM_SHARE = ActionModeMenuItem._internal(1, 1);
|
||||||
|
|
||||||
///Disable menu item "Web Search".
|
///Disable menu item "Web Search".
|
||||||
static const MENU_ITEM_WEB_SEARCH = ActionModeMenuItem._internal(2, 2);
|
static const MENU_ITEM_WEB_SEARCH = ActionModeMenuItem._internal(2, 2);
|
||||||
|
|
||||||
///Disable all the action mode menu items for text processing.
|
|
||||||
static const MENU_ITEM_PROCESS_TEXT = ActionModeMenuItem._internal(4, 4);
|
|
||||||
|
|
||||||
///Set of all values of [ActionModeMenuItem].
|
///Set of all values of [ActionModeMenuItem].
|
||||||
static final Set<ActionModeMenuItem> values = [
|
static final Set<ActionModeMenuItem> values = [
|
||||||
ActionModeMenuItem.MENU_ITEM_NONE,
|
ActionModeMenuItem.MENU_ITEM_NONE,
|
||||||
|
ActionModeMenuItem.MENU_ITEM_PROCESS_TEXT,
|
||||||
ActionModeMenuItem.MENU_ITEM_SHARE,
|
ActionModeMenuItem.MENU_ITEM_SHARE,
|
||||||
ActionModeMenuItem.MENU_ITEM_WEB_SEARCH,
|
ActionModeMenuItem.MENU_ITEM_WEB_SEARCH,
|
||||||
ActionModeMenuItem.MENU_ITEM_PROCESS_TEXT,
|
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [ActionModeMenuItem] instance from [int] value.
|
///Gets a possible [ActionModeMenuItem] instance from [int] value.
|
||||||
|
@ -82,12 +82,12 @@ class ActionModeMenuItem {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 0:
|
||||||
return 'MENU_ITEM_NONE';
|
return 'MENU_ITEM_NONE';
|
||||||
|
case 4:
|
||||||
|
return 'MENU_ITEM_PROCESS_TEXT';
|
||||||
case 1:
|
case 1:
|
||||||
return 'MENU_ITEM_SHARE';
|
return 'MENU_ITEM_SHARE';
|
||||||
case 2:
|
case 2:
|
||||||
return 'MENU_ITEM_WEB_SEARCH';
|
return 'MENU_ITEM_WEB_SEARCH';
|
||||||
case 4:
|
|
||||||
return 'MENU_ITEM_PROCESS_TEXT';
|
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
@ -111,22 +111,22 @@ class AndroidActionModeMenuItem {
|
||||||
///No menu items should be disabled.
|
///No menu items should be disabled.
|
||||||
static const MENU_ITEM_NONE = AndroidActionModeMenuItem._internal(0, 0);
|
static const MENU_ITEM_NONE = AndroidActionModeMenuItem._internal(0, 0);
|
||||||
|
|
||||||
|
///Disable all the action mode menu items for text processing.
|
||||||
|
static const MENU_ITEM_PROCESS_TEXT =
|
||||||
|
AndroidActionModeMenuItem._internal(4, 4);
|
||||||
|
|
||||||
///Disable menu item "Share".
|
///Disable menu item "Share".
|
||||||
static const MENU_ITEM_SHARE = AndroidActionModeMenuItem._internal(1, 1);
|
static const MENU_ITEM_SHARE = AndroidActionModeMenuItem._internal(1, 1);
|
||||||
|
|
||||||
///Disable menu item "Web Search".
|
///Disable menu item "Web Search".
|
||||||
static const MENU_ITEM_WEB_SEARCH = AndroidActionModeMenuItem._internal(2, 2);
|
static const MENU_ITEM_WEB_SEARCH = AndroidActionModeMenuItem._internal(2, 2);
|
||||||
|
|
||||||
///Disable all the action mode menu items for text processing.
|
|
||||||
static const MENU_ITEM_PROCESS_TEXT =
|
|
||||||
AndroidActionModeMenuItem._internal(4, 4);
|
|
||||||
|
|
||||||
///Set of all values of [AndroidActionModeMenuItem].
|
///Set of all values of [AndroidActionModeMenuItem].
|
||||||
static final Set<AndroidActionModeMenuItem> values = [
|
static final Set<AndroidActionModeMenuItem> values = [
|
||||||
AndroidActionModeMenuItem.MENU_ITEM_NONE,
|
AndroidActionModeMenuItem.MENU_ITEM_NONE,
|
||||||
|
AndroidActionModeMenuItem.MENU_ITEM_PROCESS_TEXT,
|
||||||
AndroidActionModeMenuItem.MENU_ITEM_SHARE,
|
AndroidActionModeMenuItem.MENU_ITEM_SHARE,
|
||||||
AndroidActionModeMenuItem.MENU_ITEM_WEB_SEARCH,
|
AndroidActionModeMenuItem.MENU_ITEM_WEB_SEARCH,
|
||||||
AndroidActionModeMenuItem.MENU_ITEM_PROCESS_TEXT,
|
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [AndroidActionModeMenuItem] instance from [int] value.
|
///Gets a possible [AndroidActionModeMenuItem] instance from [int] value.
|
||||||
|
@ -175,12 +175,12 @@ class AndroidActionModeMenuItem {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 0:
|
||||||
return 'MENU_ITEM_NONE';
|
return 'MENU_ITEM_NONE';
|
||||||
|
case 4:
|
||||||
|
return 'MENU_ITEM_PROCESS_TEXT';
|
||||||
case 1:
|
case 1:
|
||||||
return 'MENU_ITEM_SHARE';
|
return 'MENU_ITEM_SHARE';
|
||||||
case 2:
|
case 2:
|
||||||
return 'MENU_ITEM_WEB_SEARCH';
|
return 'MENU_ITEM_WEB_SEARCH';
|
||||||
case 4:
|
|
||||||
return 'MENU_ITEM_PROCESS_TEXT';
|
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,11 @@ part of 'activity_button.dart';
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
///- iOS
|
||||||
class ActivityButton {
|
class ActivityButton {
|
||||||
///The name of the image asset or file.
|
|
||||||
UIImage templateImage;
|
|
||||||
|
|
||||||
///The name of the App or Share Extension to be called.
|
///The name of the App or Share Extension to be called.
|
||||||
String extensionIdentifier;
|
String extensionIdentifier;
|
||||||
|
|
||||||
|
///The name of the image asset or file.
|
||||||
|
UIImage templateImage;
|
||||||
ActivityButton(
|
ActivityButton(
|
||||||
{required this.templateImage, required this.extensionIdentifier});
|
{required this.templateImage, required this.extensionIdentifier});
|
||||||
|
|
||||||
|
@ -29,9 +29,9 @@ class ActivityButton {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = ActivityButton(
|
final instance = ActivityButton(
|
||||||
|
extensionIdentifier: map['extensionIdentifier'],
|
||||||
templateImage:
|
templateImage:
|
||||||
UIImage.fromMap(map['templateImage']?.cast<String, dynamic>())!,
|
UIImage.fromMap(map['templateImage']?.cast<String, dynamic>())!,
|
||||||
extensionIdentifier: map['extensionIdentifier'],
|
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ class ActivityButton {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"templateImage": templateImage.toMap(),
|
|
||||||
"extensionIdentifier": extensionIdentifier,
|
"extensionIdentifier": extensionIdentifier,
|
||||||
|
"templateImage": templateImage.toMap(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,6 @@ class ActivityButton {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'ActivityButton{templateImage: $templateImage, extensionIdentifier: $extensionIdentifier}';
|
return 'ActivityButton{extensionIdentifier: $extensionIdentifier, templateImage: $templateImage}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ class AjaxRequest_ {
|
||||||
///If an empty string is set as the value of responseType, the default value of text is used.
|
///If an empty string is set as the value of responseType, the default value of text is used.
|
||||||
String? responseType;
|
String? responseType;
|
||||||
|
|
||||||
///The response's body content. The content-type depends on the [AjaxRequest.reponseType].
|
///The response's body content. The content-type depends on the [AjaxRequest.responseType].
|
||||||
dynamic response;
|
dynamic response;
|
||||||
|
|
||||||
///The text received from a server following a request being sent.
|
///The text received from a server following a request being sent.
|
||||||
|
|
|
@ -8,92 +8,92 @@ part of 'ajax_request.dart';
|
||||||
|
|
||||||
///Class that represents a JavaScript [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) object.
|
///Class that represents a JavaScript [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) object.
|
||||||
class AjaxRequest {
|
class AjaxRequest {
|
||||||
|
///Indicates the [AjaxRequestAction] that can be used to control the `XMLHttpRequest` request.
|
||||||
|
AjaxRequestAction? action;
|
||||||
|
|
||||||
///Data passed as a parameter to the `XMLHttpRequest.send()` method.
|
///Data passed as a parameter to the `XMLHttpRequest.send()` method.
|
||||||
dynamic data;
|
dynamic data;
|
||||||
|
|
||||||
///The HTTP request method of the `XMLHttpRequest` request.
|
///Event type of the `XMLHttpRequest` request.
|
||||||
String? method;
|
AjaxRequestEvent? event;
|
||||||
|
|
||||||
///The URL of the `XMLHttpRequest` request.
|
|
||||||
WebUri? url;
|
|
||||||
|
|
||||||
///An optional Boolean parameter, defaulting to true, indicating whether or not the request is performed asynchronously.
|
|
||||||
bool? isAsync;
|
|
||||||
|
|
||||||
///The optional user name to use for authentication purposes; by default, this is the null value.
|
|
||||||
String? user;
|
|
||||||
|
|
||||||
///The optional password to use for authentication purposes; by default, this is the null value.
|
|
||||||
String? password;
|
|
||||||
|
|
||||||
///The XMLHttpRequest.withCredentials property is a Boolean that indicates whether or not cross-site Access-Control requests
|
|
||||||
///should be made using credentials such as cookies, authorization headers or TLS client certificates.
|
|
||||||
///Setting withCredentials has no effect on same-site requests.
|
|
||||||
///In addition, this flag is also used to indicate when cookies are to be ignored in the response. The default is false.
|
|
||||||
bool? withCredentials;
|
|
||||||
|
|
||||||
///The HTTP request headers.
|
///The HTTP request headers.
|
||||||
AjaxRequestHeaders? headers;
|
AjaxRequestHeaders? headers;
|
||||||
|
|
||||||
|
///An optional Boolean parameter, defaulting to true, indicating whether or not the request is performed asynchronously.
|
||||||
|
bool? isAsync;
|
||||||
|
|
||||||
|
///The HTTP request method of the `XMLHttpRequest` request.
|
||||||
|
String? method;
|
||||||
|
|
||||||
|
///The optional password to use for authentication purposes; by default, this is the null value.
|
||||||
|
String? password;
|
||||||
|
|
||||||
///The state of the `XMLHttpRequest` request.
|
///The state of the `XMLHttpRequest` request.
|
||||||
AjaxRequestReadyState? readyState;
|
AjaxRequestReadyState? readyState;
|
||||||
|
|
||||||
///The numerical HTTP [status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) of the `XMLHttpRequest`'s response.
|
///The response's body content. The content-type depends on the [AjaxRequest.responseType].
|
||||||
int? status;
|
dynamic response;
|
||||||
|
|
||||||
///The serialized URL of the response or the empty string if the URL is null.
|
///All the response headers or returns null if no response has been received. If a network error happened, an empty string is returned.
|
||||||
///If the URL is returned, any URL fragment present in the URL will be stripped away.
|
Map<String, dynamic>? responseHeaders;
|
||||||
///The value of responseURL will be the final URL obtained after any redirects.
|
|
||||||
WebUri? responseURL;
|
///The text received from a server following a request being sent.
|
||||||
|
String? responseText;
|
||||||
|
|
||||||
///It is an enumerated string value specifying the type of data contained in the response.
|
///It is an enumerated string value specifying the type of data contained in the response.
|
||||||
///It also lets the author change the [response type](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType).
|
///It also lets the author change the [response type](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType).
|
||||||
///If an empty string is set as the value of responseType, the default value of text is used.
|
///If an empty string is set as the value of responseType, the default value of text is used.
|
||||||
String? responseType;
|
String? responseType;
|
||||||
|
|
||||||
///The response's body content. The content-type depends on the [AjaxRequest.reponseType].
|
///The serialized URL of the response or the empty string if the URL is null.
|
||||||
dynamic response;
|
///If the URL is returned, any URL fragment present in the URL will be stripped away.
|
||||||
|
///The value of responseURL will be the final URL obtained after any redirects.
|
||||||
///The text received from a server following a request being sent.
|
WebUri? responseURL;
|
||||||
String? responseText;
|
|
||||||
|
|
||||||
///The HTML or XML string retrieved by the request or null if the request was unsuccessful, has not yet been sent, or if the data can't be parsed as XML or HTML.
|
///The HTML or XML string retrieved by the request or null if the request was unsuccessful, has not yet been sent, or if the data can't be parsed as XML or HTML.
|
||||||
String? responseXML;
|
String? responseXML;
|
||||||
|
|
||||||
|
///The numerical HTTP [status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) of the `XMLHttpRequest`'s response.
|
||||||
|
int? status;
|
||||||
|
|
||||||
///A String containing the response's status message as returned by the HTTP server.
|
///A String containing the response's status message as returned by the HTTP server.
|
||||||
///Unlike [AjaxRequest.status] which indicates a numerical status code, this property contains the text of the response status, such as "OK" or "Not Found".
|
///Unlike [AjaxRequest.status] which indicates a numerical status code, this property contains the text of the response status, such as "OK" or "Not Found".
|
||||||
///If the request's readyState is in [AjaxRequestReadyState.UNSENT] or [AjaxRequestReadyState.OPENED] state, the value of statusText will be an empty string.
|
///If the request's readyState is in [AjaxRequestReadyState.UNSENT] or [AjaxRequestReadyState.OPENED] state, the value of statusText will be an empty string.
|
||||||
///If the server response doesn't explicitly specify a status text, statusText will assume the default value "OK".
|
///If the server response doesn't explicitly specify a status text, statusText will assume the default value "OK".
|
||||||
String? statusText;
|
String? statusText;
|
||||||
|
|
||||||
///All the response headers or returns null if no response has been received. If a network error happened, an empty string is returned.
|
///The URL of the `XMLHttpRequest` request.
|
||||||
Map<String, dynamic>? responseHeaders;
|
WebUri? url;
|
||||||
|
|
||||||
///Event type of the `XMLHttpRequest` request.
|
///The optional user name to use for authentication purposes; by default, this is the null value.
|
||||||
AjaxRequestEvent? event;
|
String? user;
|
||||||
|
|
||||||
///Indicates the [AjaxRequestAction] that can be used to control the `XMLHttpRequest` request.
|
///The XMLHttpRequest.withCredentials property is a Boolean that indicates whether or not cross-site Access-Control requests
|
||||||
AjaxRequestAction? action;
|
///should be made using credentials such as cookies, authorization headers or TLS client certificates.
|
||||||
|
///Setting withCredentials has no effect on same-site requests.
|
||||||
|
///In addition, this flag is also used to indicate when cookies are to be ignored in the response. The default is false.
|
||||||
|
bool? withCredentials;
|
||||||
AjaxRequest(
|
AjaxRequest(
|
||||||
{this.data,
|
{this.action = AjaxRequestAction.PROCEED,
|
||||||
this.method,
|
this.data,
|
||||||
this.url,
|
|
||||||
this.isAsync,
|
|
||||||
this.user,
|
|
||||||
this.password,
|
|
||||||
this.withCredentials,
|
|
||||||
this.headers,
|
|
||||||
this.readyState,
|
|
||||||
this.status,
|
|
||||||
this.responseURL,
|
|
||||||
this.responseType,
|
|
||||||
this.response,
|
|
||||||
this.responseText,
|
|
||||||
this.responseXML,
|
|
||||||
this.statusText,
|
|
||||||
this.responseHeaders,
|
|
||||||
this.event,
|
this.event,
|
||||||
this.action = AjaxRequestAction.PROCEED});
|
this.headers,
|
||||||
|
this.isAsync,
|
||||||
|
this.method,
|
||||||
|
this.password,
|
||||||
|
this.readyState,
|
||||||
|
this.response,
|
||||||
|
this.responseHeaders,
|
||||||
|
this.responseText,
|
||||||
|
this.responseType,
|
||||||
|
this.responseURL,
|
||||||
|
this.responseXML,
|
||||||
|
this.status,
|
||||||
|
this.statusText,
|
||||||
|
this.url,
|
||||||
|
this.user,
|
||||||
|
this.withCredentials});
|
||||||
|
|
||||||
///Gets a possible [AjaxRequest] instance from a [Map] value.
|
///Gets a possible [AjaxRequest] instance from a [Map] value.
|
||||||
static AjaxRequest? fromMap(Map<String, dynamic>? map) {
|
static AjaxRequest? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -102,25 +102,25 @@ class AjaxRequest {
|
||||||
}
|
}
|
||||||
final instance = AjaxRequest(
|
final instance = AjaxRequest(
|
||||||
data: map['data'],
|
data: map['data'],
|
||||||
method: map['method'],
|
event: AjaxRequestEvent.fromMap(map['event']?.cast<String, dynamic>()),
|
||||||
url: map['url'] != null ? WebUri(map['url']) : null,
|
|
||||||
isAsync: map['isAsync'],
|
|
||||||
user: map['user'],
|
|
||||||
password: map['password'],
|
|
||||||
withCredentials: map['withCredentials'],
|
|
||||||
headers:
|
headers:
|
||||||
AjaxRequestHeaders.fromMap(map['headers']?.cast<String, dynamic>()),
|
AjaxRequestHeaders.fromMap(map['headers']?.cast<String, dynamic>()),
|
||||||
|
isAsync: map['isAsync'],
|
||||||
|
method: map['method'],
|
||||||
|
password: map['password'],
|
||||||
readyState: AjaxRequestReadyState.fromNativeValue(map['readyState']),
|
readyState: AjaxRequestReadyState.fromNativeValue(map['readyState']),
|
||||||
status: map['status'],
|
response: map['response'],
|
||||||
|
responseHeaders: map['responseHeaders']?.cast<String, dynamic>(),
|
||||||
|
responseText: map['responseText'],
|
||||||
|
responseType: map['responseType'],
|
||||||
responseURL:
|
responseURL:
|
||||||
map['responseURL'] != null ? WebUri(map['responseURL']) : null,
|
map['responseURL'] != null ? WebUri(map['responseURL']) : null,
|
||||||
responseType: map['responseType'],
|
|
||||||
response: map['response'],
|
|
||||||
responseText: map['responseText'],
|
|
||||||
responseXML: map['responseXML'],
|
responseXML: map['responseXML'],
|
||||||
|
status: map['status'],
|
||||||
statusText: map['statusText'],
|
statusText: map['statusText'],
|
||||||
responseHeaders: map['responseHeaders']?.cast<String, dynamic>(),
|
url: map['url'] != null ? WebUri(map['url']) : null,
|
||||||
event: AjaxRequestEvent.fromMap(map['event']?.cast<String, dynamic>()),
|
user: map['user'],
|
||||||
|
withCredentials: map['withCredentials'],
|
||||||
);
|
);
|
||||||
instance.action = AjaxRequestAction.fromNativeValue(map['action']);
|
instance.action = AjaxRequestAction.fromNativeValue(map['action']);
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -129,25 +129,25 @@ class AjaxRequest {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"data": data,
|
|
||||||
"method": method,
|
|
||||||
"url": url?.toString(),
|
|
||||||
"isAsync": isAsync,
|
|
||||||
"user": user,
|
|
||||||
"password": password,
|
|
||||||
"withCredentials": withCredentials,
|
|
||||||
"headers": headers?.toMap(),
|
|
||||||
"readyState": readyState?.toNativeValue(),
|
|
||||||
"status": status,
|
|
||||||
"responseURL": responseURL?.toString(),
|
|
||||||
"responseType": responseType,
|
|
||||||
"response": response,
|
|
||||||
"responseText": responseText,
|
|
||||||
"responseXML": responseXML,
|
|
||||||
"statusText": statusText,
|
|
||||||
"responseHeaders": responseHeaders,
|
|
||||||
"event": event?.toMap(),
|
|
||||||
"action": action?.toNativeValue(),
|
"action": action?.toNativeValue(),
|
||||||
|
"data": data,
|
||||||
|
"event": event?.toMap(),
|
||||||
|
"headers": headers?.toMap(),
|
||||||
|
"isAsync": isAsync,
|
||||||
|
"method": method,
|
||||||
|
"password": password,
|
||||||
|
"readyState": readyState?.toNativeValue(),
|
||||||
|
"response": response,
|
||||||
|
"responseHeaders": responseHeaders,
|
||||||
|
"responseText": responseText,
|
||||||
|
"responseType": responseType,
|
||||||
|
"responseURL": responseURL?.toString(),
|
||||||
|
"responseXML": responseXML,
|
||||||
|
"status": status,
|
||||||
|
"statusText": statusText,
|
||||||
|
"url": url?.toString(),
|
||||||
|
"user": user,
|
||||||
|
"withCredentials": withCredentials,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,6 +158,6 @@ class AjaxRequest {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'AjaxRequest{data: $data, method: $method, url: $url, isAsync: $isAsync, user: $user, password: $password, withCredentials: $withCredentials, headers: $headers, readyState: $readyState, status: $status, responseURL: $responseURL, responseType: $responseType, response: $response, responseText: $responseText, responseXML: $responseXML, statusText: $statusText, responseHeaders: $responseHeaders, event: $event, action: $action}';
|
return 'AjaxRequest{action: $action, data: $data, event: $event, headers: $headers, isAsync: $isAsync, method: $method, password: $password, readyState: $readyState, response: $response, responseHeaders: $responseHeaders, responseText: $responseText, responseType: $responseType, responseURL: $responseURL, responseXML: $responseXML, status: $status, statusText: $statusText, url: $url, user: $user, withCredentials: $withCredentials}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,6 @@ part of 'ajax_request_event.dart';
|
||||||
|
|
||||||
///Class used by [AjaxRequest] class. It represents events measuring progress of an [AjaxRequest].
|
///Class used by [AjaxRequest] class. It represents events measuring progress of an [AjaxRequest].
|
||||||
class AjaxRequestEvent {
|
class AjaxRequestEvent {
|
||||||
///Event type.
|
|
||||||
AjaxRequestEventType? type;
|
|
||||||
|
|
||||||
///Is a Boolean flag indicating if the total work to be done, and the amount of work already done, by the underlying process is calculable.
|
///Is a Boolean flag indicating if the total work to be done, and the amount of work already done, by the underlying process is calculable.
|
||||||
///In other words, it tells if the progress is measurable or not.
|
///In other words, it tells if the progress is measurable or not.
|
||||||
bool? lengthComputable;
|
bool? lengthComputable;
|
||||||
|
@ -23,7 +20,10 @@ class AjaxRequestEvent {
|
||||||
///Is an integer representing the total amount of work that the underlying process is in the progress of performing.
|
///Is an integer representing the total amount of work that the underlying process is in the progress of performing.
|
||||||
///When downloading a resource using HTTP, this only represent the content itself, not headers and other overhead.
|
///When downloading a resource using HTTP, this only represent the content itself, not headers and other overhead.
|
||||||
int? total;
|
int? total;
|
||||||
AjaxRequestEvent({this.type, this.lengthComputable, this.loaded, this.total});
|
|
||||||
|
///Event type.
|
||||||
|
AjaxRequestEventType? type;
|
||||||
|
AjaxRequestEvent({this.lengthComputable, this.loaded, this.total, this.type});
|
||||||
|
|
||||||
///Gets a possible [AjaxRequestEvent] instance from a [Map] value.
|
///Gets a possible [AjaxRequestEvent] instance from a [Map] value.
|
||||||
static AjaxRequestEvent? fromMap(Map<String, dynamic>? map) {
|
static AjaxRequestEvent? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -31,10 +31,10 @@ class AjaxRequestEvent {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = AjaxRequestEvent(
|
final instance = AjaxRequestEvent(
|
||||||
type: AjaxRequestEventType.fromNativeValue(map['type']),
|
|
||||||
lengthComputable: map['lengthComputable'],
|
lengthComputable: map['lengthComputable'],
|
||||||
loaded: map['loaded'],
|
loaded: map['loaded'],
|
||||||
total: map['total'],
|
total: map['total'],
|
||||||
|
type: AjaxRequestEventType.fromNativeValue(map['type']),
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -42,10 +42,10 @@ class AjaxRequestEvent {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"type": type?.toNativeValue(),
|
|
||||||
"lengthComputable": lengthComputable,
|
"lengthComputable": lengthComputable,
|
||||||
"loaded": loaded,
|
"loaded": loaded,
|
||||||
"total": total,
|
"total": total,
|
||||||
|
"type": type?.toNativeValue(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,6 @@ class AjaxRequestEvent {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'AjaxRequestEvent{type: $type, lengthComputable: $lengthComputable, loaded: $loaded, total: $total}';
|
return 'AjaxRequestEvent{lengthComputable: $lengthComputable, loaded: $loaded, total: $total, type: $type}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,11 @@ class AjaxRequestEventType {
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
AjaxRequestEventType._internal(value, nativeValue());
|
AjaxRequestEventType._internal(value, nativeValue());
|
||||||
|
|
||||||
///The LOADSTART event is fired when a request has started to load data.
|
///The ABORT event is fired when a request has been aborted.
|
||||||
static const LOADSTART =
|
static const ABORT = AjaxRequestEventType._internal('abort', 'abort');
|
||||||
AjaxRequestEventType._internal('loadstart', 'loadstart');
|
|
||||||
|
///The ERROR event is fired when the request encountered an error.
|
||||||
|
static const ERROR = AjaxRequestEventType._internal('error', 'error');
|
||||||
|
|
||||||
///The LOAD event is fired when an `XMLHttpRequest` transaction completes successfully.
|
///The LOAD event is fired when an `XMLHttpRequest` transaction completes successfully.
|
||||||
static const LOAD = AjaxRequestEventType._internal('load', 'load');
|
static const LOAD = AjaxRequestEventType._internal('load', 'load');
|
||||||
|
@ -27,27 +29,25 @@ class AjaxRequestEventType {
|
||||||
///unsuccessfully (after [AjaxRequestEventType.ABORT] or [AjaxRequestEventType.ERROR]).
|
///unsuccessfully (after [AjaxRequestEventType.ABORT] or [AjaxRequestEventType.ERROR]).
|
||||||
static const LOADEND = AjaxRequestEventType._internal('loadend', 'loadend');
|
static const LOADEND = AjaxRequestEventType._internal('loadend', 'loadend');
|
||||||
|
|
||||||
|
///The LOADSTART event is fired when a request has started to load data.
|
||||||
|
static const LOADSTART =
|
||||||
|
AjaxRequestEventType._internal('loadstart', 'loadstart');
|
||||||
|
|
||||||
///The PROGRESS event is fired periodically when a request receives more data.
|
///The PROGRESS event is fired periodically when a request receives more data.
|
||||||
static const PROGRESS =
|
static const PROGRESS =
|
||||||
AjaxRequestEventType._internal('progress', 'progress');
|
AjaxRequestEventType._internal('progress', 'progress');
|
||||||
|
|
||||||
///The ERROR event is fired when the request encountered an error.
|
|
||||||
static const ERROR = AjaxRequestEventType._internal('error', 'error');
|
|
||||||
|
|
||||||
///The ABORT event is fired when a request has been aborted.
|
|
||||||
static const ABORT = AjaxRequestEventType._internal('abort', 'abort');
|
|
||||||
|
|
||||||
///The TIMEOUT event is fired when progression is terminated due to preset time expiring.
|
///The TIMEOUT event is fired when progression is terminated due to preset time expiring.
|
||||||
static const TIMEOUT = AjaxRequestEventType._internal('timeout', 'timeout');
|
static const TIMEOUT = AjaxRequestEventType._internal('timeout', 'timeout');
|
||||||
|
|
||||||
///Set of all values of [AjaxRequestEventType].
|
///Set of all values of [AjaxRequestEventType].
|
||||||
static final Set<AjaxRequestEventType> values = [
|
static final Set<AjaxRequestEventType> values = [
|
||||||
AjaxRequestEventType.LOADSTART,
|
AjaxRequestEventType.ABORT,
|
||||||
|
AjaxRequestEventType.ERROR,
|
||||||
AjaxRequestEventType.LOAD,
|
AjaxRequestEventType.LOAD,
|
||||||
AjaxRequestEventType.LOADEND,
|
AjaxRequestEventType.LOADEND,
|
||||||
|
AjaxRequestEventType.LOADSTART,
|
||||||
AjaxRequestEventType.PROGRESS,
|
AjaxRequestEventType.PROGRESS,
|
||||||
AjaxRequestEventType.ERROR,
|
|
||||||
AjaxRequestEventType.ABORT,
|
|
||||||
AjaxRequestEventType.TIMEOUT,
|
AjaxRequestEventType.TIMEOUT,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
|
|
|
@ -16,11 +16,8 @@ class AjaxRequestReadyState {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
AjaxRequestReadyState._internal(value, nativeValue());
|
AjaxRequestReadyState._internal(value, nativeValue());
|
||||||
|
|
||||||
///Client has been created. `XMLHttpRequest.open()` not called yet.
|
///The operation is complete.
|
||||||
static const UNSENT = AjaxRequestReadyState._internal(0, 0);
|
static const DONE = AjaxRequestReadyState._internal(4, 4);
|
||||||
|
|
||||||
///`XMLHttpRequest.open()` has been called.
|
|
||||||
static const OPENED = AjaxRequestReadyState._internal(1, 1);
|
|
||||||
|
|
||||||
///`XMLHttpRequest.send()` has been called, and [AjaxRequest.headers] and [AjaxRequest.status] are available.
|
///`XMLHttpRequest.send()` has been called, and [AjaxRequest.headers] and [AjaxRequest.status] are available.
|
||||||
static const HEADERS_RECEIVED = AjaxRequestReadyState._internal(2, 2);
|
static const HEADERS_RECEIVED = AjaxRequestReadyState._internal(2, 2);
|
||||||
|
@ -28,16 +25,19 @@ class AjaxRequestReadyState {
|
||||||
///Downloading; [AjaxRequest.responseText] holds partial data.
|
///Downloading; [AjaxRequest.responseText] holds partial data.
|
||||||
static const LOADING = AjaxRequestReadyState._internal(3, 3);
|
static const LOADING = AjaxRequestReadyState._internal(3, 3);
|
||||||
|
|
||||||
///The operation is complete.
|
///`XMLHttpRequest.open()` has been called.
|
||||||
static const DONE = AjaxRequestReadyState._internal(4, 4);
|
static const OPENED = AjaxRequestReadyState._internal(1, 1);
|
||||||
|
|
||||||
|
///Client has been created. `XMLHttpRequest.open()` not called yet.
|
||||||
|
static const UNSENT = AjaxRequestReadyState._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [AjaxRequestReadyState].
|
///Set of all values of [AjaxRequestReadyState].
|
||||||
static final Set<AjaxRequestReadyState> values = [
|
static final Set<AjaxRequestReadyState> values = [
|
||||||
AjaxRequestReadyState.UNSENT,
|
AjaxRequestReadyState.DONE,
|
||||||
AjaxRequestReadyState.OPENED,
|
|
||||||
AjaxRequestReadyState.HEADERS_RECEIVED,
|
AjaxRequestReadyState.HEADERS_RECEIVED,
|
||||||
AjaxRequestReadyState.LOADING,
|
AjaxRequestReadyState.LOADING,
|
||||||
AjaxRequestReadyState.DONE,
|
AjaxRequestReadyState.OPENED,
|
||||||
|
AjaxRequestReadyState.UNSENT,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [AjaxRequestReadyState] instance from [int] value.
|
///Gets a possible [AjaxRequestReadyState] instance from [int] value.
|
||||||
|
@ -81,16 +81,16 @@ class AjaxRequestReadyState {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 4:
|
||||||
return 'UNSENT';
|
return 'DONE';
|
||||||
case 1:
|
|
||||||
return 'OPENED';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'HEADERS_RECEIVED';
|
return 'HEADERS_RECEIVED';
|
||||||
case 3:
|
case 3:
|
||||||
return 'LOADING';
|
return 'LOADING';
|
||||||
case 4:
|
case 1:
|
||||||
return 'DONE';
|
return 'OPENED';
|
||||||
|
case 0:
|
||||||
|
return 'UNSENT';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,18 @@ part of 'android_resource.dart';
|
||||||
|
|
||||||
///Class that represents an Android resource file.
|
///Class that represents an Android resource file.
|
||||||
class AndroidResource {
|
class AndroidResource {
|
||||||
|
///Optional default package to find, if "package:" is not included in the name.
|
||||||
|
///Can be `null` to require an explicit package.
|
||||||
|
///
|
||||||
|
///Example: "android" if you want use resources from `android.R.`
|
||||||
|
String? defPackage;
|
||||||
|
|
||||||
|
///Optional default resource type to find, if "type/" is not included in the name.
|
||||||
|
///Can be `null` to require an explicit type.
|
||||||
|
///
|
||||||
|
///Example: "anim"
|
||||||
|
String? defType;
|
||||||
|
|
||||||
///Android resource name.
|
///Android resource name.
|
||||||
///
|
///
|
||||||
///A list of available `android.R.anim` can be found
|
///A list of available `android.R.anim` can be found
|
||||||
|
@ -18,19 +30,7 @@ class AndroidResource {
|
||||||
///(abc_*.xml files).
|
///(abc_*.xml files).
|
||||||
///In this case, [defPackage] must match your App Android package name.
|
///In this case, [defPackage] must match your App Android package name.
|
||||||
String name;
|
String name;
|
||||||
|
AndroidResource({this.defPackage, this.defType, required this.name});
|
||||||
///Optional default resource type to find, if "type/" is not included in the name.
|
|
||||||
///Can be `null` to require an explicit type.
|
|
||||||
///
|
|
||||||
///Example: "anim"
|
|
||||||
String? defType;
|
|
||||||
|
|
||||||
///Optional default package to find, if "package:" is not included in the name.
|
|
||||||
///Can be `null` to require an explicit package.
|
|
||||||
///
|
|
||||||
///Example: "android" if you want use resources from `android.R.`
|
|
||||||
String? defPackage;
|
|
||||||
AndroidResource({required this.name, this.defType, this.defPackage});
|
|
||||||
|
|
||||||
///Gets a possible [AndroidResource] instance from a [Map] value.
|
///Gets a possible [AndroidResource] instance from a [Map] value.
|
||||||
static AndroidResource? fromMap(Map<String, dynamic>? map) {
|
static AndroidResource? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -38,9 +38,9 @@ class AndroidResource {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = AndroidResource(
|
final instance = AndroidResource(
|
||||||
name: map['name'],
|
|
||||||
defType: map['defType'],
|
|
||||||
defPackage: map['defPackage'],
|
defPackage: map['defPackage'],
|
||||||
|
defType: map['defType'],
|
||||||
|
name: map['name'],
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,9 @@ class AndroidResource {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"name": name,
|
|
||||||
"defType": defType,
|
|
||||||
"defPackage": defPackage,
|
"defPackage": defPackage,
|
||||||
|
"defType": defType,
|
||||||
|
"name": name,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +74,6 @@ class AndroidResource {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'AndroidResource{name: $name, defType: $defType, defPackage: $defPackage}';
|
return 'AndroidResource{defPackage: $defPackage, defType: $defType, name: $name}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,6 @@ part of 'attributed_string.dart';
|
||||||
///Class that represents a string with associated attributes
|
///Class that represents a string with associated attributes
|
||||||
///used by the [PullToRefreshController] and [PullToRefreshSettings] classes.
|
///used by the [PullToRefreshController] and [PullToRefreshSettings] classes.
|
||||||
class AttributedString {
|
class AttributedString {
|
||||||
///The characters for the new object.
|
|
||||||
String string;
|
|
||||||
|
|
||||||
///The color of the background behind the text.
|
///The color of the background behind the text.
|
||||||
///
|
///
|
||||||
///The value of this attribute is a [Color] object.
|
///The value of this attribute is a [Color] object.
|
||||||
|
@ -72,6 +69,9 @@ class AttributedString {
|
||||||
///The default value for this attribute is [UnderlineStyle.STYLE_NONE].
|
///The default value for this attribute is [UnderlineStyle.STYLE_NONE].
|
||||||
UnderlineStyle? strikethroughStyle;
|
UnderlineStyle? strikethroughStyle;
|
||||||
|
|
||||||
|
///The characters for the new object.
|
||||||
|
String string;
|
||||||
|
|
||||||
///The color of the stroke.
|
///The color of the stroke.
|
||||||
///
|
///
|
||||||
///The value of this parameter is a [Color] object.
|
///The value of this parameter is a [Color] object.
|
||||||
|
@ -107,8 +107,7 @@ class AttributedString {
|
||||||
///The default value for this attribute is [UnderlineStyle.STYLE_NONE].
|
///The default value for this attribute is [UnderlineStyle.STYLE_NONE].
|
||||||
UnderlineStyle? underlineStyle;
|
UnderlineStyle? underlineStyle;
|
||||||
AttributedString(
|
AttributedString(
|
||||||
{required this.string,
|
{this.backgroundColor,
|
||||||
this.backgroundColor,
|
|
||||||
this.baselineOffset,
|
this.baselineOffset,
|
||||||
this.expansion,
|
this.expansion,
|
||||||
this.foregroundColor,
|
this.foregroundColor,
|
||||||
|
@ -117,6 +116,7 @@ class AttributedString {
|
||||||
this.obliqueness,
|
this.obliqueness,
|
||||||
this.strikethroughColor,
|
this.strikethroughColor,
|
||||||
this.strikethroughStyle,
|
this.strikethroughStyle,
|
||||||
|
required this.string,
|
||||||
this.strokeColor,
|
this.strokeColor,
|
||||||
this.strokeWidth,
|
this.strokeWidth,
|
||||||
this.textEffect,
|
this.textEffect,
|
||||||
|
@ -129,7 +129,6 @@ class AttributedString {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = AttributedString(
|
final instance = AttributedString(
|
||||||
string: map['string'],
|
|
||||||
backgroundColor: map['backgroundColor'] != null
|
backgroundColor: map['backgroundColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['backgroundColor'])
|
? UtilColor.fromStringRepresentation(map['backgroundColor'])
|
||||||
: null,
|
: null,
|
||||||
|
@ -146,6 +145,7 @@ class AttributedString {
|
||||||
: null,
|
: null,
|
||||||
strikethroughStyle:
|
strikethroughStyle:
|
||||||
UnderlineStyle.fromNativeValue(map['strikethroughStyle']),
|
UnderlineStyle.fromNativeValue(map['strikethroughStyle']),
|
||||||
|
string: map['string'],
|
||||||
strokeColor: map['strokeColor'] != null
|
strokeColor: map['strokeColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['strokeColor'])
|
? UtilColor.fromStringRepresentation(map['strokeColor'])
|
||||||
: null,
|
: null,
|
||||||
|
@ -163,7 +163,6 @@ class AttributedString {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"string": string,
|
|
||||||
"backgroundColor": backgroundColor?.toHex(),
|
"backgroundColor": backgroundColor?.toHex(),
|
||||||
"baselineOffset": baselineOffset,
|
"baselineOffset": baselineOffset,
|
||||||
"expansion": expansion,
|
"expansion": expansion,
|
||||||
|
@ -173,6 +172,7 @@ class AttributedString {
|
||||||
"obliqueness": obliqueness,
|
"obliqueness": obliqueness,
|
||||||
"strikethroughColor": strikethroughColor?.toHex(),
|
"strikethroughColor": strikethroughColor?.toHex(),
|
||||||
"strikethroughStyle": strikethroughStyle?.toNativeValue(),
|
"strikethroughStyle": strikethroughStyle?.toNativeValue(),
|
||||||
|
"string": string,
|
||||||
"strokeColor": strokeColor?.toHex(),
|
"strokeColor": strokeColor?.toHex(),
|
||||||
"strokeWidth": strokeWidth,
|
"strokeWidth": strokeWidth,
|
||||||
"textEffect": textEffect?.toNativeValue(),
|
"textEffect": textEffect?.toNativeValue(),
|
||||||
|
@ -188,7 +188,7 @@ class AttributedString {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'AttributedString{string: $string, backgroundColor: $backgroundColor, baselineOffset: $baselineOffset, expansion: $expansion, foregroundColor: $foregroundColor, kern: $kern, ligature: $ligature, obliqueness: $obliqueness, strikethroughColor: $strikethroughColor, strikethroughStyle: $strikethroughStyle, strokeColor: $strokeColor, strokeWidth: $strokeWidth, textEffect: $textEffect, underlineColor: $underlineColor, underlineStyle: $underlineStyle}';
|
return 'AttributedString{backgroundColor: $backgroundColor, baselineOffset: $baselineOffset, expansion: $expansion, foregroundColor: $foregroundColor, kern: $kern, ligature: $ligature, obliqueness: $obliqueness, strikethroughColor: $strikethroughColor, strikethroughStyle: $strikethroughStyle, string: $string, strokeColor: $strokeColor, strokeWidth: $strokeWidth, textEffect: $textEffect, underlineColor: $underlineColor, underlineStyle: $underlineStyle}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,9 +197,6 @@ class AttributedString {
|
||||||
///Use [AttributedString] instead.
|
///Use [AttributedString] instead.
|
||||||
@Deprecated('Use AttributedString instead')
|
@Deprecated('Use AttributedString instead')
|
||||||
class IOSNSAttributedString {
|
class IOSNSAttributedString {
|
||||||
///The characters for the new object.
|
|
||||||
String string;
|
|
||||||
|
|
||||||
///The color of the background behind the text.
|
///The color of the background behind the text.
|
||||||
///
|
///
|
||||||
///The value of this attribute is a [Color] object.
|
///The value of this attribute is a [Color] object.
|
||||||
|
@ -260,6 +257,9 @@ class IOSNSAttributedString {
|
||||||
///The default value for this attribute is [IOSNSUnderlineStyle.STYLE_NONE].
|
///The default value for this attribute is [IOSNSUnderlineStyle.STYLE_NONE].
|
||||||
IOSNSUnderlineStyle? strikethroughStyle;
|
IOSNSUnderlineStyle? strikethroughStyle;
|
||||||
|
|
||||||
|
///The characters for the new object.
|
||||||
|
String string;
|
||||||
|
|
||||||
///The color of the stroke.
|
///The color of the stroke.
|
||||||
///
|
///
|
||||||
///The value of this parameter is a [Color] object.
|
///The value of this parameter is a [Color] object.
|
||||||
|
@ -295,8 +295,7 @@ class IOSNSAttributedString {
|
||||||
///The default value for this attribute is [IOSNSUnderlineStyle.STYLE_NONE].
|
///The default value for this attribute is [IOSNSUnderlineStyle.STYLE_NONE].
|
||||||
IOSNSUnderlineStyle? underlineStyle;
|
IOSNSUnderlineStyle? underlineStyle;
|
||||||
IOSNSAttributedString(
|
IOSNSAttributedString(
|
||||||
{required this.string,
|
{this.backgroundColor,
|
||||||
this.backgroundColor,
|
|
||||||
this.baselineOffset,
|
this.baselineOffset,
|
||||||
this.expansion,
|
this.expansion,
|
||||||
this.foregroundColor,
|
this.foregroundColor,
|
||||||
|
@ -305,6 +304,7 @@ class IOSNSAttributedString {
|
||||||
this.obliqueness,
|
this.obliqueness,
|
||||||
this.strikethroughColor,
|
this.strikethroughColor,
|
||||||
this.strikethroughStyle,
|
this.strikethroughStyle,
|
||||||
|
required this.string,
|
||||||
this.strokeColor,
|
this.strokeColor,
|
||||||
this.strokeWidth,
|
this.strokeWidth,
|
||||||
this.textEffect,
|
this.textEffect,
|
||||||
|
@ -317,7 +317,6 @@ class IOSNSAttributedString {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = IOSNSAttributedString(
|
final instance = IOSNSAttributedString(
|
||||||
string: map['string'],
|
|
||||||
backgroundColor: map['backgroundColor'] != null
|
backgroundColor: map['backgroundColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['backgroundColor'])
|
? UtilColor.fromStringRepresentation(map['backgroundColor'])
|
||||||
: null,
|
: null,
|
||||||
|
@ -334,6 +333,7 @@ class IOSNSAttributedString {
|
||||||
: null,
|
: null,
|
||||||
strikethroughStyle:
|
strikethroughStyle:
|
||||||
IOSNSUnderlineStyle.fromNativeValue(map['strikethroughStyle']),
|
IOSNSUnderlineStyle.fromNativeValue(map['strikethroughStyle']),
|
||||||
|
string: map['string'],
|
||||||
strokeColor: map['strokeColor'] != null
|
strokeColor: map['strokeColor'] != null
|
||||||
? UtilColor.fromStringRepresentation(map['strokeColor'])
|
? UtilColor.fromStringRepresentation(map['strokeColor'])
|
||||||
: null,
|
: null,
|
||||||
|
@ -352,7 +352,6 @@ class IOSNSAttributedString {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"string": string,
|
|
||||||
"backgroundColor": backgroundColor?.toHex(),
|
"backgroundColor": backgroundColor?.toHex(),
|
||||||
"baselineOffset": baselineOffset,
|
"baselineOffset": baselineOffset,
|
||||||
"expansion": expansion,
|
"expansion": expansion,
|
||||||
|
@ -362,6 +361,7 @@ class IOSNSAttributedString {
|
||||||
"obliqueness": obliqueness,
|
"obliqueness": obliqueness,
|
||||||
"strikethroughColor": strikethroughColor?.toHex(),
|
"strikethroughColor": strikethroughColor?.toHex(),
|
||||||
"strikethroughStyle": strikethroughStyle?.toNativeValue(),
|
"strikethroughStyle": strikethroughStyle?.toNativeValue(),
|
||||||
|
"string": string,
|
||||||
"strokeColor": strokeColor?.toHex(),
|
"strokeColor": strokeColor?.toHex(),
|
||||||
"strokeWidth": strokeWidth,
|
"strokeWidth": strokeWidth,
|
||||||
"textEffect": textEffect?.toNativeValue(),
|
"textEffect": textEffect?.toNativeValue(),
|
||||||
|
@ -377,6 +377,6 @@ class IOSNSAttributedString {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'IOSNSAttributedString{string: $string, backgroundColor: $backgroundColor, baselineOffset: $baselineOffset, expansion: $expansion, foregroundColor: $foregroundColor, kern: $kern, ligature: $ligature, obliqueness: $obliqueness, strikethroughColor: $strikethroughColor, strikethroughStyle: $strikethroughStyle, strokeColor: $strokeColor, strokeWidth: $strokeWidth, textEffect: $textEffect, underlineColor: $underlineColor, underlineStyle: $underlineStyle}';
|
return 'IOSNSAttributedString{backgroundColor: $backgroundColor, baselineOffset: $baselineOffset, expansion: $expansion, foregroundColor: $foregroundColor, kern: $kern, ligature: $ligature, obliqueness: $obliqueness, strikethroughColor: $strikethroughColor, strikethroughStyle: $strikethroughStyle, string: $string, strokeColor: $strokeColor, strokeWidth: $strokeWidth, textEffect: $textEffect, underlineColor: $underlineColor, underlineStyle: $underlineStyle}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,25 +15,25 @@ class CacheMode {
|
||||||
factory CacheMode._internalMultiPlatform(int value, Function nativeValue) =>
|
factory CacheMode._internalMultiPlatform(int value, Function nativeValue) =>
|
||||||
CacheMode._internal(value, nativeValue());
|
CacheMode._internal(value, nativeValue());
|
||||||
|
|
||||||
///Default cache usage mode. If the navigation type doesn't impose any specific behavior,
|
|
||||||
///use cached resources when they are available and not expired, otherwise load resources from the network.
|
|
||||||
static const LOAD_DEFAULT = CacheMode._internal(-1, -1);
|
|
||||||
|
|
||||||
///Use cached resources when they are available, even if they have expired. Otherwise load resources from the network.
|
///Use cached resources when they are available, even if they have expired. Otherwise load resources from the network.
|
||||||
static const LOAD_CACHE_ELSE_NETWORK = CacheMode._internal(1, 1);
|
static const LOAD_CACHE_ELSE_NETWORK = CacheMode._internal(1, 1);
|
||||||
|
|
||||||
///Don't use the cache, load from the network.
|
|
||||||
static const LOAD_NO_CACHE = CacheMode._internal(2, 2);
|
|
||||||
|
|
||||||
///Don't use the network, load from the cache.
|
///Don't use the network, load from the cache.
|
||||||
static const LOAD_CACHE_ONLY = CacheMode._internal(3, 3);
|
static const LOAD_CACHE_ONLY = CacheMode._internal(3, 3);
|
||||||
|
|
||||||
|
///Default cache usage mode. If the navigation type doesn't impose any specific behavior,
|
||||||
|
///use cached resources when they are available and not expired, otherwise load resources from the network.
|
||||||
|
static const LOAD_DEFAULT = CacheMode._internal(-1, -1);
|
||||||
|
|
||||||
|
///Don't use the cache, load from the network.
|
||||||
|
static const LOAD_NO_CACHE = CacheMode._internal(2, 2);
|
||||||
|
|
||||||
///Set of all values of [CacheMode].
|
///Set of all values of [CacheMode].
|
||||||
static final Set<CacheMode> values = [
|
static final Set<CacheMode> values = [
|
||||||
CacheMode.LOAD_DEFAULT,
|
|
||||||
CacheMode.LOAD_CACHE_ELSE_NETWORK,
|
CacheMode.LOAD_CACHE_ELSE_NETWORK,
|
||||||
CacheMode.LOAD_NO_CACHE,
|
|
||||||
CacheMode.LOAD_CACHE_ONLY,
|
CacheMode.LOAD_CACHE_ONLY,
|
||||||
|
CacheMode.LOAD_DEFAULT,
|
||||||
|
CacheMode.LOAD_NO_CACHE,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [CacheMode] instance from [int] value.
|
///Gets a possible [CacheMode] instance from [int] value.
|
||||||
|
@ -77,14 +77,14 @@ class CacheMode {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case -1:
|
|
||||||
return 'LOAD_DEFAULT';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'LOAD_CACHE_ELSE_NETWORK';
|
return 'LOAD_CACHE_ELSE_NETWORK';
|
||||||
case 2:
|
|
||||||
return 'LOAD_NO_CACHE';
|
|
||||||
case 3:
|
case 3:
|
||||||
return 'LOAD_CACHE_ONLY';
|
return 'LOAD_CACHE_ONLY';
|
||||||
|
case -1:
|
||||||
|
return 'LOAD_DEFAULT';
|
||||||
|
case 2:
|
||||||
|
return 'LOAD_NO_CACHE';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
@ -102,25 +102,25 @@ class AndroidCacheMode {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
AndroidCacheMode._internal(value, nativeValue());
|
AndroidCacheMode._internal(value, nativeValue());
|
||||||
|
|
||||||
///Default cache usage mode. If the navigation type doesn't impose any specific behavior,
|
|
||||||
///use cached resources when they are available and not expired, otherwise load resources from the network.
|
|
||||||
static const LOAD_DEFAULT = AndroidCacheMode._internal(-1, -1);
|
|
||||||
|
|
||||||
///Use cached resources when they are available, even if they have expired. Otherwise load resources from the network.
|
///Use cached resources when they are available, even if they have expired. Otherwise load resources from the network.
|
||||||
static const LOAD_CACHE_ELSE_NETWORK = AndroidCacheMode._internal(1, 1);
|
static const LOAD_CACHE_ELSE_NETWORK = AndroidCacheMode._internal(1, 1);
|
||||||
|
|
||||||
///Don't use the cache, load from the network.
|
|
||||||
static const LOAD_NO_CACHE = AndroidCacheMode._internal(2, 2);
|
|
||||||
|
|
||||||
///Don't use the network, load from the cache.
|
///Don't use the network, load from the cache.
|
||||||
static const LOAD_CACHE_ONLY = AndroidCacheMode._internal(3, 3);
|
static const LOAD_CACHE_ONLY = AndroidCacheMode._internal(3, 3);
|
||||||
|
|
||||||
|
///Default cache usage mode. If the navigation type doesn't impose any specific behavior,
|
||||||
|
///use cached resources when they are available and not expired, otherwise load resources from the network.
|
||||||
|
static const LOAD_DEFAULT = AndroidCacheMode._internal(-1, -1);
|
||||||
|
|
||||||
|
///Don't use the cache, load from the network.
|
||||||
|
static const LOAD_NO_CACHE = AndroidCacheMode._internal(2, 2);
|
||||||
|
|
||||||
///Set of all values of [AndroidCacheMode].
|
///Set of all values of [AndroidCacheMode].
|
||||||
static final Set<AndroidCacheMode> values = [
|
static final Set<AndroidCacheMode> values = [
|
||||||
AndroidCacheMode.LOAD_DEFAULT,
|
|
||||||
AndroidCacheMode.LOAD_CACHE_ELSE_NETWORK,
|
AndroidCacheMode.LOAD_CACHE_ELSE_NETWORK,
|
||||||
AndroidCacheMode.LOAD_NO_CACHE,
|
|
||||||
AndroidCacheMode.LOAD_CACHE_ONLY,
|
AndroidCacheMode.LOAD_CACHE_ONLY,
|
||||||
|
AndroidCacheMode.LOAD_DEFAULT,
|
||||||
|
AndroidCacheMode.LOAD_NO_CACHE,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [AndroidCacheMode] instance from [int] value.
|
///Gets a possible [AndroidCacheMode] instance from [int] value.
|
||||||
|
@ -164,14 +164,14 @@ class AndroidCacheMode {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case -1:
|
|
||||||
return 'LOAD_DEFAULT';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'LOAD_CACHE_ELSE_NETWORK';
|
return 'LOAD_CACHE_ELSE_NETWORK';
|
||||||
case 2:
|
|
||||||
return 'LOAD_NO_CACHE';
|
|
||||||
case 3:
|
case 3:
|
||||||
return 'LOAD_CACHE_ONLY';
|
return 'LOAD_CACHE_ONLY';
|
||||||
|
case -1:
|
||||||
|
return 'LOAD_DEFAULT';
|
||||||
|
case 2:
|
||||||
|
return 'LOAD_NO_CACHE';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,12 @@ part of 'call_async_javascript_result.dart';
|
||||||
|
|
||||||
///Class that represents either a success or a failure, including an associated value in each case for [InAppWebViewController.callAsyncJavaScript].
|
///Class that represents either a success or a failure, including an associated value in each case for [InAppWebViewController.callAsyncJavaScript].
|
||||||
class CallAsyncJavaScriptResult {
|
class CallAsyncJavaScriptResult {
|
||||||
///It contains the success value.
|
|
||||||
dynamic value;
|
|
||||||
|
|
||||||
///It contains the failure value.
|
///It contains the failure value.
|
||||||
String? error;
|
String? error;
|
||||||
CallAsyncJavaScriptResult({this.value, this.error});
|
|
||||||
|
///It contains the success value.
|
||||||
|
dynamic value;
|
||||||
|
CallAsyncJavaScriptResult({this.error, this.value});
|
||||||
|
|
||||||
///Gets a possible [CallAsyncJavaScriptResult] instance from a [Map] value.
|
///Gets a possible [CallAsyncJavaScriptResult] instance from a [Map] value.
|
||||||
static CallAsyncJavaScriptResult? fromMap(Map<String, dynamic>? map) {
|
static CallAsyncJavaScriptResult? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -21,8 +21,8 @@ class CallAsyncJavaScriptResult {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = CallAsyncJavaScriptResult(
|
final instance = CallAsyncJavaScriptResult(
|
||||||
value: map['value'],
|
|
||||||
error: map['error'],
|
error: map['error'],
|
||||||
|
value: map['value'],
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ class CallAsyncJavaScriptResult {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"value": value,
|
|
||||||
"error": error,
|
"error": error,
|
||||||
|
"value": value,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +42,6 @@ class CallAsyncJavaScriptResult {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'CallAsyncJavaScriptResult{value: $value, error: $error}';
|
return 'CallAsyncJavaScriptResult{error: $error, value: $value}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,34 +9,34 @@ part of 'client_cert_challenge.dart';
|
||||||
///Class that represents the challenge of the [WebView.onReceivedClientCertRequest] event.
|
///Class that represents the challenge of the [WebView.onReceivedClientCertRequest] event.
|
||||||
///It provides all the information about the challenge.
|
///It provides all the information about the challenge.
|
||||||
class ClientCertChallenge extends URLAuthenticationChallenge {
|
class ClientCertChallenge extends URLAuthenticationChallenge {
|
||||||
///Use [principals] instead.
|
|
||||||
@Deprecated('Use principals instead')
|
|
||||||
List<String>? androidPrincipals;
|
|
||||||
|
|
||||||
///The acceptable certificate issuers for the certificate matching the private key.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView 21+ ([Official API - ClientCertRequest.getPrincipals](https://developer.android.com/reference/android/webkit/ClientCertRequest#getPrincipals()))
|
|
||||||
List<String>? principals;
|
|
||||||
|
|
||||||
///Use [keyTypes] instead.
|
///Use [keyTypes] instead.
|
||||||
@Deprecated('Use keyTypes instead')
|
@Deprecated('Use keyTypes instead')
|
||||||
List<String>? androidKeyTypes;
|
List<String>? androidKeyTypes;
|
||||||
|
|
||||||
|
///Use [principals] instead.
|
||||||
|
@Deprecated('Use principals instead')
|
||||||
|
List<String>? androidPrincipals;
|
||||||
|
|
||||||
///Returns the acceptable types of asymmetric keys.
|
///Returns the acceptable types of asymmetric keys.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView 21+ ([Official API - ClientCertRequest.getKeyTypes](https://developer.android.com/reference/android/webkit/ClientCertRequest#getKeyTypes()))
|
///- Android native WebView 21+ ([Official API - ClientCertRequest.getKeyTypes](https://developer.android.com/reference/android/webkit/ClientCertRequest#getKeyTypes()))
|
||||||
List<String>? keyTypes;
|
List<String>? keyTypes;
|
||||||
|
|
||||||
|
///The acceptable certificate issuers for the certificate matching the private key.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView 21+ ([Official API - ClientCertRequest.getPrincipals](https://developer.android.com/reference/android/webkit/ClientCertRequest#getPrincipals()))
|
||||||
|
List<String>? principals;
|
||||||
ClientCertChallenge(
|
ClientCertChallenge(
|
||||||
{@Deprecated('Use principals instead') this.androidPrincipals,
|
{@Deprecated('Use keyTypes instead') this.androidKeyTypes,
|
||||||
this.principals,
|
@Deprecated('Use principals instead') this.androidPrincipals,
|
||||||
@Deprecated('Use keyTypes instead') this.androidKeyTypes,
|
|
||||||
this.keyTypes,
|
this.keyTypes,
|
||||||
|
this.principals,
|
||||||
required URLProtectionSpace protectionSpace})
|
required URLProtectionSpace protectionSpace})
|
||||||
: super(protectionSpace: protectionSpace) {
|
: super(protectionSpace: protectionSpace) {
|
||||||
principals = principals ?? androidPrincipals;
|
|
||||||
keyTypes = keyTypes ?? androidKeyTypes;
|
keyTypes = keyTypes ?? androidKeyTypes;
|
||||||
|
principals = principals ?? androidPrincipals;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Gets a possible [ClientCertChallenge] instance from a [Map] value.
|
///Gets a possible [ClientCertChallenge] instance from a [Map] value.
|
||||||
|
@ -47,10 +47,10 @@ class ClientCertChallenge extends URLAuthenticationChallenge {
|
||||||
final instance = ClientCertChallenge(
|
final instance = ClientCertChallenge(
|
||||||
protectionSpace: URLProtectionSpace.fromMap(
|
protectionSpace: URLProtectionSpace.fromMap(
|
||||||
map['protectionSpace']?.cast<String, dynamic>())!,
|
map['protectionSpace']?.cast<String, dynamic>())!,
|
||||||
androidPrincipals: map['principals']?.cast<String>(),
|
|
||||||
principals: map['principals']?.cast<String>(),
|
|
||||||
androidKeyTypes: map['keyTypes']?.cast<String>(),
|
androidKeyTypes: map['keyTypes']?.cast<String>(),
|
||||||
|
androidPrincipals: map['principals']?.cast<String>(),
|
||||||
keyTypes: map['keyTypes']?.cast<String>(),
|
keyTypes: map['keyTypes']?.cast<String>(),
|
||||||
|
principals: map['principals']?.cast<String>(),
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,8 @@ class ClientCertChallenge extends URLAuthenticationChallenge {
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"protectionSpace": protectionSpace.toMap(),
|
"protectionSpace": protectionSpace.toMap(),
|
||||||
"principals": principals,
|
|
||||||
"keyTypes": keyTypes,
|
"keyTypes": keyTypes,
|
||||||
|
"principals": principals,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,6 @@ class ClientCertChallenge extends URLAuthenticationChallenge {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'ClientCertChallenge{protectionSpace: $protectionSpace, principals: $principals, keyTypes: $keyTypes}';
|
return 'ClientCertChallenge{protectionSpace: $protectionSpace, keyTypes: $keyTypes, principals: $principals}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,24 +8,24 @@ part of 'client_cert_response.dart';
|
||||||
|
|
||||||
///Class that represents the response used by the [WebView.onReceivedClientCertRequest] event.
|
///Class that represents the response used by the [WebView.onReceivedClientCertRequest] event.
|
||||||
class ClientCertResponse {
|
class ClientCertResponse {
|
||||||
///The file path of the certificate to use.
|
///Indicate the [ClientCertResponseAction] to take in response of the client certificate challenge.
|
||||||
String certificatePath;
|
ClientCertResponseAction? action;
|
||||||
|
|
||||||
///The certificate password.
|
|
||||||
String? certificatePassword;
|
|
||||||
|
|
||||||
///Use [keyStoreType] instead.
|
///Use [keyStoreType] instead.
|
||||||
@Deprecated('Use keyStoreType instead')
|
@Deprecated('Use keyStoreType instead')
|
||||||
String? androidKeyStoreType;
|
String? androidKeyStoreType;
|
||||||
|
|
||||||
|
///The certificate password.
|
||||||
|
String? certificatePassword;
|
||||||
|
|
||||||
|
///The file path of the certificate to use.
|
||||||
|
String certificatePath;
|
||||||
|
|
||||||
///An Android-specific property used by Java [KeyStore](https://developer.android.com/reference/java/security/KeyStore) class to get the instance.
|
///An Android-specific property used by Java [KeyStore](https://developer.android.com/reference/java/security/KeyStore) class to get the instance.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
String? keyStoreType;
|
String? keyStoreType;
|
||||||
|
|
||||||
///Indicate the [ClientCertResponseAction] to take in response of the client certificate challenge.
|
|
||||||
ClientCertResponseAction? action;
|
|
||||||
ClientCertResponse(
|
ClientCertResponse(
|
||||||
{required this.certificatePath,
|
{required this.certificatePath,
|
||||||
this.certificatePassword = "",
|
this.certificatePassword = "",
|
||||||
|
@ -47,20 +47,20 @@ class ClientCertResponse {
|
||||||
final instance = ClientCertResponse(
|
final instance = ClientCertResponse(
|
||||||
certificatePath: map['certificatePath'],
|
certificatePath: map['certificatePath'],
|
||||||
);
|
);
|
||||||
instance.certificatePassword = map['certificatePassword'];
|
|
||||||
instance.androidKeyStoreType = map['keyStoreType'];
|
|
||||||
instance.keyStoreType = map['keyStoreType'];
|
|
||||||
instance.action = ClientCertResponseAction.fromNativeValue(map['action']);
|
instance.action = ClientCertResponseAction.fromNativeValue(map['action']);
|
||||||
|
instance.androidKeyStoreType = map['keyStoreType'];
|
||||||
|
instance.certificatePassword = map['certificatePassword'];
|
||||||
|
instance.keyStoreType = map['keyStoreType'];
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"certificatePath": certificatePath,
|
|
||||||
"certificatePassword": certificatePassword,
|
|
||||||
"keyStoreType": keyStoreType,
|
|
||||||
"action": action?.toNativeValue(),
|
"action": action?.toNativeValue(),
|
||||||
|
"certificatePassword": certificatePassword,
|
||||||
|
"certificatePath": certificatePath,
|
||||||
|
"keyStoreType": keyStoreType,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,6 @@ class ClientCertResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'ClientCertResponse{certificatePath: $certificatePath, certificatePassword: $certificatePassword, keyStoreType: $keyStoreType, action: $action}';
|
return 'ClientCertResponse{action: $action, certificatePassword: $certificatePassword, certificatePath: $certificatePath, keyStoreType: $keyStoreType}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,17 +19,17 @@ class ClientCertResponseAction {
|
||||||
///Cancel this request.
|
///Cancel this request.
|
||||||
static const CANCEL = ClientCertResponseAction._internal(0, 0);
|
static const CANCEL = ClientCertResponseAction._internal(0, 0);
|
||||||
|
|
||||||
///Proceed with the specified certificate.
|
|
||||||
static const PROCEED = ClientCertResponseAction._internal(1, 1);
|
|
||||||
|
|
||||||
///Ignore the request for now.
|
///Ignore the request for now.
|
||||||
static const IGNORE = ClientCertResponseAction._internal(2, 2);
|
static const IGNORE = ClientCertResponseAction._internal(2, 2);
|
||||||
|
|
||||||
|
///Proceed with the specified certificate.
|
||||||
|
static const PROCEED = ClientCertResponseAction._internal(1, 1);
|
||||||
|
|
||||||
///Set of all values of [ClientCertResponseAction].
|
///Set of all values of [ClientCertResponseAction].
|
||||||
static final Set<ClientCertResponseAction> values = [
|
static final Set<ClientCertResponseAction> values = [
|
||||||
ClientCertResponseAction.CANCEL,
|
ClientCertResponseAction.CANCEL,
|
||||||
ClientCertResponseAction.PROCEED,
|
|
||||||
ClientCertResponseAction.IGNORE,
|
ClientCertResponseAction.IGNORE,
|
||||||
|
ClientCertResponseAction.PROCEED,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [ClientCertResponseAction] instance from [int] value.
|
///Gets a possible [ClientCertResponseAction] instance from [int] value.
|
||||||
|
@ -75,10 +75,10 @@ class ClientCertResponseAction {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 0:
|
||||||
return 'CANCEL';
|
return 'CANCEL';
|
||||||
case 1:
|
|
||||||
return 'PROCEED';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'IGNORE';
|
return 'IGNORE';
|
||||||
|
case 1:
|
||||||
|
return 'PROCEED';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,15 +16,15 @@ class CompressFormat {
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
CompressFormat._internal(value, nativeValue());
|
CompressFormat._internal(value, nativeValue());
|
||||||
|
|
||||||
///Compress to the `PNG` format.
|
|
||||||
///PNG is lossless, so `quality` is ignored.
|
|
||||||
static const PNG = CompressFormat._internal('PNG', 'PNG');
|
|
||||||
|
|
||||||
///Compress to the `JPEG` format.
|
///Compress to the `JPEG` format.
|
||||||
///Quality of `0` means compress for the smallest size.
|
///Quality of `0` means compress for the smallest size.
|
||||||
///`100` means compress for max visual quality.
|
///`100` means compress for max visual quality.
|
||||||
static const JPEG = CompressFormat._internal('JPEG', 'JPEG');
|
static const JPEG = CompressFormat._internal('JPEG', 'JPEG');
|
||||||
|
|
||||||
|
///Compress to the `PNG` format.
|
||||||
|
///PNG is lossless, so `quality` is ignored.
|
||||||
|
static const PNG = CompressFormat._internal('PNG', 'PNG');
|
||||||
|
|
||||||
///Compress to the `WEBP` lossy format.
|
///Compress to the `WEBP` lossy format.
|
||||||
///Quality of `0` means compress for the smallest size.
|
///Quality of `0` means compress for the smallest size.
|
||||||
///`100` means compress for max visual quality.
|
///`100` means compress for max visual quality.
|
||||||
|
@ -32,16 +32,6 @@ class CompressFormat {
|
||||||
///**NOTE**: available only on Android.
|
///**NOTE**: available only on Android.
|
||||||
static const WEBP = CompressFormat._internal('WEBP', 'WEBP');
|
static const WEBP = CompressFormat._internal('WEBP', 'WEBP');
|
||||||
|
|
||||||
///Compress to the `WEBP` lossy format.
|
|
||||||
///Quality of `0` means compress for the smallest size.
|
|
||||||
///`100` means compress for max visual quality.
|
|
||||||
///
|
|
||||||
///**NOTE**: available only on Android.
|
|
||||||
///
|
|
||||||
///**NOTE for Android**: available on Android 30+.
|
|
||||||
static const WEBP_LOSSY =
|
|
||||||
CompressFormat._internal('WEBP_LOSSY', 'WEBP_LOSSY');
|
|
||||||
|
|
||||||
///Compress to the `WEBP` lossless format.
|
///Compress to the `WEBP` lossless format.
|
||||||
///Quality refers to how much effort to put into compression.
|
///Quality refers to how much effort to put into compression.
|
||||||
///A value of `0` means to compress quickly, resulting in a relatively large file size.
|
///A value of `0` means to compress quickly, resulting in a relatively large file size.
|
||||||
|
@ -53,13 +43,23 @@ class CompressFormat {
|
||||||
static const WEBP_LOSSLESS =
|
static const WEBP_LOSSLESS =
|
||||||
CompressFormat._internal('WEBP_LOSSLESS', 'WEBP_LOSSLESS');
|
CompressFormat._internal('WEBP_LOSSLESS', 'WEBP_LOSSLESS');
|
||||||
|
|
||||||
|
///Compress to the `WEBP` lossy format.
|
||||||
|
///Quality of `0` means compress for the smallest size.
|
||||||
|
///`100` means compress for max visual quality.
|
||||||
|
///
|
||||||
|
///**NOTE**: available only on Android.
|
||||||
|
///
|
||||||
|
///**NOTE for Android**: available on Android 30+.
|
||||||
|
static const WEBP_LOSSY =
|
||||||
|
CompressFormat._internal('WEBP_LOSSY', 'WEBP_LOSSY');
|
||||||
|
|
||||||
///Set of all values of [CompressFormat].
|
///Set of all values of [CompressFormat].
|
||||||
static final Set<CompressFormat> values = [
|
static final Set<CompressFormat> values = [
|
||||||
CompressFormat.PNG,
|
|
||||||
CompressFormat.JPEG,
|
CompressFormat.JPEG,
|
||||||
|
CompressFormat.PNG,
|
||||||
CompressFormat.WEBP,
|
CompressFormat.WEBP,
|
||||||
CompressFormat.WEBP_LOSSY,
|
|
||||||
CompressFormat.WEBP_LOSSLESS,
|
CompressFormat.WEBP_LOSSLESS,
|
||||||
|
CompressFormat.WEBP_LOSSY,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [CompressFormat] instance from [String] value.
|
///Gets a possible [CompressFormat] instance from [String] value.
|
||||||
|
|
|
@ -16,28 +16,28 @@ class ConsoleMessageLevel {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
ConsoleMessageLevel._internal(value, nativeValue());
|
ConsoleMessageLevel._internal(value, nativeValue());
|
||||||
|
|
||||||
///Console TIP level
|
///Console DEBUG level
|
||||||
static const TIP = ConsoleMessageLevel._internal(0, 0);
|
static const DEBUG = ConsoleMessageLevel._internal(4, 4);
|
||||||
|
|
||||||
///Console LOG level
|
|
||||||
static const LOG = ConsoleMessageLevel._internal(1, 1);
|
|
||||||
|
|
||||||
///Console WARNING level
|
|
||||||
static const WARNING = ConsoleMessageLevel._internal(2, 2);
|
|
||||||
|
|
||||||
///Console ERROR level
|
///Console ERROR level
|
||||||
static const ERROR = ConsoleMessageLevel._internal(3, 3);
|
static const ERROR = ConsoleMessageLevel._internal(3, 3);
|
||||||
|
|
||||||
///Console DEBUG level
|
///Console LOG level
|
||||||
static const DEBUG = ConsoleMessageLevel._internal(4, 4);
|
static const LOG = ConsoleMessageLevel._internal(1, 1);
|
||||||
|
|
||||||
|
///Console TIP level
|
||||||
|
static const TIP = ConsoleMessageLevel._internal(0, 0);
|
||||||
|
|
||||||
|
///Console WARNING level
|
||||||
|
static const WARNING = ConsoleMessageLevel._internal(2, 2);
|
||||||
|
|
||||||
///Set of all values of [ConsoleMessageLevel].
|
///Set of all values of [ConsoleMessageLevel].
|
||||||
static final Set<ConsoleMessageLevel> values = [
|
static final Set<ConsoleMessageLevel> values = [
|
||||||
ConsoleMessageLevel.TIP,
|
|
||||||
ConsoleMessageLevel.LOG,
|
|
||||||
ConsoleMessageLevel.WARNING,
|
|
||||||
ConsoleMessageLevel.ERROR,
|
|
||||||
ConsoleMessageLevel.DEBUG,
|
ConsoleMessageLevel.DEBUG,
|
||||||
|
ConsoleMessageLevel.ERROR,
|
||||||
|
ConsoleMessageLevel.LOG,
|
||||||
|
ConsoleMessageLevel.TIP,
|
||||||
|
ConsoleMessageLevel.WARNING,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [ConsoleMessageLevel] instance from [int] value.
|
///Gets a possible [ConsoleMessageLevel] instance from [int] value.
|
||||||
|
@ -81,16 +81,16 @@ class ConsoleMessageLevel {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'TIP';
|
|
||||||
case 1:
|
|
||||||
return 'LOG';
|
|
||||||
case 2:
|
|
||||||
return 'WARNING';
|
|
||||||
case 3:
|
|
||||||
return 'ERROR';
|
|
||||||
case 4:
|
case 4:
|
||||||
return 'DEBUG';
|
return 'DEBUG';
|
||||||
|
case 3:
|
||||||
|
return 'ERROR';
|
||||||
|
case 1:
|
||||||
|
return 'LOG';
|
||||||
|
case 0:
|
||||||
|
return 'TIP';
|
||||||
|
case 2:
|
||||||
|
return 'WARNING';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,26 @@ class ContentBlockerActionType {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
///Strips cookies from the header before sending it to the server.
|
||||||
|
///This only blocks cookies otherwise acceptable to WebView's privacy policy.
|
||||||
|
///Combining with [IGNORE_PREVIOUS_RULES] doesn't override the browser’s privacy settings.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
static final BLOCK_COOKIES =
|
||||||
|
ContentBlockerActionType._internalMultiPlatform('block-cookies', () {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.iOS:
|
||||||
|
return 'block-cookies';
|
||||||
|
case TargetPlatform.macOS:
|
||||||
|
return 'block-cookies';
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
///Hides elements of the page based on a CSS selector.
|
///Hides elements of the page based on a CSS selector.
|
||||||
///A selector field contains the selector list.
|
///A selector field contains the selector list.
|
||||||
///Any matching element has its display property set to none, which hides it.
|
///Any matching element has its display property set to none, which hides it.
|
||||||
|
@ -62,6 +82,25 @@ class ContentBlockerActionType {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
///Ignores previously triggered actions.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
static final IGNORE_PREVIOUS_RULES =
|
||||||
|
ContentBlockerActionType._internalMultiPlatform('ignore-previous-rules',
|
||||||
|
() {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.iOS:
|
||||||
|
return 'ignore-previous-rules';
|
||||||
|
case TargetPlatform.macOS:
|
||||||
|
return 'ignore-previous-rules';
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
///Changes a URL from http to https.
|
///Changes a URL from http to https.
|
||||||
///URLs with a specified (nondefault) port and links using other protocols are unaffected.
|
///URLs with a specified (nondefault) port and links using other protocols are unaffected.
|
||||||
///
|
///
|
||||||
|
@ -84,52 +123,13 @@ class ContentBlockerActionType {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
///Strips cookies from the header before sending it to the server.
|
|
||||||
///This only blocks cookies otherwise acceptable to WebView's privacy policy.
|
|
||||||
///Combining with [IGNORE_PREVIOUS_RULES] doesn't override the browser’s privacy settings.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
|
||||||
static final BLOCK_COOKIES =
|
|
||||||
ContentBlockerActionType._internalMultiPlatform('block-cookies', () {
|
|
||||||
switch (defaultTargetPlatform) {
|
|
||||||
case TargetPlatform.iOS:
|
|
||||||
return 'block-cookies';
|
|
||||||
case TargetPlatform.macOS:
|
|
||||||
return 'block-cookies';
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
///Ignores previously triggered actions.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
|
||||||
static final IGNORE_PREVIOUS_RULES =
|
|
||||||
ContentBlockerActionType._internalMultiPlatform('ignore-previous-rules',
|
|
||||||
() {
|
|
||||||
switch (defaultTargetPlatform) {
|
|
||||||
case TargetPlatform.iOS:
|
|
||||||
return 'ignore-previous-rules';
|
|
||||||
case TargetPlatform.macOS:
|
|
||||||
return 'ignore-previous-rules';
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
///Set of all values of [ContentBlockerActionType].
|
///Set of all values of [ContentBlockerActionType].
|
||||||
static final Set<ContentBlockerActionType> values = [
|
static final Set<ContentBlockerActionType> values = [
|
||||||
ContentBlockerActionType.BLOCK,
|
ContentBlockerActionType.BLOCK,
|
||||||
ContentBlockerActionType.CSS_DISPLAY_NONE,
|
|
||||||
ContentBlockerActionType.MAKE_HTTPS,
|
|
||||||
ContentBlockerActionType.BLOCK_COOKIES,
|
ContentBlockerActionType.BLOCK_COOKIES,
|
||||||
|
ContentBlockerActionType.CSS_DISPLAY_NONE,
|
||||||
ContentBlockerActionType.IGNORE_PREVIOUS_RULES,
|
ContentBlockerActionType.IGNORE_PREVIOUS_RULES,
|
||||||
|
ContentBlockerActionType.MAKE_HTTPS,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [ContentBlockerActionType] instance from [String] value.
|
///Gets a possible [ContentBlockerActionType] instance from [String] value.
|
||||||
|
|
|
@ -17,18 +17,18 @@ class ContentBlockerTriggerLoadContext {
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
ContentBlockerTriggerLoadContext._internal(value, nativeValue());
|
ContentBlockerTriggerLoadContext._internal(value, nativeValue());
|
||||||
|
|
||||||
///Top frame load context
|
|
||||||
static const TOP_FRAME =
|
|
||||||
ContentBlockerTriggerLoadContext._internal('top-frame', 'top-frame');
|
|
||||||
|
|
||||||
///Child frame load context
|
///Child frame load context
|
||||||
static const CHILD_FRAME =
|
static const CHILD_FRAME =
|
||||||
ContentBlockerTriggerLoadContext._internal('child-frame', 'child-frame');
|
ContentBlockerTriggerLoadContext._internal('child-frame', 'child-frame');
|
||||||
|
|
||||||
|
///Top frame load context
|
||||||
|
static const TOP_FRAME =
|
||||||
|
ContentBlockerTriggerLoadContext._internal('top-frame', 'top-frame');
|
||||||
|
|
||||||
///Set of all values of [ContentBlockerTriggerLoadContext].
|
///Set of all values of [ContentBlockerTriggerLoadContext].
|
||||||
static final Set<ContentBlockerTriggerLoadContext> values = [
|
static final Set<ContentBlockerTriggerLoadContext> values = [
|
||||||
ContentBlockerTriggerLoadContext.TOP_FRAME,
|
|
||||||
ContentBlockerTriggerLoadContext.CHILD_FRAME,
|
ContentBlockerTriggerLoadContext.CHILD_FRAME,
|
||||||
|
ContentBlockerTriggerLoadContext.TOP_FRAME,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [ContentBlockerTriggerLoadContext] instance from [String] value.
|
///Gets a possible [ContentBlockerTriggerLoadContext] instance from [String] value.
|
||||||
|
|
|
@ -18,32 +18,32 @@ class ContentBlockerTriggerResourceType {
|
||||||
ContentBlockerTriggerResourceType._internal(value, nativeValue());
|
ContentBlockerTriggerResourceType._internal(value, nativeValue());
|
||||||
static const DOCUMENT =
|
static const DOCUMENT =
|
||||||
ContentBlockerTriggerResourceType._internal('document', 'document');
|
ContentBlockerTriggerResourceType._internal('document', 'document');
|
||||||
static const IMAGE =
|
|
||||||
ContentBlockerTriggerResourceType._internal('image', 'image');
|
|
||||||
static const STYLE_SHEET =
|
|
||||||
ContentBlockerTriggerResourceType._internal('style-sheet', 'style-sheet');
|
|
||||||
static const SCRIPT =
|
|
||||||
ContentBlockerTriggerResourceType._internal('script', 'script');
|
|
||||||
static const FONT =
|
static const FONT =
|
||||||
ContentBlockerTriggerResourceType._internal('font', 'font');
|
ContentBlockerTriggerResourceType._internal('font', 'font');
|
||||||
|
static const IMAGE =
|
||||||
|
ContentBlockerTriggerResourceType._internal('image', 'image');
|
||||||
static const MEDIA =
|
static const MEDIA =
|
||||||
ContentBlockerTriggerResourceType._internal('media', 'media');
|
ContentBlockerTriggerResourceType._internal('media', 'media');
|
||||||
static const SVG_DOCUMENT = ContentBlockerTriggerResourceType._internal(
|
|
||||||
'svg-document', 'svg-document');
|
|
||||||
|
|
||||||
///Any untyped load
|
///Any untyped load
|
||||||
static const RAW = ContentBlockerTriggerResourceType._internal('raw', 'raw');
|
static const RAW = ContentBlockerTriggerResourceType._internal('raw', 'raw');
|
||||||
|
static const SCRIPT =
|
||||||
|
ContentBlockerTriggerResourceType._internal('script', 'script');
|
||||||
|
static const STYLE_SHEET =
|
||||||
|
ContentBlockerTriggerResourceType._internal('style-sheet', 'style-sheet');
|
||||||
|
static const SVG_DOCUMENT = ContentBlockerTriggerResourceType._internal(
|
||||||
|
'svg-document', 'svg-document');
|
||||||
|
|
||||||
///Set of all values of [ContentBlockerTriggerResourceType].
|
///Set of all values of [ContentBlockerTriggerResourceType].
|
||||||
static final Set<ContentBlockerTriggerResourceType> values = [
|
static final Set<ContentBlockerTriggerResourceType> values = [
|
||||||
ContentBlockerTriggerResourceType.DOCUMENT,
|
ContentBlockerTriggerResourceType.DOCUMENT,
|
||||||
ContentBlockerTriggerResourceType.IMAGE,
|
|
||||||
ContentBlockerTriggerResourceType.STYLE_SHEET,
|
|
||||||
ContentBlockerTriggerResourceType.SCRIPT,
|
|
||||||
ContentBlockerTriggerResourceType.FONT,
|
ContentBlockerTriggerResourceType.FONT,
|
||||||
|
ContentBlockerTriggerResourceType.IMAGE,
|
||||||
ContentBlockerTriggerResourceType.MEDIA,
|
ContentBlockerTriggerResourceType.MEDIA,
|
||||||
ContentBlockerTriggerResourceType.SVG_DOCUMENT,
|
|
||||||
ContentBlockerTriggerResourceType.RAW,
|
ContentBlockerTriggerResourceType.RAW,
|
||||||
|
ContentBlockerTriggerResourceType.SCRIPT,
|
||||||
|
ContentBlockerTriggerResourceType.STYLE_SHEET,
|
||||||
|
ContentBlockerTriggerResourceType.SVG_DOCUMENT,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [ContentBlockerTriggerResourceType] instance from [String] value.
|
///Gets a possible [ContentBlockerTriggerResourceType] instance from [String] value.
|
||||||
|
|
|
@ -8,56 +8,56 @@ part of 'cookie.dart';
|
||||||
|
|
||||||
///Class that represents a cookie returned by the [CookieManager].
|
///Class that represents a cookie returned by the [CookieManager].
|
||||||
class Cookie {
|
class Cookie {
|
||||||
///The cookie name.
|
///The cookie domain.
|
||||||
String name;
|
///
|
||||||
|
///**NOTE**: on Android it will be always `null`.
|
||||||
///The cookie value.
|
String? domain;
|
||||||
dynamic value;
|
|
||||||
|
|
||||||
///The cookie expiration date in milliseconds.
|
///The cookie expiration date in milliseconds.
|
||||||
///
|
///
|
||||||
///**NOTE**: on Android it will be always `null`.
|
///**NOTE**: on Android it will be always `null`.
|
||||||
int? expiresDate;
|
int? expiresDate;
|
||||||
|
|
||||||
///Indicates if the cookie is a session only cookie.
|
///Indicates if the cookie is a http only cookie.
|
||||||
///
|
///
|
||||||
///**NOTE**: on Android it will be always `null`.
|
///**NOTE**: on Android it will be always `null`.
|
||||||
bool? isSessionOnly;
|
bool? isHttpOnly;
|
||||||
|
|
||||||
///The cookie domain.
|
|
||||||
///
|
|
||||||
///**NOTE**: on Android it will be always `null`.
|
|
||||||
String? domain;
|
|
||||||
|
|
||||||
///The cookie same site policy.
|
|
||||||
///
|
|
||||||
///**NOTE**: on Android it will be always `null`.
|
|
||||||
HTTPCookieSameSitePolicy? sameSite;
|
|
||||||
|
|
||||||
///Indicates if the cookie is secure or not.
|
///Indicates if the cookie is secure or not.
|
||||||
///
|
///
|
||||||
///**NOTE**: on Android it will be always `null`.
|
///**NOTE**: on Android it will be always `null`.
|
||||||
bool? isSecure;
|
bool? isSecure;
|
||||||
|
|
||||||
///Indicates if the cookie is a http only cookie.
|
///Indicates if the cookie is a session only cookie.
|
||||||
///
|
///
|
||||||
///**NOTE**: on Android it will be always `null`.
|
///**NOTE**: on Android it will be always `null`.
|
||||||
bool? isHttpOnly;
|
bool? isSessionOnly;
|
||||||
|
|
||||||
|
///The cookie name.
|
||||||
|
String name;
|
||||||
|
|
||||||
///The cookie path.
|
///The cookie path.
|
||||||
///
|
///
|
||||||
///**NOTE**: on Android it will be always `null`.
|
///**NOTE**: on Android it will be always `null`.
|
||||||
String? path;
|
String? path;
|
||||||
|
|
||||||
|
///The cookie same site policy.
|
||||||
|
///
|
||||||
|
///**NOTE**: on Android it will be always `null`.
|
||||||
|
HTTPCookieSameSitePolicy? sameSite;
|
||||||
|
|
||||||
|
///The cookie value.
|
||||||
|
dynamic value;
|
||||||
Cookie(
|
Cookie(
|
||||||
{required this.name,
|
{this.domain,
|
||||||
this.value,
|
|
||||||
this.expiresDate,
|
this.expiresDate,
|
||||||
this.isSessionOnly,
|
|
||||||
this.domain,
|
|
||||||
this.sameSite,
|
|
||||||
this.isSecure,
|
|
||||||
this.isHttpOnly,
|
this.isHttpOnly,
|
||||||
this.path});
|
this.isSecure,
|
||||||
|
this.isSessionOnly,
|
||||||
|
required this.name,
|
||||||
|
this.path,
|
||||||
|
this.sameSite,
|
||||||
|
this.value});
|
||||||
|
|
||||||
///Gets a possible [Cookie] instance from a [Map] value.
|
///Gets a possible [Cookie] instance from a [Map] value.
|
||||||
static Cookie? fromMap(Map<String, dynamic>? map) {
|
static Cookie? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -65,15 +65,15 @@ class Cookie {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = Cookie(
|
final instance = Cookie(
|
||||||
name: map['name'],
|
|
||||||
value: map['value'],
|
|
||||||
expiresDate: map['expiresDate'],
|
|
||||||
isSessionOnly: map['isSessionOnly'],
|
|
||||||
domain: map['domain'],
|
domain: map['domain'],
|
||||||
sameSite: HTTPCookieSameSitePolicy.fromNativeValue(map['sameSite']),
|
expiresDate: map['expiresDate'],
|
||||||
isSecure: map['isSecure'],
|
|
||||||
isHttpOnly: map['isHttpOnly'],
|
isHttpOnly: map['isHttpOnly'],
|
||||||
|
isSecure: map['isSecure'],
|
||||||
|
isSessionOnly: map['isSessionOnly'],
|
||||||
|
name: map['name'],
|
||||||
path: map['path'],
|
path: map['path'],
|
||||||
|
sameSite: HTTPCookieSameSitePolicy.fromNativeValue(map['sameSite']),
|
||||||
|
value: map['value'],
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -81,15 +81,15 @@ class Cookie {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"name": name,
|
|
||||||
"value": value,
|
|
||||||
"expiresDate": expiresDate,
|
|
||||||
"isSessionOnly": isSessionOnly,
|
|
||||||
"domain": domain,
|
"domain": domain,
|
||||||
"sameSite": sameSite?.toNativeValue(),
|
"expiresDate": expiresDate,
|
||||||
"isSecure": isSecure,
|
|
||||||
"isHttpOnly": isHttpOnly,
|
"isHttpOnly": isHttpOnly,
|
||||||
|
"isSecure": isSecure,
|
||||||
|
"isSessionOnly": isSessionOnly,
|
||||||
|
"name": name,
|
||||||
"path": path,
|
"path": path,
|
||||||
|
"sameSite": sameSite?.toNativeValue(),
|
||||||
|
"value": value,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +100,6 @@ class Cookie {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'Cookie{name: $name, value: $value, expiresDate: $expiresDate, isSessionOnly: $isSessionOnly, domain: $domain, sameSite: $sameSite, isSecure: $isSecure, isHttpOnly: $isHttpOnly, path: $path}';
|
return 'Cookie{domain: $domain, expiresDate: $expiresDate, isHttpOnly: $isHttpOnly, isSecure: $isSecure, isSessionOnly: $isSessionOnly, name: $name, path: $path, sameSite: $sameSite, value: $value}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,37 +8,37 @@ part of 'create_window_action.dart';
|
||||||
|
|
||||||
///Class that represents the navigation request used by the [WebView.onCreateWindow] event.
|
///Class that represents the navigation request used by the [WebView.onCreateWindow] event.
|
||||||
class CreateWindowAction extends NavigationAction {
|
class CreateWindowAction extends NavigationAction {
|
||||||
///The window id. Used by [WebView] to create a new WebView.
|
|
||||||
int windowId;
|
|
||||||
|
|
||||||
///Use [isDialog] instead.
|
///Use [isDialog] instead.
|
||||||
@Deprecated('Use isDialog instead')
|
@Deprecated('Use isDialog instead')
|
||||||
bool? androidIsDialog;
|
bool? androidIsDialog;
|
||||||
|
|
||||||
|
///Use [windowFeatures] instead.
|
||||||
|
@Deprecated('Use windowFeatures instead')
|
||||||
|
IOSWKWindowFeatures? iosWindowFeatures;
|
||||||
|
|
||||||
///Indicates if the new window should be a dialog, rather than a full-size window.
|
///Indicates if the new window should be a dialog, rather than a full-size window.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
bool? isDialog;
|
bool? isDialog;
|
||||||
|
|
||||||
///Use [windowFeatures] instead.
|
|
||||||
@Deprecated('Use windowFeatures instead')
|
|
||||||
IOSWKWindowFeatures? iosWindowFeatures;
|
|
||||||
|
|
||||||
///Window features requested by the webpage.
|
///Window features requested by the webpage.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS ([Official API - WKWindowFeatures](https://developer.apple.com/documentation/webkit/wkwindowfeatures))
|
///- iOS ([Official API - WKWindowFeatures](https://developer.apple.com/documentation/webkit/wkwindowfeatures))
|
||||||
///- MacOS ([Official API - WKWindowFeatures](https://developer.apple.com/documentation/webkit/wkwindowfeatures))
|
///- MacOS ([Official API - WKWindowFeatures](https://developer.apple.com/documentation/webkit/wkwindowfeatures))
|
||||||
WindowFeatures? windowFeatures;
|
WindowFeatures? windowFeatures;
|
||||||
|
|
||||||
|
///The window id. Used by [WebView] to create a new WebView.
|
||||||
|
int windowId;
|
||||||
CreateWindowAction(
|
CreateWindowAction(
|
||||||
{required this.windowId,
|
{@Deprecated('Use isDialog instead')
|
||||||
@Deprecated('Use isDialog instead')
|
|
||||||
this.androidIsDialog,
|
this.androidIsDialog,
|
||||||
this.isDialog,
|
|
||||||
@Deprecated('Use windowFeatures instead')
|
@Deprecated('Use windowFeatures instead')
|
||||||
this.iosWindowFeatures,
|
this.iosWindowFeatures,
|
||||||
|
this.isDialog,
|
||||||
this.windowFeatures,
|
this.windowFeatures,
|
||||||
|
required this.windowId,
|
||||||
required URLRequest request,
|
required URLRequest request,
|
||||||
required bool isForMainFrame,
|
required bool isForMainFrame,
|
||||||
@Deprecated('Use hasGesture instead')
|
@Deprecated('Use hasGesture instead')
|
||||||
|
@ -84,13 +84,13 @@ class CreateWindowAction extends NavigationAction {
|
||||||
final instance = CreateWindowAction(
|
final instance = CreateWindowAction(
|
||||||
request: URLRequest.fromMap(map['request']?.cast<String, dynamic>())!,
|
request: URLRequest.fromMap(map['request']?.cast<String, dynamic>())!,
|
||||||
isForMainFrame: map['isForMainFrame'],
|
isForMainFrame: map['isForMainFrame'],
|
||||||
windowId: map['windowId'],
|
|
||||||
androidIsDialog: map['isDialog'],
|
androidIsDialog: map['isDialog'],
|
||||||
isDialog: map['isDialog'],
|
|
||||||
iosWindowFeatures: IOSWKWindowFeatures.fromMap(
|
iosWindowFeatures: IOSWKWindowFeatures.fromMap(
|
||||||
map['windowFeatures']?.cast<String, dynamic>()),
|
map['windowFeatures']?.cast<String, dynamic>()),
|
||||||
|
isDialog: map['isDialog'],
|
||||||
windowFeatures: WindowFeatures.fromMap(
|
windowFeatures: WindowFeatures.fromMap(
|
||||||
map['windowFeatures']?.cast<String, dynamic>()),
|
map['windowFeatures']?.cast<String, dynamic>()),
|
||||||
|
windowId: map['windowId'],
|
||||||
);
|
);
|
||||||
instance.androidHasGesture = map['hasGesture'];
|
instance.androidHasGesture = map['hasGesture'];
|
||||||
instance.hasGesture = map['hasGesture'];
|
instance.hasGesture = map['hasGesture'];
|
||||||
|
@ -123,9 +123,9 @@ class CreateWindowAction extends NavigationAction {
|
||||||
"sourceFrame": sourceFrame?.toMap(),
|
"sourceFrame": sourceFrame?.toMap(),
|
||||||
"targetFrame": targetFrame?.toMap(),
|
"targetFrame": targetFrame?.toMap(),
|
||||||
"shouldPerformDownload": shouldPerformDownload,
|
"shouldPerformDownload": shouldPerformDownload,
|
||||||
"windowId": windowId,
|
|
||||||
"isDialog": isDialog,
|
"isDialog": isDialog,
|
||||||
"windowFeatures": windowFeatures?.toMap(),
|
"windowFeatures": windowFeatures?.toMap(),
|
||||||
|
"windowId": windowId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +136,6 @@ class CreateWindowAction extends NavigationAction {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'CreateWindowAction{request: $request, isForMainFrame: $isForMainFrame, hasGesture: $hasGesture, isRedirect: $isRedirect, navigationType: $navigationType, sourceFrame: $sourceFrame, targetFrame: $targetFrame, shouldPerformDownload: $shouldPerformDownload, windowId: $windowId, isDialog: $isDialog, windowFeatures: $windowFeatures}';
|
return 'CreateWindowAction{request: $request, isForMainFrame: $isForMainFrame, hasGesture: $hasGesture, isRedirect: $isRedirect, navigationType: $navigationType, sourceFrame: $sourceFrame, targetFrame: $targetFrame, shouldPerformDownload: $shouldPerformDownload, isDialog: $isDialog, windowFeatures: $windowFeatures, windowId: $windowId}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,23 +8,13 @@ part of 'css_link_html_tag_attributes.dart';
|
||||||
|
|
||||||
///Class that represents the possible CSS stylesheet `<link>` HTML attributes to be set used by [InAppWebViewController.injectCSSFileFromUrl].
|
///Class that represents the possible CSS stylesheet `<link>` HTML attributes to be set used by [InAppWebViewController.injectCSSFileFromUrl].
|
||||||
class CSSLinkHtmlTagAttributes {
|
class CSSLinkHtmlTagAttributes {
|
||||||
///The HTML [id] attribute is used to specify a unique id for the `<link>` HTML element.
|
///Specify alternative style sheets.
|
||||||
String? id;
|
bool? alternate;
|
||||||
|
|
||||||
///This attribute specifies the media that the linked resource applies to. Its value must be a media type / media query.
|
|
||||||
///This attribute is mainly useful when linking to external stylesheets — it allows the user agent to pick the best adapted one for the device it runs on.
|
|
||||||
String? media;
|
|
||||||
|
|
||||||
///Normal script elements pass minimal information to the `window.onerror` for scripts which do not pass the standard CORS checks.
|
///Normal script elements pass minimal information to the `window.onerror` for scripts which do not pass the standard CORS checks.
|
||||||
///To allow error logging for sites which use a separate domain for static media, use this attribute.
|
///To allow error logging for sites which use a separate domain for static media, use this attribute.
|
||||||
CrossOrigin? crossOrigin;
|
CrossOrigin? crossOrigin;
|
||||||
|
|
||||||
///This attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected manipulation.
|
|
||||||
String? integrity;
|
|
||||||
|
|
||||||
///Indicates which referrer to send when fetching the script, or resources fetched by the script.
|
|
||||||
ReferrerPolicy? referrerPolicy;
|
|
||||||
|
|
||||||
///The [disabled] Boolean attribute indicates whether or not the described stylesheet should be loaded and applied to the document.
|
///The [disabled] Boolean attribute indicates whether or not the described stylesheet should be loaded and applied to the document.
|
||||||
///If [disabled] is specified in the HTML when it is loaded, the stylesheet will not be loaded during page load.
|
///If [disabled] is specified in the HTML when it is loaded, the stylesheet will not be loaded during page load.
|
||||||
///Instead, the stylesheet will be loaded on-demand, if and when the [disabled] attribute is changed to `false` or removed.
|
///Instead, the stylesheet will be loaded on-demand, if and when the [disabled] attribute is changed to `false` or removed.
|
||||||
|
@ -32,21 +22,31 @@ class CSSLinkHtmlTagAttributes {
|
||||||
///Setting the [disabled] property in the DOM causes the stylesheet to be removed from the document's `DocumentOrShadowRoot.styleSheets` list.
|
///Setting the [disabled] property in the DOM causes the stylesheet to be removed from the document's `DocumentOrShadowRoot.styleSheets` list.
|
||||||
bool? disabled;
|
bool? disabled;
|
||||||
|
|
||||||
///Specify alternative style sheets.
|
///The HTML [id] attribute is used to specify a unique id for the `<link>` HTML element.
|
||||||
bool? alternate;
|
String? id;
|
||||||
|
|
||||||
|
///This attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected manipulation.
|
||||||
|
String? integrity;
|
||||||
|
|
||||||
|
///This attribute specifies the media that the linked resource applies to. Its value must be a media type / media query.
|
||||||
|
///This attribute is mainly useful when linking to external stylesheets — it allows the user agent to pick the best adapted one for the device it runs on.
|
||||||
|
String? media;
|
||||||
|
|
||||||
|
///Indicates which referrer to send when fetching the script, or resources fetched by the script.
|
||||||
|
ReferrerPolicy? referrerPolicy;
|
||||||
|
|
||||||
///The title attribute has special semantics on the `<link>` element.
|
///The title attribute has special semantics on the `<link>` element.
|
||||||
///When used on a `<link rel="stylesheet">` it defines a preferred or an alternate stylesheet.
|
///When used on a `<link rel="stylesheet">` it defines a preferred or an alternate stylesheet.
|
||||||
///Incorrectly using it may cause the stylesheet to be ignored.
|
///Incorrectly using it may cause the stylesheet to be ignored.
|
||||||
String? title;
|
String? title;
|
||||||
CSSLinkHtmlTagAttributes(
|
CSSLinkHtmlTagAttributes(
|
||||||
{this.id,
|
{this.alternate,
|
||||||
this.media,
|
|
||||||
this.crossOrigin,
|
this.crossOrigin,
|
||||||
this.integrity,
|
|
||||||
this.referrerPolicy,
|
|
||||||
this.disabled,
|
this.disabled,
|
||||||
this.alternate,
|
this.id,
|
||||||
|
this.integrity,
|
||||||
|
this.media,
|
||||||
|
this.referrerPolicy,
|
||||||
this.title});
|
this.title});
|
||||||
|
|
||||||
///Gets a possible [CSSLinkHtmlTagAttributes] instance from a [Map] value.
|
///Gets a possible [CSSLinkHtmlTagAttributes] instance from a [Map] value.
|
||||||
|
@ -55,13 +55,13 @@ class CSSLinkHtmlTagAttributes {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = CSSLinkHtmlTagAttributes(
|
final instance = CSSLinkHtmlTagAttributes(
|
||||||
id: map['id'],
|
|
||||||
media: map['media'],
|
|
||||||
crossOrigin: CrossOrigin.fromNativeValue(map['crossOrigin']),
|
|
||||||
integrity: map['integrity'],
|
|
||||||
referrerPolicy: ReferrerPolicy.fromNativeValue(map['referrerPolicy']),
|
|
||||||
disabled: map['disabled'],
|
|
||||||
alternate: map['alternate'],
|
alternate: map['alternate'],
|
||||||
|
crossOrigin: CrossOrigin.fromNativeValue(map['crossOrigin']),
|
||||||
|
disabled: map['disabled'],
|
||||||
|
id: map['id'],
|
||||||
|
integrity: map['integrity'],
|
||||||
|
media: map['media'],
|
||||||
|
referrerPolicy: ReferrerPolicy.fromNativeValue(map['referrerPolicy']),
|
||||||
title: map['title'],
|
title: map['title'],
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -70,13 +70,13 @@ class CSSLinkHtmlTagAttributes {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"id": id,
|
|
||||||
"media": media,
|
|
||||||
"crossOrigin": crossOrigin?.toNativeValue(),
|
|
||||||
"integrity": integrity,
|
|
||||||
"referrerPolicy": referrerPolicy?.toNativeValue(),
|
|
||||||
"disabled": disabled,
|
|
||||||
"alternate": alternate,
|
"alternate": alternate,
|
||||||
|
"crossOrigin": crossOrigin?.toNativeValue(),
|
||||||
|
"disabled": disabled,
|
||||||
|
"id": id,
|
||||||
|
"integrity": integrity,
|
||||||
|
"media": media,
|
||||||
|
"referrerPolicy": referrerPolicy?.toNativeValue(),
|
||||||
"title": title,
|
"title": title,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,6 @@ class CSSLinkHtmlTagAttributes {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'CSSLinkHtmlTagAttributes{id: $id, media: $media, crossOrigin: $crossOrigin, integrity: $integrity, referrerPolicy: $referrerPolicy, disabled: $disabled, alternate: $alternate, title: $title}';
|
return 'CSSLinkHtmlTagAttributes{alternate: $alternate, crossOrigin: $crossOrigin, disabled: $disabled, id: $id, integrity: $integrity, media: $media, referrerPolicy: $referrerPolicy, title: $title}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,18 +9,18 @@ part of 'custom_scheme_response.dart';
|
||||||
///Class representing the response returned by the [WebView.onLoadResourceWithCustomScheme] event.
|
///Class representing the response returned by the [WebView.onLoadResourceWithCustomScheme] event.
|
||||||
///It allows to load a specific resource. The resource data must be encoded to `base64`.
|
///It allows to load a specific resource. The resource data must be encoded to `base64`.
|
||||||
class CustomSchemeResponse {
|
class CustomSchemeResponse {
|
||||||
///Data enconded to 'base64'.
|
///Content-Encoding of the data, such as `utf-8`.
|
||||||
Uint8List data;
|
String contentEncoding;
|
||||||
|
|
||||||
///Content-Type of the data, such as `image/png`.
|
///Content-Type of the data, such as `image/png`.
|
||||||
String contentType;
|
String contentType;
|
||||||
|
|
||||||
///Content-Encoding of the data, such as `utf-8`.
|
///Data enconded to 'base64'.
|
||||||
String contentEncoding;
|
Uint8List data;
|
||||||
CustomSchemeResponse(
|
CustomSchemeResponse(
|
||||||
{required this.data,
|
{this.contentEncoding = 'utf-8',
|
||||||
required this.contentType,
|
required this.contentType,
|
||||||
this.contentEncoding = 'utf-8'});
|
required this.data});
|
||||||
|
|
||||||
///Gets a possible [CustomSchemeResponse] instance from a [Map] value.
|
///Gets a possible [CustomSchemeResponse] instance from a [Map] value.
|
||||||
static CustomSchemeResponse? fromMap(Map<String, dynamic>? map) {
|
static CustomSchemeResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -28,8 +28,8 @@ class CustomSchemeResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = CustomSchemeResponse(
|
final instance = CustomSchemeResponse(
|
||||||
data: map['data'],
|
|
||||||
contentType: map['contentType'],
|
contentType: map['contentType'],
|
||||||
|
data: map['data'],
|
||||||
);
|
);
|
||||||
instance.contentEncoding = map['contentEncoding'];
|
instance.contentEncoding = map['contentEncoding'];
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -38,9 +38,9 @@ class CustomSchemeResponse {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"data": data,
|
|
||||||
"contentType": contentType,
|
|
||||||
"contentEncoding": contentEncoding,
|
"contentEncoding": contentEncoding,
|
||||||
|
"contentType": contentType,
|
||||||
|
"data": data,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,6 @@ class CustomSchemeResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'CustomSchemeResponse{data: $data, contentType: $contentType, contentEncoding: $contentEncoding}';
|
return 'CustomSchemeResponse{contentEncoding: $contentEncoding, contentType: $contentType, data: $data}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,30 +16,15 @@ class CustomTabsNavigationEventType {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
CustomTabsNavigationEventType._internal(value, nativeValue());
|
CustomTabsNavigationEventType._internal(value, nativeValue());
|
||||||
|
|
||||||
///Sent when the tab has started loading a page.
|
///Sent when loading was aborted by a user action before it finishes like clicking on a link or refreshing the page.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
static final STARTED =
|
static final ABORTED =
|
||||||
CustomTabsNavigationEventType._internalMultiPlatform(1, () {
|
CustomTabsNavigationEventType._internalMultiPlatform(4, () {
|
||||||
switch (defaultTargetPlatform) {
|
switch (defaultTargetPlatform) {
|
||||||
case TargetPlatform.android:
|
case TargetPlatform.android:
|
||||||
return 1;
|
return 4;
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
///Sent when the tab has finished loading a page.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
static final FINISHED =
|
|
||||||
CustomTabsNavigationEventType._internalMultiPlatform(2, () {
|
|
||||||
switch (defaultTargetPlatform) {
|
|
||||||
case TargetPlatform.android:
|
|
||||||
return 2;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -61,30 +46,30 @@ class CustomTabsNavigationEventType {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
///Sent when loading was aborted by a user action before it finishes like clicking on a link or refreshing the page.
|
///Sent when the tab has finished loading a page.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
static final ABORTED =
|
static final FINISHED =
|
||||||
CustomTabsNavigationEventType._internalMultiPlatform(4, () {
|
CustomTabsNavigationEventType._internalMultiPlatform(2, () {
|
||||||
switch (defaultTargetPlatform) {
|
switch (defaultTargetPlatform) {
|
||||||
case TargetPlatform.android:
|
case TargetPlatform.android:
|
||||||
return 4;
|
return 2;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
///Sent when the tab becomes visible.
|
///Sent when the tab has started loading a page.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
static final TAB_SHOWN =
|
static final STARTED =
|
||||||
CustomTabsNavigationEventType._internalMultiPlatform(5, () {
|
CustomTabsNavigationEventType._internalMultiPlatform(1, () {
|
||||||
switch (defaultTargetPlatform) {
|
switch (defaultTargetPlatform) {
|
||||||
case TargetPlatform.android:
|
case TargetPlatform.android:
|
||||||
return 5;
|
return 1;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -106,14 +91,29 @@ class CustomTabsNavigationEventType {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
///Sent when the tab becomes visible.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
|
static final TAB_SHOWN =
|
||||||
|
CustomTabsNavigationEventType._internalMultiPlatform(5, () {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.android:
|
||||||
|
return 5;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
///Set of all values of [CustomTabsNavigationEventType].
|
///Set of all values of [CustomTabsNavigationEventType].
|
||||||
static final Set<CustomTabsNavigationEventType> values = [
|
static final Set<CustomTabsNavigationEventType> values = [
|
||||||
CustomTabsNavigationEventType.STARTED,
|
|
||||||
CustomTabsNavigationEventType.FINISHED,
|
|
||||||
CustomTabsNavigationEventType.FAILED,
|
|
||||||
CustomTabsNavigationEventType.ABORTED,
|
CustomTabsNavigationEventType.ABORTED,
|
||||||
CustomTabsNavigationEventType.TAB_SHOWN,
|
CustomTabsNavigationEventType.FAILED,
|
||||||
|
CustomTabsNavigationEventType.FINISHED,
|
||||||
|
CustomTabsNavigationEventType.STARTED,
|
||||||
CustomTabsNavigationEventType.TAB_HIDDEN,
|
CustomTabsNavigationEventType.TAB_HIDDEN,
|
||||||
|
CustomTabsNavigationEventType.TAB_SHOWN,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [CustomTabsNavigationEventType] instance from [int] value.
|
///Gets a possible [CustomTabsNavigationEventType] instance from [int] value.
|
||||||
|
@ -157,18 +157,18 @@ class CustomTabsNavigationEventType {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 1:
|
|
||||||
return 'STARTED';
|
|
||||||
case 2:
|
|
||||||
return 'FINISHED';
|
|
||||||
case 3:
|
|
||||||
return 'FAILED';
|
|
||||||
case 4:
|
case 4:
|
||||||
return 'ABORTED';
|
return 'ABORTED';
|
||||||
case 5:
|
case 3:
|
||||||
return 'TAB_SHOWN';
|
return 'FAILED';
|
||||||
|
case 2:
|
||||||
|
return 'FINISHED';
|
||||||
|
case 1:
|
||||||
|
return 'STARTED';
|
||||||
case 6:
|
case 6:
|
||||||
return 'TAB_HIDDEN';
|
return 'TAB_HIDDEN';
|
||||||
|
case 5:
|
||||||
|
return 'TAB_SHOWN';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,21 +16,6 @@ class CustomTabsRelationType {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
CustomTabsRelationType._internal(value, nativeValue());
|
CustomTabsRelationType._internal(value, nativeValue());
|
||||||
|
|
||||||
///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**:
|
|
||||||
///- Android native WebView
|
|
||||||
static final USE_AS_ORIGIN =
|
|
||||||
CustomTabsRelationType._internalMultiPlatform(1, () {
|
|
||||||
switch (defaultTargetPlatform) {
|
|
||||||
case TargetPlatform.android:
|
|
||||||
return 1;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
///Requests the ability to handle all URLs from a given origin.
|
///Requests the ability to handle all URLs from a given origin.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -46,10 +31,25 @@ class CustomTabsRelationType {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
///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**:
|
||||||
|
///- Android native WebView
|
||||||
|
static final USE_AS_ORIGIN =
|
||||||
|
CustomTabsRelationType._internalMultiPlatform(1, () {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.android:
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
///Set of all values of [CustomTabsRelationType].
|
///Set of all values of [CustomTabsRelationType].
|
||||||
static final Set<CustomTabsRelationType> values = [
|
static final Set<CustomTabsRelationType> values = [
|
||||||
CustomTabsRelationType.USE_AS_ORIGIN,
|
|
||||||
CustomTabsRelationType.HANDLE_ALL_URLS,
|
CustomTabsRelationType.HANDLE_ALL_URLS,
|
||||||
|
CustomTabsRelationType.USE_AS_ORIGIN,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [CustomTabsRelationType] instance from [int] value.
|
///Gets a possible [CustomTabsRelationType] instance from [int] value.
|
||||||
|
@ -93,10 +93,10 @@ class CustomTabsRelationType {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 1:
|
|
||||||
return 'USE_AS_ORIGIN';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'HANDLE_ALL_URLS';
|
return 'HANDLE_ALL_URLS';
|
||||||
|
case 1:
|
||||||
|
return 'USE_AS_ORIGIN';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,17 +19,17 @@ class CustomTabsShareState {
|
||||||
///Applies the default share settings depending on the browser.
|
///Applies the default share settings depending on the browser.
|
||||||
static const SHARE_STATE_DEFAULT = CustomTabsShareState._internal(0, 0);
|
static const SHARE_STATE_DEFAULT = CustomTabsShareState._internal(0, 0);
|
||||||
|
|
||||||
///Shows a share option in the tab.
|
|
||||||
static const SHARE_STATE_ON = CustomTabsShareState._internal(1, 1);
|
|
||||||
|
|
||||||
///Explicitly does not show a share option in the tab.
|
///Explicitly does not show a share option in the tab.
|
||||||
static const SHARE_STATE_OFF = CustomTabsShareState._internal(2, 2);
|
static const SHARE_STATE_OFF = CustomTabsShareState._internal(2, 2);
|
||||||
|
|
||||||
|
///Shows a share option in the tab.
|
||||||
|
static const SHARE_STATE_ON = CustomTabsShareState._internal(1, 1);
|
||||||
|
|
||||||
///Set of all values of [CustomTabsShareState].
|
///Set of all values of [CustomTabsShareState].
|
||||||
static final Set<CustomTabsShareState> values = [
|
static final Set<CustomTabsShareState> values = [
|
||||||
CustomTabsShareState.SHARE_STATE_DEFAULT,
|
CustomTabsShareState.SHARE_STATE_DEFAULT,
|
||||||
CustomTabsShareState.SHARE_STATE_ON,
|
|
||||||
CustomTabsShareState.SHARE_STATE_OFF,
|
CustomTabsShareState.SHARE_STATE_OFF,
|
||||||
|
CustomTabsShareState.SHARE_STATE_ON,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [CustomTabsShareState] instance from [int] value.
|
///Gets a possible [CustomTabsShareState] instance from [int] value.
|
||||||
|
@ -75,10 +75,10 @@ class CustomTabsShareState {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 0:
|
||||||
return 'SHARE_STATE_DEFAULT';
|
return 'SHARE_STATE_DEFAULT';
|
||||||
case 1:
|
|
||||||
return 'SHARE_STATE_ON';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'SHARE_STATE_OFF';
|
return 'SHARE_STATE_OFF';
|
||||||
|
case 1:
|
||||||
|
return 'SHARE_STATE_ON';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,27 @@ class DataDetectorTypes {
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
DataDetectorTypes._internal(value, nativeValue());
|
DataDetectorTypes._internal(value, nativeValue());
|
||||||
|
|
||||||
|
///Addresses are detected and turned into links.
|
||||||
|
static const ADDRESS = DataDetectorTypes._internal('ADDRESS', 'ADDRESS');
|
||||||
|
|
||||||
|
///All of the above data types are turned into links when detected. Choosing this value will automatically include any new detection type that is added.
|
||||||
|
static const ALL = DataDetectorTypes._internal('ALL', 'ALL');
|
||||||
|
|
||||||
|
///Dates and times that are in the future are detected and turned into links.
|
||||||
|
static const CALENDAR_EVENT =
|
||||||
|
DataDetectorTypes._internal('CALENDAR_EVENT', 'CALENDAR_EVENT');
|
||||||
|
|
||||||
|
///Flight numbers are detected and turned into links.
|
||||||
|
static const FLIGHT_NUMBER =
|
||||||
|
DataDetectorTypes._internal('FLIGHT_NUMBER', 'FLIGHT_NUMBER');
|
||||||
|
|
||||||
|
///URLs in text are detected and turned into links.
|
||||||
|
static const LINK = DataDetectorTypes._internal('LINK', 'LINK');
|
||||||
|
|
||||||
|
///Lookup suggestions are detected and turned into links.
|
||||||
|
static const LOOKUP_SUGGESTION =
|
||||||
|
DataDetectorTypes._internal('LOOKUP_SUGGESTION', 'LOOKUP_SUGGESTION');
|
||||||
|
|
||||||
///No detection is performed.
|
///No detection is performed.
|
||||||
static const NONE = DataDetectorTypes._internal('NONE', 'NONE');
|
static const NONE = DataDetectorTypes._internal('NONE', 'NONE');
|
||||||
|
|
||||||
|
@ -23,47 +44,26 @@ class DataDetectorTypes {
|
||||||
static const PHONE_NUMBER =
|
static const PHONE_NUMBER =
|
||||||
DataDetectorTypes._internal('PHONE_NUMBER', 'PHONE_NUMBER');
|
DataDetectorTypes._internal('PHONE_NUMBER', 'PHONE_NUMBER');
|
||||||
|
|
||||||
///URLs in text are detected and turned into links.
|
///Spotlight suggestions are detected and turned into links.
|
||||||
static const LINK = DataDetectorTypes._internal('LINK', 'LINK');
|
static const SPOTLIGHT_SUGGESTION = DataDetectorTypes._internal(
|
||||||
|
'SPOTLIGHT_SUGGESTION', 'SPOTLIGHT_SUGGESTION');
|
||||||
///Addresses are detected and turned into links.
|
|
||||||
static const ADDRESS = DataDetectorTypes._internal('ADDRESS', 'ADDRESS');
|
|
||||||
|
|
||||||
///Dates and times that are in the future are detected and turned into links.
|
|
||||||
static const CALENDAR_EVENT =
|
|
||||||
DataDetectorTypes._internal('CALENDAR_EVENT', 'CALENDAR_EVENT');
|
|
||||||
|
|
||||||
///Tracking numbers are detected and turned into links.
|
///Tracking numbers are detected and turned into links.
|
||||||
static const TRACKING_NUMBER =
|
static const TRACKING_NUMBER =
|
||||||
DataDetectorTypes._internal('TRACKING_NUMBER', 'TRACKING_NUMBER');
|
DataDetectorTypes._internal('TRACKING_NUMBER', 'TRACKING_NUMBER');
|
||||||
|
|
||||||
///Flight numbers are detected and turned into links.
|
|
||||||
static const FLIGHT_NUMBER =
|
|
||||||
DataDetectorTypes._internal('FLIGHT_NUMBER', 'FLIGHT_NUMBER');
|
|
||||||
|
|
||||||
///Lookup suggestions are detected and turned into links.
|
|
||||||
static const LOOKUP_SUGGESTION =
|
|
||||||
DataDetectorTypes._internal('LOOKUP_SUGGESTION', 'LOOKUP_SUGGESTION');
|
|
||||||
|
|
||||||
///Spotlight suggestions are detected and turned into links.
|
|
||||||
static const SPOTLIGHT_SUGGESTION = DataDetectorTypes._internal(
|
|
||||||
'SPOTLIGHT_SUGGESTION', 'SPOTLIGHT_SUGGESTION');
|
|
||||||
|
|
||||||
///All of the above data types are turned into links when detected. Choosing this value will automatically include any new detection type that is added.
|
|
||||||
static const ALL = DataDetectorTypes._internal('ALL', 'ALL');
|
|
||||||
|
|
||||||
///Set of all values of [DataDetectorTypes].
|
///Set of all values of [DataDetectorTypes].
|
||||||
static final Set<DataDetectorTypes> values = [
|
static final Set<DataDetectorTypes> values = [
|
||||||
|
DataDetectorTypes.ADDRESS,
|
||||||
|
DataDetectorTypes.ALL,
|
||||||
|
DataDetectorTypes.CALENDAR_EVENT,
|
||||||
|
DataDetectorTypes.FLIGHT_NUMBER,
|
||||||
|
DataDetectorTypes.LINK,
|
||||||
|
DataDetectorTypes.LOOKUP_SUGGESTION,
|
||||||
DataDetectorTypes.NONE,
|
DataDetectorTypes.NONE,
|
||||||
DataDetectorTypes.PHONE_NUMBER,
|
DataDetectorTypes.PHONE_NUMBER,
|
||||||
DataDetectorTypes.LINK,
|
|
||||||
DataDetectorTypes.ADDRESS,
|
|
||||||
DataDetectorTypes.CALENDAR_EVENT,
|
|
||||||
DataDetectorTypes.TRACKING_NUMBER,
|
|
||||||
DataDetectorTypes.FLIGHT_NUMBER,
|
|
||||||
DataDetectorTypes.LOOKUP_SUGGESTION,
|
|
||||||
DataDetectorTypes.SPOTLIGHT_SUGGESTION,
|
DataDetectorTypes.SPOTLIGHT_SUGGESTION,
|
||||||
DataDetectorTypes.ALL,
|
DataDetectorTypes.TRACKING_NUMBER,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [DataDetectorTypes] instance from [String] value.
|
///Gets a possible [DataDetectorTypes] instance from [String] value.
|
||||||
|
@ -125,6 +125,27 @@ class IOSWKDataDetectorTypes {
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
IOSWKDataDetectorTypes._internal(value, nativeValue());
|
IOSWKDataDetectorTypes._internal(value, nativeValue());
|
||||||
|
|
||||||
|
///Addresses are detected and turned into links.
|
||||||
|
static const ADDRESS = IOSWKDataDetectorTypes._internal('ADDRESS', 'ADDRESS');
|
||||||
|
|
||||||
|
///All of the above data types are turned into links when detected. Choosing this value will automatically include any new detection type that is added.
|
||||||
|
static const ALL = IOSWKDataDetectorTypes._internal('ALL', 'ALL');
|
||||||
|
|
||||||
|
///Dates and times that are in the future are detected and turned into links.
|
||||||
|
static const CALENDAR_EVENT =
|
||||||
|
IOSWKDataDetectorTypes._internal('CALENDAR_EVENT', 'CALENDAR_EVENT');
|
||||||
|
|
||||||
|
///Flight numbers are detected and turned into links.
|
||||||
|
static const FLIGHT_NUMBER =
|
||||||
|
IOSWKDataDetectorTypes._internal('FLIGHT_NUMBER', 'FLIGHT_NUMBER');
|
||||||
|
|
||||||
|
///URLs in text are detected and turned into links.
|
||||||
|
static const LINK = IOSWKDataDetectorTypes._internal('LINK', 'LINK');
|
||||||
|
|
||||||
|
///Lookup suggestions are detected and turned into links.
|
||||||
|
static const LOOKUP_SUGGESTION = IOSWKDataDetectorTypes._internal(
|
||||||
|
'LOOKUP_SUGGESTION', 'LOOKUP_SUGGESTION');
|
||||||
|
|
||||||
///No detection is performed.
|
///No detection is performed.
|
||||||
static const NONE = IOSWKDataDetectorTypes._internal('NONE', 'NONE');
|
static const NONE = IOSWKDataDetectorTypes._internal('NONE', 'NONE');
|
||||||
|
|
||||||
|
@ -132,47 +153,26 @@ class IOSWKDataDetectorTypes {
|
||||||
static const PHONE_NUMBER =
|
static const PHONE_NUMBER =
|
||||||
IOSWKDataDetectorTypes._internal('PHONE_NUMBER', 'PHONE_NUMBER');
|
IOSWKDataDetectorTypes._internal('PHONE_NUMBER', 'PHONE_NUMBER');
|
||||||
|
|
||||||
///URLs in text are detected and turned into links.
|
///Spotlight suggestions are detected and turned into links.
|
||||||
static const LINK = IOSWKDataDetectorTypes._internal('LINK', 'LINK');
|
static const SPOTLIGHT_SUGGESTION = IOSWKDataDetectorTypes._internal(
|
||||||
|
'SPOTLIGHT_SUGGESTION', 'SPOTLIGHT_SUGGESTION');
|
||||||
///Addresses are detected and turned into links.
|
|
||||||
static const ADDRESS = IOSWKDataDetectorTypes._internal('ADDRESS', 'ADDRESS');
|
|
||||||
|
|
||||||
///Dates and times that are in the future are detected and turned into links.
|
|
||||||
static const CALENDAR_EVENT =
|
|
||||||
IOSWKDataDetectorTypes._internal('CALENDAR_EVENT', 'CALENDAR_EVENT');
|
|
||||||
|
|
||||||
///Tracking numbers are detected and turned into links.
|
///Tracking numbers are detected and turned into links.
|
||||||
static const TRACKING_NUMBER =
|
static const TRACKING_NUMBER =
|
||||||
IOSWKDataDetectorTypes._internal('TRACKING_NUMBER', 'TRACKING_NUMBER');
|
IOSWKDataDetectorTypes._internal('TRACKING_NUMBER', 'TRACKING_NUMBER');
|
||||||
|
|
||||||
///Flight numbers are detected and turned into links.
|
|
||||||
static const FLIGHT_NUMBER =
|
|
||||||
IOSWKDataDetectorTypes._internal('FLIGHT_NUMBER', 'FLIGHT_NUMBER');
|
|
||||||
|
|
||||||
///Lookup suggestions are detected and turned into links.
|
|
||||||
static const LOOKUP_SUGGESTION = IOSWKDataDetectorTypes._internal(
|
|
||||||
'LOOKUP_SUGGESTION', 'LOOKUP_SUGGESTION');
|
|
||||||
|
|
||||||
///Spotlight suggestions are detected and turned into links.
|
|
||||||
static const SPOTLIGHT_SUGGESTION = IOSWKDataDetectorTypes._internal(
|
|
||||||
'SPOTLIGHT_SUGGESTION', 'SPOTLIGHT_SUGGESTION');
|
|
||||||
|
|
||||||
///All of the above data types are turned into links when detected. Choosing this value will automatically include any new detection type that is added.
|
|
||||||
static const ALL = IOSWKDataDetectorTypes._internal('ALL', 'ALL');
|
|
||||||
|
|
||||||
///Set of all values of [IOSWKDataDetectorTypes].
|
///Set of all values of [IOSWKDataDetectorTypes].
|
||||||
static final Set<IOSWKDataDetectorTypes> values = [
|
static final Set<IOSWKDataDetectorTypes> values = [
|
||||||
|
IOSWKDataDetectorTypes.ADDRESS,
|
||||||
|
IOSWKDataDetectorTypes.ALL,
|
||||||
|
IOSWKDataDetectorTypes.CALENDAR_EVENT,
|
||||||
|
IOSWKDataDetectorTypes.FLIGHT_NUMBER,
|
||||||
|
IOSWKDataDetectorTypes.LINK,
|
||||||
|
IOSWKDataDetectorTypes.LOOKUP_SUGGESTION,
|
||||||
IOSWKDataDetectorTypes.NONE,
|
IOSWKDataDetectorTypes.NONE,
|
||||||
IOSWKDataDetectorTypes.PHONE_NUMBER,
|
IOSWKDataDetectorTypes.PHONE_NUMBER,
|
||||||
IOSWKDataDetectorTypes.LINK,
|
|
||||||
IOSWKDataDetectorTypes.ADDRESS,
|
|
||||||
IOSWKDataDetectorTypes.CALENDAR_EVENT,
|
|
||||||
IOSWKDataDetectorTypes.TRACKING_NUMBER,
|
|
||||||
IOSWKDataDetectorTypes.FLIGHT_NUMBER,
|
|
||||||
IOSWKDataDetectorTypes.LOOKUP_SUGGESTION,
|
|
||||||
IOSWKDataDetectorTypes.SPOTLIGHT_SUGGESTION,
|
IOSWKDataDetectorTypes.SPOTLIGHT_SUGGESTION,
|
||||||
IOSWKDataDetectorTypes.ALL,
|
IOSWKDataDetectorTypes.TRACKING_NUMBER,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [IOSWKDataDetectorTypes] instance from [String] value.
|
///Gets a possible [IOSWKDataDetectorTypes] instance from [String] value.
|
||||||
|
|
|
@ -16,20 +16,20 @@ class DismissButtonStyle {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
DismissButtonStyle._internal(value, nativeValue());
|
DismissButtonStyle._internal(value, nativeValue());
|
||||||
|
|
||||||
///Makes the button title the localized string "Done".
|
///Makes the button title the localized string "Cancel".
|
||||||
static const DONE = DismissButtonStyle._internal(0, 0);
|
static const CANCEL = DismissButtonStyle._internal(2, 2);
|
||||||
|
|
||||||
///Makes the button title the localized string "Close".
|
///Makes the button title the localized string "Close".
|
||||||
static const CLOSE = DismissButtonStyle._internal(1, 1);
|
static const CLOSE = DismissButtonStyle._internal(1, 1);
|
||||||
|
|
||||||
///Makes the button title the localized string "Cancel".
|
///Makes the button title the localized string "Done".
|
||||||
static const CANCEL = DismissButtonStyle._internal(2, 2);
|
static const DONE = DismissButtonStyle._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [DismissButtonStyle].
|
///Set of all values of [DismissButtonStyle].
|
||||||
static final Set<DismissButtonStyle> values = [
|
static final Set<DismissButtonStyle> values = [
|
||||||
DismissButtonStyle.DONE,
|
|
||||||
DismissButtonStyle.CLOSE,
|
|
||||||
DismissButtonStyle.CANCEL,
|
DismissButtonStyle.CANCEL,
|
||||||
|
DismissButtonStyle.CLOSE,
|
||||||
|
DismissButtonStyle.DONE,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [DismissButtonStyle] instance from [int] value.
|
///Gets a possible [DismissButtonStyle] instance from [int] value.
|
||||||
|
@ -73,12 +73,12 @@ class DismissButtonStyle {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'DONE';
|
|
||||||
case 1:
|
|
||||||
return 'CLOSE';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'CANCEL';
|
return 'CANCEL';
|
||||||
|
case 1:
|
||||||
|
return 'CLOSE';
|
||||||
|
case 0:
|
||||||
|
return 'DONE';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
@ -99,20 +99,20 @@ class IOSSafariDismissButtonStyle {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
IOSSafariDismissButtonStyle._internal(value, nativeValue());
|
IOSSafariDismissButtonStyle._internal(value, nativeValue());
|
||||||
|
|
||||||
///Makes the button title the localized string "Done".
|
///Makes the button title the localized string "Cancel".
|
||||||
static const DONE = IOSSafariDismissButtonStyle._internal(0, 0);
|
static const CANCEL = IOSSafariDismissButtonStyle._internal(2, 2);
|
||||||
|
|
||||||
///Makes the button title the localized string "Close".
|
///Makes the button title the localized string "Close".
|
||||||
static const CLOSE = IOSSafariDismissButtonStyle._internal(1, 1);
|
static const CLOSE = IOSSafariDismissButtonStyle._internal(1, 1);
|
||||||
|
|
||||||
///Makes the button title the localized string "Cancel".
|
///Makes the button title the localized string "Done".
|
||||||
static const CANCEL = IOSSafariDismissButtonStyle._internal(2, 2);
|
static const DONE = IOSSafariDismissButtonStyle._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [IOSSafariDismissButtonStyle].
|
///Set of all values of [IOSSafariDismissButtonStyle].
|
||||||
static final Set<IOSSafariDismissButtonStyle> values = [
|
static final Set<IOSSafariDismissButtonStyle> values = [
|
||||||
IOSSafariDismissButtonStyle.DONE,
|
|
||||||
IOSSafariDismissButtonStyle.CLOSE,
|
|
||||||
IOSSafariDismissButtonStyle.CANCEL,
|
IOSSafariDismissButtonStyle.CANCEL,
|
||||||
|
IOSSafariDismissButtonStyle.CLOSE,
|
||||||
|
IOSSafariDismissButtonStyle.DONE,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [IOSSafariDismissButtonStyle] instance from [int] value.
|
///Gets a possible [IOSSafariDismissButtonStyle] instance from [int] value.
|
||||||
|
@ -156,12 +156,12 @@ class IOSSafariDismissButtonStyle {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'DONE';
|
|
||||||
case 1:
|
|
||||||
return 'CLOSE';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'CANCEL';
|
return 'CANCEL';
|
||||||
|
case 1:
|
||||||
|
return 'CLOSE';
|
||||||
|
case 0:
|
||||||
|
return 'DONE';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,34 +8,34 @@ part of 'download_start_request.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 [WebView.onDownloadStartRequest].
|
||||||
class DownloadStartRequest {
|
class DownloadStartRequest {
|
||||||
///The full url to the content that should be downloaded.
|
|
||||||
WebUri url;
|
|
||||||
|
|
||||||
///the user agent to be used for the download.
|
|
||||||
String? userAgent;
|
|
||||||
|
|
||||||
///Content-disposition http header, if present.
|
///Content-disposition http header, if present.
|
||||||
String? contentDisposition;
|
String? contentDisposition;
|
||||||
|
|
||||||
///The mimetype of the content reported by the server.
|
|
||||||
String? mimeType;
|
|
||||||
|
|
||||||
///The file size reported by the server.
|
///The file size reported by the server.
|
||||||
int contentLength;
|
int contentLength;
|
||||||
|
|
||||||
|
///The mimetype of the content reported by the server.
|
||||||
|
String? mimeType;
|
||||||
|
|
||||||
///A suggested filename to use if saving the resource to disk.
|
///A suggested filename to use if saving the resource to disk.
|
||||||
String? suggestedFilename;
|
String? suggestedFilename;
|
||||||
|
|
||||||
///The name of the text encoding of the receiver, or `null` if no text encoding was specified.
|
///The name of the text encoding of the receiver, or `null` if no text encoding was specified.
|
||||||
String? textEncodingName;
|
String? textEncodingName;
|
||||||
|
|
||||||
|
///The full url to the content that should be downloaded.
|
||||||
|
WebUri url;
|
||||||
|
|
||||||
|
///the user agent to be used for the download.
|
||||||
|
String? userAgent;
|
||||||
DownloadStartRequest(
|
DownloadStartRequest(
|
||||||
{required this.url,
|
{this.contentDisposition,
|
||||||
this.userAgent,
|
|
||||||
this.contentDisposition,
|
|
||||||
this.mimeType,
|
|
||||||
required this.contentLength,
|
required this.contentLength,
|
||||||
|
this.mimeType,
|
||||||
this.suggestedFilename,
|
this.suggestedFilename,
|
||||||
this.textEncodingName});
|
this.textEncodingName,
|
||||||
|
required this.url,
|
||||||
|
this.userAgent});
|
||||||
|
|
||||||
///Gets a possible [DownloadStartRequest] instance from a [Map] value.
|
///Gets a possible [DownloadStartRequest] instance from a [Map] value.
|
||||||
static DownloadStartRequest? fromMap(Map<String, dynamic>? map) {
|
static DownloadStartRequest? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -43,13 +43,13 @@ class DownloadStartRequest {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = DownloadStartRequest(
|
final instance = DownloadStartRequest(
|
||||||
url: WebUri(map['url']),
|
|
||||||
userAgent: map['userAgent'],
|
|
||||||
contentDisposition: map['contentDisposition'],
|
contentDisposition: map['contentDisposition'],
|
||||||
mimeType: map['mimeType'],
|
|
||||||
contentLength: map['contentLength'],
|
contentLength: map['contentLength'],
|
||||||
|
mimeType: map['mimeType'],
|
||||||
suggestedFilename: map['suggestedFilename'],
|
suggestedFilename: map['suggestedFilename'],
|
||||||
textEncodingName: map['textEncodingName'],
|
textEncodingName: map['textEncodingName'],
|
||||||
|
url: WebUri(map['url']),
|
||||||
|
userAgent: map['userAgent'],
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -57,13 +57,13 @@ class DownloadStartRequest {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"url": url.toString(),
|
|
||||||
"userAgent": userAgent,
|
|
||||||
"contentDisposition": contentDisposition,
|
"contentDisposition": contentDisposition,
|
||||||
"mimeType": mimeType,
|
|
||||||
"contentLength": contentLength,
|
"contentLength": contentLength,
|
||||||
|
"mimeType": mimeType,
|
||||||
"suggestedFilename": suggestedFilename,
|
"suggestedFilename": suggestedFilename,
|
||||||
"textEncodingName": textEncodingName,
|
"textEncodingName": textEncodingName,
|
||||||
|
"url": url.toString(),
|
||||||
|
"userAgent": userAgent,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +74,6 @@ class DownloadStartRequest {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'DownloadStartRequest{url: $url, userAgent: $userAgent, contentDisposition: $contentDisposition, mimeType: $mimeType, contentLength: $contentLength, suggestedFilename: $suggestedFilename, textEncodingName: $textEncodingName}';
|
return 'DownloadStartRequest{contentDisposition: $contentDisposition, contentLength: $contentLength, mimeType: $mimeType, suggestedFilename: $suggestedFilename, textEncodingName: $textEncodingName, url: $url, userAgent: $userAgent}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,18 +8,18 @@ part of 'favicon.dart';
|
||||||
|
|
||||||
///Class that represents a favicon of a website. It is used by [InAppWebViewController.getFavicons] method.
|
///Class that represents a favicon of a website. It is used by [InAppWebViewController.getFavicons] method.
|
||||||
class Favicon {
|
class Favicon {
|
||||||
///The url of the favicon image.
|
///The height of the favicon image.
|
||||||
WebUri url;
|
int? height;
|
||||||
|
|
||||||
///The relationship between the current web page and the favicon image.
|
///The relationship between the current web page and the favicon image.
|
||||||
String? rel;
|
String? rel;
|
||||||
|
|
||||||
|
///The url of the favicon image.
|
||||||
|
WebUri url;
|
||||||
|
|
||||||
///The width of the favicon image.
|
///The width of the favicon image.
|
||||||
int? width;
|
int? width;
|
||||||
|
Favicon({this.height, this.rel, required this.url, this.width});
|
||||||
///The height of the favicon image.
|
|
||||||
int? height;
|
|
||||||
Favicon({required this.url, this.rel, this.width, this.height});
|
|
||||||
|
|
||||||
///Gets a possible [Favicon] instance from a [Map] value.
|
///Gets a possible [Favicon] instance from a [Map] value.
|
||||||
static Favicon? fromMap(Map<String, dynamic>? map) {
|
static Favicon? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -27,10 +27,10 @@ class Favicon {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = Favicon(
|
final instance = Favicon(
|
||||||
url: WebUri(map['url']),
|
|
||||||
rel: map['rel'],
|
|
||||||
width: map['width'],
|
|
||||||
height: map['height'],
|
height: map['height'],
|
||||||
|
rel: map['rel'],
|
||||||
|
url: WebUri(map['url']),
|
||||||
|
width: map['width'],
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -38,10 +38,10 @@ class Favicon {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"url": url.toString(),
|
|
||||||
"rel": rel,
|
|
||||||
"width": width,
|
|
||||||
"height": height,
|
"height": height,
|
||||||
|
"rel": rel,
|
||||||
|
"url": url.toString(),
|
||||||
|
"width": width,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +52,6 @@ class Favicon {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'Favicon{url: $url, rel: $rel, width: $width, height: $height}';
|
return 'Favicon{height: $height, rel: $rel, url: $url, width: $width}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,26 +8,32 @@ part of 'fetch_request.dart';
|
||||||
|
|
||||||
///Class that represents a HTTP request created with JavaScript using the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch).
|
///Class that represents a HTTP request created with JavaScript using the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch).
|
||||||
class FetchRequest {
|
class FetchRequest {
|
||||||
///The URL of the request.
|
///Indicates the [FetchRequestAction] that can be used to control the request.
|
||||||
WebUri? url;
|
FetchRequestAction? action;
|
||||||
|
|
||||||
///The HTTP request method used of the request.
|
|
||||||
String? method;
|
|
||||||
|
|
||||||
///The HTTP request headers.
|
|
||||||
Map<String, dynamic>? headers;
|
|
||||||
|
|
||||||
///Body of the request.
|
///Body of the request.
|
||||||
dynamic body;
|
dynamic body;
|
||||||
|
|
||||||
///The mode used by the request.
|
///The cache mode used by the request.
|
||||||
String? mode;
|
String? cache;
|
||||||
|
|
||||||
///The request credentials used by the request.
|
///The request credentials used by the request.
|
||||||
FetchRequestCredential? credentials;
|
FetchRequestCredential? credentials;
|
||||||
|
|
||||||
///The cache mode used by the request.
|
///The HTTP request headers.
|
||||||
String? cache;
|
Map<String, dynamic>? headers;
|
||||||
|
|
||||||
|
///Contains the subresource integrity value of the request.
|
||||||
|
String? integrity;
|
||||||
|
|
||||||
|
///The keepalive option used to allow the request to outlive the page.
|
||||||
|
bool? keepalive;
|
||||||
|
|
||||||
|
///The HTTP request method used of the request.
|
||||||
|
String? method;
|
||||||
|
|
||||||
|
///The mode used by the request.
|
||||||
|
String? mode;
|
||||||
|
|
||||||
///The redirect mode used by the request.
|
///The redirect mode used by the request.
|
||||||
String? redirect;
|
String? redirect;
|
||||||
|
@ -38,28 +44,22 @@ class FetchRequest {
|
||||||
///The value of the referer HTTP header.
|
///The value of the referer HTTP header.
|
||||||
ReferrerPolicy? referrerPolicy;
|
ReferrerPolicy? referrerPolicy;
|
||||||
|
|
||||||
///Contains the subresource integrity value of the request.
|
///The URL of the request.
|
||||||
String? integrity;
|
WebUri? url;
|
||||||
|
|
||||||
///The keepalive option used to allow the request to outlive the page.
|
|
||||||
bool? keepalive;
|
|
||||||
|
|
||||||
///Indicates the [FetchRequestAction] that can be used to control the request.
|
|
||||||
FetchRequestAction? action;
|
|
||||||
FetchRequest(
|
FetchRequest(
|
||||||
{this.url,
|
{this.action = FetchRequestAction.PROCEED,
|
||||||
this.method,
|
|
||||||
this.headers,
|
|
||||||
this.body,
|
this.body,
|
||||||
this.mode,
|
|
||||||
this.credentials,
|
|
||||||
this.cache,
|
this.cache,
|
||||||
|
this.credentials,
|
||||||
|
this.headers,
|
||||||
|
this.integrity,
|
||||||
|
this.keepalive,
|
||||||
|
this.method,
|
||||||
|
this.mode,
|
||||||
this.redirect,
|
this.redirect,
|
||||||
this.referrer,
|
this.referrer,
|
||||||
this.referrerPolicy,
|
this.referrerPolicy,
|
||||||
this.integrity,
|
this.url});
|
||||||
this.keepalive,
|
|
||||||
this.action = FetchRequestAction.PROCEED});
|
|
||||||
|
|
||||||
///Gets a possible [FetchRequest] instance from a [Map] value.
|
///Gets a possible [FetchRequest] instance from a [Map] value.
|
||||||
static FetchRequest? fromMap(Map<String, dynamic>? map) {
|
static FetchRequest? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -67,18 +67,18 @@ class FetchRequest {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = FetchRequest(
|
final instance = FetchRequest(
|
||||||
url: map['url'] != null ? WebUri(map['url']) : null,
|
|
||||||
method: map['method'],
|
|
||||||
headers: map['headers']?.cast<String, dynamic>(),
|
|
||||||
body: map['body'],
|
body: map['body'],
|
||||||
mode: map['mode'],
|
|
||||||
credentials: _fetchRequestCredentialDeserializer(map['credentials']),
|
|
||||||
cache: map['cache'],
|
cache: map['cache'],
|
||||||
|
credentials: _fetchRequestCredentialDeserializer(map['credentials']),
|
||||||
|
headers: map['headers']?.cast<String, dynamic>(),
|
||||||
|
integrity: map['integrity'],
|
||||||
|
keepalive: map['keepalive'],
|
||||||
|
method: map['method'],
|
||||||
|
mode: map['mode'],
|
||||||
redirect: map['redirect'],
|
redirect: map['redirect'],
|
||||||
referrer: map['referrer'],
|
referrer: map['referrer'],
|
||||||
referrerPolicy: ReferrerPolicy.fromNativeValue(map['referrerPolicy']),
|
referrerPolicy: ReferrerPolicy.fromNativeValue(map['referrerPolicy']),
|
||||||
integrity: map['integrity'],
|
url: map['url'] != null ? WebUri(map['url']) : null,
|
||||||
keepalive: map['keepalive'],
|
|
||||||
);
|
);
|
||||||
instance.action = FetchRequestAction.fromNativeValue(map['action']);
|
instance.action = FetchRequestAction.fromNativeValue(map['action']);
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -87,19 +87,19 @@ class FetchRequest {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"url": url?.toString(),
|
"action": action?.toNativeValue(),
|
||||||
"method": method,
|
|
||||||
"headers": headers,
|
|
||||||
"body": body,
|
"body": body,
|
||||||
"mode": mode,
|
|
||||||
"credentials": credentials?.toMap(),
|
|
||||||
"cache": cache,
|
"cache": cache,
|
||||||
|
"credentials": credentials?.toMap(),
|
||||||
|
"headers": headers,
|
||||||
|
"integrity": integrity,
|
||||||
|
"keepalive": keepalive,
|
||||||
|
"method": method,
|
||||||
|
"mode": mode,
|
||||||
"redirect": redirect,
|
"redirect": redirect,
|
||||||
"referrer": referrer,
|
"referrer": referrer,
|
||||||
"referrerPolicy": referrerPolicy?.toNativeValue(),
|
"referrerPolicy": referrerPolicy?.toNativeValue(),
|
||||||
"integrity": integrity,
|
"url": url?.toString(),
|
||||||
"keepalive": keepalive,
|
|
||||||
"action": action?.toNativeValue(),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +110,6 @@ class FetchRequest {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'FetchRequest{url: $url, method: $method, headers: $headers, body: $body, mode: $mode, credentials: $credentials, cache: $cache, redirect: $redirect, referrer: $referrer, referrerPolicy: $referrerPolicy, integrity: $integrity, keepalive: $keepalive, action: $action}';
|
return 'FetchRequest{action: $action, body: $body, cache: $cache, credentials: $credentials, headers: $headers, integrity: $integrity, keepalive: $keepalive, method: $method, mode: $mode, redirect: $redirect, referrer: $referrer, referrerPolicy: $referrerPolicy, url: $url}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,9 @@ part of 'fetch_request_federated_credential.dart';
|
||||||
|
|
||||||
///Class that represents a [FederatedCredential](https://developer.mozilla.org/en-US/docs/Web/API/FederatedCredential) type of credentials.
|
///Class that represents a [FederatedCredential](https://developer.mozilla.org/en-US/docs/Web/API/FederatedCredential) type of credentials.
|
||||||
class FetchRequestFederatedCredential extends FetchRequestCredential {
|
class FetchRequestFederatedCredential extends FetchRequestCredential {
|
||||||
|
///URL pointing to an image for an icon. This image is intended for display in a credential chooser. The URL must be accessible without authentication.
|
||||||
|
WebUri? iconURL;
|
||||||
|
|
||||||
///Credential's identifier.
|
///Credential's identifier.
|
||||||
dynamic id;
|
dynamic id;
|
||||||
|
|
||||||
|
@ -19,15 +22,12 @@ class FetchRequestFederatedCredential extends FetchRequestCredential {
|
||||||
|
|
||||||
///Credential's federated identity provider.
|
///Credential's federated identity provider.
|
||||||
String? provider;
|
String? provider;
|
||||||
|
|
||||||
///URL pointing to an image for an icon. This image is intended for display in a credential chooser. The URL must be accessible without authentication.
|
|
||||||
WebUri? iconURL;
|
|
||||||
FetchRequestFederatedCredential(
|
FetchRequestFederatedCredential(
|
||||||
{this.id,
|
{this.iconURL,
|
||||||
|
this.id,
|
||||||
this.name,
|
this.name,
|
||||||
this.protocol,
|
this.protocol,
|
||||||
this.provider,
|
this.provider,
|
||||||
this.iconURL,
|
|
||||||
String? type})
|
String? type})
|
||||||
: super(type: type);
|
: super(type: type);
|
||||||
|
|
||||||
|
@ -37,11 +37,11 @@ class FetchRequestFederatedCredential extends FetchRequestCredential {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = FetchRequestFederatedCredential(
|
final instance = FetchRequestFederatedCredential(
|
||||||
|
iconURL: map['iconURL'] != null ? WebUri(map['iconURL']) : null,
|
||||||
id: map['id'],
|
id: map['id'],
|
||||||
name: map['name'],
|
name: map['name'],
|
||||||
protocol: map['protocol'],
|
protocol: map['protocol'],
|
||||||
provider: map['provider'],
|
provider: map['provider'],
|
||||||
iconURL: map['iconURL'] != null ? WebUri(map['iconURL']) : null,
|
|
||||||
);
|
);
|
||||||
instance.type = map['type'];
|
instance.type = map['type'];
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -51,11 +51,11 @@ class FetchRequestFederatedCredential extends FetchRequestCredential {
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"type": type,
|
"type": type,
|
||||||
|
"iconURL": iconURL?.toString(),
|
||||||
"id": id,
|
"id": id,
|
||||||
"name": name,
|
"name": name,
|
||||||
"protocol": protocol,
|
"protocol": protocol,
|
||||||
"provider": provider,
|
"provider": provider,
|
||||||
"iconURL": iconURL?.toString(),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +66,6 @@ class FetchRequestFederatedCredential extends FetchRequestCredential {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'FetchRequestFederatedCredential{type: $type, id: $id, name: $name, protocol: $protocol, provider: $provider, iconURL: $iconURL}';
|
return 'FetchRequestFederatedCredential{type: $type, iconURL: $iconURL, id: $id, name: $name, protocol: $protocol, provider: $provider}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,9 @@ part of 'fetch_request_password_credential.dart';
|
||||||
|
|
||||||
///Class that represents a [PasswordCredential](https://developer.mozilla.org/en-US/docs/Web/API/PasswordCredential) type of credentials.
|
///Class that represents a [PasswordCredential](https://developer.mozilla.org/en-US/docs/Web/API/PasswordCredential) type of credentials.
|
||||||
class FetchRequestPasswordCredential extends FetchRequestCredential {
|
class FetchRequestPasswordCredential extends FetchRequestCredential {
|
||||||
|
///URL pointing to an image for an icon. This image is intended for display in a credential chooser. The URL must be accessible without authentication.
|
||||||
|
WebUri? iconURL;
|
||||||
|
|
||||||
///Credential's identifier.
|
///Credential's identifier.
|
||||||
dynamic id;
|
dynamic id;
|
||||||
|
|
||||||
|
@ -16,11 +19,8 @@ class FetchRequestPasswordCredential extends FetchRequestCredential {
|
||||||
|
|
||||||
///The password of the credential.
|
///The password of the credential.
|
||||||
String? password;
|
String? password;
|
||||||
|
|
||||||
///URL pointing to an image for an icon. This image is intended for display in a credential chooser. The URL must be accessible without authentication.
|
|
||||||
WebUri? iconURL;
|
|
||||||
FetchRequestPasswordCredential(
|
FetchRequestPasswordCredential(
|
||||||
{this.id, this.name, this.password, this.iconURL, String? type})
|
{this.iconURL, this.id, this.name, this.password, String? type})
|
||||||
: super(type: type);
|
: super(type: type);
|
||||||
|
|
||||||
///Gets a possible [FetchRequestPasswordCredential] instance from a [Map] value.
|
///Gets a possible [FetchRequestPasswordCredential] instance from a [Map] value.
|
||||||
|
@ -29,10 +29,10 @@ class FetchRequestPasswordCredential extends FetchRequestCredential {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = FetchRequestPasswordCredential(
|
final instance = FetchRequestPasswordCredential(
|
||||||
|
iconURL: map['iconURL'] != null ? WebUri(map['iconURL']) : null,
|
||||||
id: map['id'],
|
id: map['id'],
|
||||||
name: map['name'],
|
name: map['name'],
|
||||||
password: map['password'],
|
password: map['password'],
|
||||||
iconURL: map['iconURL'] != null ? WebUri(map['iconURL']) : null,
|
|
||||||
);
|
);
|
||||||
instance.type = map['type'];
|
instance.type = map['type'];
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -42,10 +42,10 @@ class FetchRequestPasswordCredential extends FetchRequestCredential {
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"type": type,
|
"type": type,
|
||||||
|
"iconURL": iconURL?.toString(),
|
||||||
"id": id,
|
"id": id,
|
||||||
"name": name,
|
"name": name,
|
||||||
"password": password,
|
"password": password,
|
||||||
"iconURL": iconURL?.toString(),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,6 @@ class FetchRequestPasswordCredential extends FetchRequestCredential {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'FetchRequestPasswordCredential{type: $type, id: $id, name: $name, password: $password, iconURL: $iconURL}';
|
return 'FetchRequestPasswordCredential{type: $type, iconURL: $iconURL, id: $id, name: $name, password: $password}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,18 +7,18 @@ part of 'find_session.dart';
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
class FindSession {
|
class FindSession {
|
||||||
///Returns the total number of results.
|
|
||||||
int resultCount;
|
|
||||||
|
|
||||||
///Returns the index of the currently highlighted result.
|
///Returns the index of the currently highlighted result.
|
||||||
///If no result is currently highlighted.
|
///If no result is currently highlighted.
|
||||||
int highlightedResultIndex;
|
int highlightedResultIndex;
|
||||||
|
|
||||||
|
///Returns the total number of results.
|
||||||
|
int resultCount;
|
||||||
|
|
||||||
/// Defines how results are reported through the find panel's UI.
|
/// Defines how results are reported through the find panel's UI.
|
||||||
SearchResultDisplayStyle searchResultDisplayStyle;
|
SearchResultDisplayStyle searchResultDisplayStyle;
|
||||||
FindSession(
|
FindSession(
|
||||||
{required this.resultCount,
|
{required this.highlightedResultIndex,
|
||||||
required this.highlightedResultIndex,
|
required this.resultCount,
|
||||||
required this.searchResultDisplayStyle});
|
required this.searchResultDisplayStyle});
|
||||||
|
|
||||||
///Gets a possible [FindSession] instance from a [Map] value.
|
///Gets a possible [FindSession] instance from a [Map] value.
|
||||||
|
@ -27,8 +27,8 @@ class FindSession {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = FindSession(
|
final instance = FindSession(
|
||||||
resultCount: map['resultCount'],
|
|
||||||
highlightedResultIndex: map['highlightedResultIndex'],
|
highlightedResultIndex: map['highlightedResultIndex'],
|
||||||
|
resultCount: map['resultCount'],
|
||||||
searchResultDisplayStyle: SearchResultDisplayStyle.fromNativeValue(
|
searchResultDisplayStyle: SearchResultDisplayStyle.fromNativeValue(
|
||||||
map['searchResultDisplayStyle'])!,
|
map['searchResultDisplayStyle'])!,
|
||||||
);
|
);
|
||||||
|
@ -38,8 +38,8 @@ class FindSession {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"resultCount": resultCount,
|
|
||||||
"highlightedResultIndex": highlightedResultIndex,
|
"highlightedResultIndex": highlightedResultIndex,
|
||||||
|
"resultCount": resultCount,
|
||||||
"searchResultDisplayStyle": searchResultDisplayStyle.toNativeValue(),
|
"searchResultDisplayStyle": searchResultDisplayStyle.toNativeValue(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,6 @@ class FindSession {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'FindSession{resultCount: $resultCount, highlightedResultIndex: $highlightedResultIndex, searchResultDisplayStyle: $searchResultDisplayStyle}';
|
return 'FindSession{highlightedResultIndex: $highlightedResultIndex, resultCount: $resultCount, searchResultDisplayStyle: $searchResultDisplayStyle}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,20 +15,20 @@ class ForceDark {
|
||||||
factory ForceDark._internalMultiPlatform(int value, Function nativeValue) =>
|
factory ForceDark._internalMultiPlatform(int value, Function nativeValue) =>
|
||||||
ForceDark._internal(value, nativeValue());
|
ForceDark._internal(value, nativeValue());
|
||||||
|
|
||||||
|
///Enable force dark dependent on the state of the WebView parent view.
|
||||||
|
static const AUTO = ForceDark._internal(1, 1);
|
||||||
|
|
||||||
///Disable force dark, irrespective of the force dark mode of the WebView parent.
|
///Disable force dark, irrespective of the force dark mode of the WebView parent.
|
||||||
///In this mode, WebView content will always be rendered as-is, regardless of whether native views are being automatically darkened.
|
///In this mode, WebView content will always be rendered as-is, regardless of whether native views are being automatically darkened.
|
||||||
static const OFF = ForceDark._internal(0, 0);
|
static const OFF = ForceDark._internal(0, 0);
|
||||||
|
|
||||||
///Enable force dark dependent on the state of the WebView parent view.
|
|
||||||
static const AUTO = ForceDark._internal(1, 1);
|
|
||||||
|
|
||||||
///Unconditionally enable force dark. In this mode WebView content will always be rendered so as to emulate a dark theme.
|
///Unconditionally enable force dark. In this mode WebView content will always be rendered so as to emulate a dark theme.
|
||||||
static const ON = ForceDark._internal(2, 2);
|
static const ON = ForceDark._internal(2, 2);
|
||||||
|
|
||||||
///Set of all values of [ForceDark].
|
///Set of all values of [ForceDark].
|
||||||
static final Set<ForceDark> values = [
|
static final Set<ForceDark> values = [
|
||||||
ForceDark.OFF,
|
|
||||||
ForceDark.AUTO,
|
ForceDark.AUTO,
|
||||||
|
ForceDark.OFF,
|
||||||
ForceDark.ON,
|
ForceDark.ON,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
|
@ -73,10 +73,10 @@ class ForceDark {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'OFF';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'AUTO';
|
return 'AUTO';
|
||||||
|
case 0:
|
||||||
|
return 'OFF';
|
||||||
case 2:
|
case 2:
|
||||||
return 'ON';
|
return 'ON';
|
||||||
}
|
}
|
||||||
|
@ -99,20 +99,20 @@ class AndroidForceDark {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
AndroidForceDark._internal(value, nativeValue());
|
AndroidForceDark._internal(value, nativeValue());
|
||||||
|
|
||||||
|
///Enable force dark dependent on the state of the WebView parent view.
|
||||||
|
static const FORCE_DARK_AUTO = AndroidForceDark._internal(1, 1);
|
||||||
|
|
||||||
///Disable force dark, irrespective of the force dark mode of the WebView parent.
|
///Disable force dark, irrespective of the force dark mode of the WebView parent.
|
||||||
///In this mode, WebView content will always be rendered as-is, regardless of whether native views are being automatically darkened.
|
///In this mode, WebView content will always be rendered as-is, regardless of whether native views are being automatically darkened.
|
||||||
static const FORCE_DARK_OFF = AndroidForceDark._internal(0, 0);
|
static const FORCE_DARK_OFF = AndroidForceDark._internal(0, 0);
|
||||||
|
|
||||||
///Enable force dark dependent on the state of the WebView parent view.
|
|
||||||
static const FORCE_DARK_AUTO = AndroidForceDark._internal(1, 1);
|
|
||||||
|
|
||||||
///Unconditionally enable force dark. In this mode WebView content will always be rendered so as to emulate a dark theme.
|
///Unconditionally enable force dark. In this mode WebView content will always be rendered so as to emulate a dark theme.
|
||||||
static const FORCE_DARK_ON = AndroidForceDark._internal(2, 2);
|
static const FORCE_DARK_ON = AndroidForceDark._internal(2, 2);
|
||||||
|
|
||||||
///Set of all values of [AndroidForceDark].
|
///Set of all values of [AndroidForceDark].
|
||||||
static final Set<AndroidForceDark> values = [
|
static final Set<AndroidForceDark> values = [
|
||||||
AndroidForceDark.FORCE_DARK_OFF,
|
|
||||||
AndroidForceDark.FORCE_DARK_AUTO,
|
AndroidForceDark.FORCE_DARK_AUTO,
|
||||||
|
AndroidForceDark.FORCE_DARK_OFF,
|
||||||
AndroidForceDark.FORCE_DARK_ON,
|
AndroidForceDark.FORCE_DARK_ON,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
|
@ -157,10 +157,10 @@ class AndroidForceDark {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'FORCE_DARK_OFF';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'FORCE_DARK_AUTO';
|
return 'FORCE_DARK_AUTO';
|
||||||
|
case 0:
|
||||||
|
return 'FORCE_DARK_OFF';
|
||||||
case 2:
|
case 2:
|
||||||
return 'FORCE_DARK_ON';
|
return 'FORCE_DARK_ON';
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,15 @@ class ForceDarkStrategy {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
ForceDarkStrategy._internal(value, nativeValue());
|
ForceDarkStrategy._internal(value, nativeValue());
|
||||||
|
|
||||||
|
///In this mode [WebView] content will be darkened by a user agent unless web page supports dark theme.
|
||||||
|
///[WebView] determines whether web pages supports dark theme by the presence of `color-scheme` metadata containing `"dark"` value.
|
||||||
|
///For example, `<meta name="color-scheme" content="dark light">`.
|
||||||
|
///If the metadata is not presented [WebView] content will be darkened by a user agent and `prefers-color-scheme` media query will evaluate to light.
|
||||||
|
///
|
||||||
|
///See [specification](https://drafts.csswg.org/css-color-adjust-1/) for more information.
|
||||||
|
static const PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING =
|
||||||
|
ForceDarkStrategy._internal(2, 2);
|
||||||
|
|
||||||
///In this mode [WebView] content will be darkened by a user agent and it will ignore the web page's dark theme if it exists.
|
///In this mode [WebView] content will be darkened by a user agent and it will ignore the web page's dark theme if it exists.
|
||||||
///To avoid mixing two different darkening strategies, the `prefers-color-scheme` media query will evaluate to light.
|
///To avoid mixing two different darkening strategies, the `prefers-color-scheme` media query will evaluate to light.
|
||||||
///
|
///
|
||||||
|
@ -28,20 +37,11 @@ class ForceDarkStrategy {
|
||||||
///See [specification](https://drafts.csswg.org/css-color-adjust-1/) for more information.
|
///See [specification](https://drafts.csswg.org/css-color-adjust-1/) for more information.
|
||||||
static const WEB_THEME_DARKENING_ONLY = ForceDarkStrategy._internal(1, 1);
|
static const WEB_THEME_DARKENING_ONLY = ForceDarkStrategy._internal(1, 1);
|
||||||
|
|
||||||
///In this mode [WebView] content will be darkened by a user agent unless web page supports dark theme.
|
|
||||||
///[WebView] determines whether web pages supports dark theme by the presence of `color-scheme` metadata containing `"dark"` value.
|
|
||||||
///For example, `<meta name="color-scheme" content="dark light">`.
|
|
||||||
///If the metadata is not presented [WebView] content will be darkened by a user agent and `prefers-color-scheme` media query will evaluate to light.
|
|
||||||
///
|
|
||||||
///See [specification](https://drafts.csswg.org/css-color-adjust-1/) for more information.
|
|
||||||
static const PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING =
|
|
||||||
ForceDarkStrategy._internal(2, 2);
|
|
||||||
|
|
||||||
///Set of all values of [ForceDarkStrategy].
|
///Set of all values of [ForceDarkStrategy].
|
||||||
static final Set<ForceDarkStrategy> values = [
|
static final Set<ForceDarkStrategy> values = [
|
||||||
|
ForceDarkStrategy.PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING,
|
||||||
ForceDarkStrategy.USER_AGENT_DARKENING_ONLY,
|
ForceDarkStrategy.USER_AGENT_DARKENING_ONLY,
|
||||||
ForceDarkStrategy.WEB_THEME_DARKENING_ONLY,
|
ForceDarkStrategy.WEB_THEME_DARKENING_ONLY,
|
||||||
ForceDarkStrategy.PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING,
|
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [ForceDarkStrategy] instance from [int] value.
|
///Gets a possible [ForceDarkStrategy] instance from [int] value.
|
||||||
|
@ -85,12 +85,12 @@ class ForceDarkStrategy {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
|
case 2:
|
||||||
|
return 'PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING';
|
||||||
case 0:
|
case 0:
|
||||||
return 'USER_AGENT_DARKENING_ONLY';
|
return 'USER_AGENT_DARKENING_ONLY';
|
||||||
case 1:
|
case 1:
|
||||||
return 'WEB_THEME_DARKENING_ONLY';
|
return 'WEB_THEME_DARKENING_ONLY';
|
||||||
case 2:
|
|
||||||
return 'PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING';
|
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,16 +16,16 @@ class FormResubmissionAction {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
FormResubmissionAction._internal(value, nativeValue());
|
FormResubmissionAction._internal(value, nativeValue());
|
||||||
|
|
||||||
///Resend data
|
|
||||||
static const RESEND = FormResubmissionAction._internal(0, 0);
|
|
||||||
|
|
||||||
///Don't resend data
|
///Don't resend data
|
||||||
static const DONT_RESEND = FormResubmissionAction._internal(1, 1);
|
static const DONT_RESEND = FormResubmissionAction._internal(1, 1);
|
||||||
|
|
||||||
|
///Resend data
|
||||||
|
static const RESEND = FormResubmissionAction._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [FormResubmissionAction].
|
///Set of all values of [FormResubmissionAction].
|
||||||
static final Set<FormResubmissionAction> values = [
|
static final Set<FormResubmissionAction> values = [
|
||||||
FormResubmissionAction.RESEND,
|
|
||||||
FormResubmissionAction.DONT_RESEND,
|
FormResubmissionAction.DONT_RESEND,
|
||||||
|
FormResubmissionAction.RESEND,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [FormResubmissionAction] instance from [int] value.
|
///Gets a possible [FormResubmissionAction] instance from [int] value.
|
||||||
|
@ -69,10 +69,10 @@ class FormResubmissionAction {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'RESEND';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'DONT_RESEND';
|
return 'DONT_RESEND';
|
||||||
|
case 0:
|
||||||
|
return 'RESEND';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,17 +8,17 @@ part of 'geolocation_permission_show_prompt_response.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 [WebView.onGeolocationPermissionsShowPrompt] event.
|
||||||
class GeolocationPermissionShowPromptResponse {
|
class GeolocationPermissionShowPromptResponse {
|
||||||
///The origin for which permissions are set.
|
|
||||||
String origin;
|
|
||||||
|
|
||||||
///Whether or not the origin should be allowed to use the Geolocation API.
|
///Whether or not the origin should be allowed to use the Geolocation API.
|
||||||
bool allow;
|
bool allow;
|
||||||
|
|
||||||
|
///The origin for which permissions are set.
|
||||||
|
String origin;
|
||||||
|
|
||||||
///Whether the permission should be retained beyond the lifetime of a page currently being displayed by a WebView
|
///Whether the permission should be retained beyond the lifetime of a page currently being displayed by a WebView
|
||||||
///The default value is `false`.
|
///The default value is `false`.
|
||||||
bool retain;
|
bool retain;
|
||||||
GeolocationPermissionShowPromptResponse(
|
GeolocationPermissionShowPromptResponse(
|
||||||
{required this.origin, required this.allow, this.retain = false});
|
{required this.allow, required this.origin, this.retain = false});
|
||||||
|
|
||||||
///Gets a possible [GeolocationPermissionShowPromptResponse] instance from a [Map] value.
|
///Gets a possible [GeolocationPermissionShowPromptResponse] instance from a [Map] value.
|
||||||
static GeolocationPermissionShowPromptResponse? fromMap(
|
static GeolocationPermissionShowPromptResponse? fromMap(
|
||||||
|
@ -27,8 +27,8 @@ class GeolocationPermissionShowPromptResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = GeolocationPermissionShowPromptResponse(
|
final instance = GeolocationPermissionShowPromptResponse(
|
||||||
origin: map['origin'],
|
|
||||||
allow: map['allow'],
|
allow: map['allow'],
|
||||||
|
origin: map['origin'],
|
||||||
);
|
);
|
||||||
instance.retain = map['retain'];
|
instance.retain = map['retain'];
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -37,8 +37,8 @@ class GeolocationPermissionShowPromptResponse {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"origin": origin,
|
|
||||||
"allow": allow,
|
"allow": allow,
|
||||||
|
"origin": origin,
|
||||||
"retain": retain,
|
"retain": retain,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,6 @@ class GeolocationPermissionShowPromptResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'GeolocationPermissionShowPromptResponse{origin: $origin, allow: $allow, retain: $retain}';
|
return 'GeolocationPermissionShowPromptResponse{allow: $allow, origin: $origin, retain: $retain}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ part of 'http_auth_response.dart';
|
||||||
|
|
||||||
///Class that represents the response used by the [WebView.onReceivedHttpAuthRequest] event.
|
///Class that represents the response used by the [WebView.onReceivedHttpAuthRequest] event.
|
||||||
class HttpAuthResponse {
|
class HttpAuthResponse {
|
||||||
///Represents the username used for the authentication if the [action] corresponds to [HttpAuthResponseAction.PROCEED]
|
///Indicate the [HttpAuthResponseAction] to take in response of the authentication challenge.
|
||||||
String username;
|
HttpAuthResponseAction? action;
|
||||||
|
|
||||||
///Represents the password used for the authentication if the [action] corresponds to [HttpAuthResponseAction.PROCEED]
|
///Represents the password used for the authentication if the [action] corresponds to [HttpAuthResponseAction.PROCEED]
|
||||||
String password;
|
String password;
|
||||||
|
@ -17,13 +17,13 @@ class HttpAuthResponse {
|
||||||
///Indicate if the given credentials need to be saved permanently.
|
///Indicate if the given credentials need to be saved permanently.
|
||||||
bool permanentPersistence;
|
bool permanentPersistence;
|
||||||
|
|
||||||
///Indicate the [HttpAuthResponseAction] to take in response of the authentication challenge.
|
///Represents the username used for the authentication if the [action] corresponds to [HttpAuthResponseAction.PROCEED]
|
||||||
HttpAuthResponseAction? action;
|
String username;
|
||||||
HttpAuthResponse(
|
HttpAuthResponse(
|
||||||
{this.username = "",
|
{this.action = HttpAuthResponseAction.CANCEL,
|
||||||
this.password = "",
|
this.password = "",
|
||||||
this.permanentPersistence = false,
|
this.permanentPersistence = false,
|
||||||
this.action = HttpAuthResponseAction.CANCEL});
|
this.username = ""});
|
||||||
|
|
||||||
///Gets a possible [HttpAuthResponse] instance from a [Map] value.
|
///Gets a possible [HttpAuthResponse] instance from a [Map] value.
|
||||||
static HttpAuthResponse? fromMap(Map<String, dynamic>? map) {
|
static HttpAuthResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -31,20 +31,20 @@ class HttpAuthResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = HttpAuthResponse();
|
final instance = HttpAuthResponse();
|
||||||
instance.username = map['username'];
|
instance.action = HttpAuthResponseAction.fromNativeValue(map['action']);
|
||||||
instance.password = map['password'];
|
instance.password = map['password'];
|
||||||
instance.permanentPersistence = map['permanentPersistence'];
|
instance.permanentPersistence = map['permanentPersistence'];
|
||||||
instance.action = HttpAuthResponseAction.fromNativeValue(map['action']);
|
instance.username = map['username'];
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"username": username,
|
"action": action?.toNativeValue(),
|
||||||
"password": password,
|
"password": password,
|
||||||
"permanentPersistence": permanentPersistence,
|
"permanentPersistence": permanentPersistence,
|
||||||
"action": action?.toNativeValue(),
|
"username": username,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,6 @@ class HttpAuthResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'HttpAuthResponse{username: $username, password: $password, permanentPersistence: $permanentPersistence, action: $action}';
|
return 'HttpAuthResponse{action: $action, password: $password, permanentPersistence: $permanentPersistence, username: $username}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,20 +9,11 @@ part of 'http_authentication_challenge.dart';
|
||||||
///Class that represents the challenge of the [WebView.onReceivedHttpAuthRequest] event.
|
///Class that represents the challenge of the [WebView.onReceivedHttpAuthRequest] event.
|
||||||
///It provides all the information about the challenge.
|
///It provides all the information about the challenge.
|
||||||
class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
|
class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
|
||||||
///A count of previous failed authentication attempts.
|
///The error object representing the last authentication failure.
|
||||||
int previousFailureCount;
|
///This value is `null` if the protocol doesn’t use errors to indicate an authentication failure.
|
||||||
|
///
|
||||||
///The proposed credential for this challenge.
|
///**NOTE**: available only on iOS.
|
||||||
///This method returns `null` if there is no default credential for this challenge.
|
String? error;
|
||||||
///If you have previously attempted to authenticate and failed, this method returns the most recent failed credential.
|
|
||||||
///If the proposed credential is not nil and returns true when you call its hasPassword method, then the credential is ready to use as-is.
|
|
||||||
///If the proposed credential’s hasPassword method returns false, then the credential provides a default user name,
|
|
||||||
///and the client must prompt the user for a corresponding password.
|
|
||||||
URLCredential? proposedCredential;
|
|
||||||
|
|
||||||
///Use [failureResponse] instead.
|
|
||||||
@Deprecated('Use failureResponse instead')
|
|
||||||
IOSURLResponse? iosFailureResponse;
|
|
||||||
|
|
||||||
///The URL response object representing the last authentication failure.
|
///The URL response object representing the last authentication failure.
|
||||||
///This value is `null` if the protocol doesn’t use responses to indicate an authentication failure.
|
///This value is `null` if the protocol doesn’t use responses to indicate an authentication failure.
|
||||||
|
@ -34,23 +25,32 @@ class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
|
||||||
@Deprecated('Use error instead')
|
@Deprecated('Use error instead')
|
||||||
String? iosError;
|
String? iosError;
|
||||||
|
|
||||||
///The error object representing the last authentication failure.
|
///Use [failureResponse] instead.
|
||||||
///This value is `null` if the protocol doesn’t use errors to indicate an authentication failure.
|
@Deprecated('Use failureResponse instead')
|
||||||
///
|
IOSURLResponse? iosFailureResponse;
|
||||||
///**NOTE**: available only on iOS.
|
|
||||||
String? error;
|
///A count of previous failed authentication attempts.
|
||||||
|
int previousFailureCount;
|
||||||
|
|
||||||
|
///The proposed credential for this challenge.
|
||||||
|
///This method returns `null` if there is no default credential for this challenge.
|
||||||
|
///If you have previously attempted to authenticate and failed, this method returns the most recent failed credential.
|
||||||
|
///If the proposed credential is not nil and returns true when you call its hasPassword method, then the credential is ready to use as-is.
|
||||||
|
///If the proposed credential’s hasPassword method returns false, then the credential provides a default user name,
|
||||||
|
///and the client must prompt the user for a corresponding password.
|
||||||
|
URLCredential? proposedCredential;
|
||||||
HttpAuthenticationChallenge(
|
HttpAuthenticationChallenge(
|
||||||
{required this.previousFailureCount,
|
{this.error,
|
||||||
this.proposedCredential,
|
|
||||||
@Deprecated('Use failureResponse instead') this.iosFailureResponse,
|
|
||||||
this.failureResponse,
|
this.failureResponse,
|
||||||
@Deprecated('Use error instead') this.iosError,
|
@Deprecated('Use error instead') this.iosError,
|
||||||
this.error,
|
@Deprecated('Use failureResponse instead') this.iosFailureResponse,
|
||||||
|
required this.previousFailureCount,
|
||||||
|
this.proposedCredential,
|
||||||
required URLProtectionSpace protectionSpace})
|
required URLProtectionSpace protectionSpace})
|
||||||
: super(protectionSpace: protectionSpace) {
|
: super(protectionSpace: protectionSpace) {
|
||||||
|
error = error ?? iosError;
|
||||||
failureResponse =
|
failureResponse =
|
||||||
failureResponse ?? URLResponse.fromMap(iosFailureResponse?.toMap());
|
failureResponse ?? URLResponse.fromMap(iosFailureResponse?.toMap());
|
||||||
error = error ?? iosError;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///Gets a possible [HttpAuthenticationChallenge] instance from a [Map] value.
|
///Gets a possible [HttpAuthenticationChallenge] instance from a [Map] value.
|
||||||
|
@ -61,15 +61,15 @@ class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
|
||||||
final instance = HttpAuthenticationChallenge(
|
final instance = HttpAuthenticationChallenge(
|
||||||
protectionSpace: URLProtectionSpace.fromMap(
|
protectionSpace: URLProtectionSpace.fromMap(
|
||||||
map['protectionSpace']?.cast<String, dynamic>())!,
|
map['protectionSpace']?.cast<String, dynamic>())!,
|
||||||
previousFailureCount: map['previousFailureCount'],
|
error: map['error'],
|
||||||
proposedCredential: URLCredential.fromMap(
|
|
||||||
map['proposedCredential']?.cast<String, dynamic>()),
|
|
||||||
iosFailureResponse: IOSURLResponse.fromMap(
|
|
||||||
map['failureResponse']?.cast<String, dynamic>()),
|
|
||||||
failureResponse:
|
failureResponse:
|
||||||
URLResponse.fromMap(map['failureResponse']?.cast<String, dynamic>()),
|
URLResponse.fromMap(map['failureResponse']?.cast<String, dynamic>()),
|
||||||
iosError: map['error'],
|
iosError: map['error'],
|
||||||
error: map['error'],
|
iosFailureResponse: IOSURLResponse.fromMap(
|
||||||
|
map['failureResponse']?.cast<String, dynamic>()),
|
||||||
|
previousFailureCount: map['previousFailureCount'],
|
||||||
|
proposedCredential: URLCredential.fromMap(
|
||||||
|
map['proposedCredential']?.cast<String, dynamic>()),
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -78,10 +78,10 @@ class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"protectionSpace": protectionSpace.toMap(),
|
"protectionSpace": protectionSpace.toMap(),
|
||||||
|
"error": error,
|
||||||
|
"failureResponse": failureResponse?.toMap(),
|
||||||
"previousFailureCount": previousFailureCount,
|
"previousFailureCount": previousFailureCount,
|
||||||
"proposedCredential": proposedCredential?.toMap(),
|
"proposedCredential": proposedCredential?.toMap(),
|
||||||
"failureResponse": failureResponse?.toMap(),
|
|
||||||
"error": error,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +92,6 @@ class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'HttpAuthenticationChallenge{protectionSpace: $protectionSpace, previousFailureCount: $previousFailureCount, proposedCredential: $proposedCredential, failureResponse: $failureResponse, error: $error}';
|
return 'HttpAuthenticationChallenge{protectionSpace: $protectionSpace, error: $error, failureResponse: $failureResponse, previousFailureCount: $previousFailureCount, proposedCredential: $proposedCredential}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,22 +22,22 @@ class HTTPCookieSameSitePolicy {
|
||||||
///request initiated by third party website. This is the default value in modern browsers.
|
///request initiated by third party website. This is the default value in modern browsers.
|
||||||
static const LAX = HTTPCookieSameSitePolicy._internal('Lax', 'Lax');
|
static const LAX = HTTPCookieSameSitePolicy._internal('Lax', 'Lax');
|
||||||
|
|
||||||
///SameSite=Strict;
|
|
||||||
///
|
|
||||||
///Cookies will only be sent in a first-party context and not be sent along with requests initiated by third party websites.
|
|
||||||
static const STRICT = HTTPCookieSameSitePolicy._internal('Strict', 'Strict');
|
|
||||||
|
|
||||||
///SameSite=None;
|
///SameSite=None;
|
||||||
///
|
///
|
||||||
///Cookies will be sent in all contexts, i.e sending cross-origin is allowed.
|
///Cookies will be sent in all contexts, i.e sending cross-origin is allowed.
|
||||||
///`None` requires the `Secure` attribute in latest browser versions.
|
///`None` requires the `Secure` attribute in latest browser versions.
|
||||||
static const NONE = HTTPCookieSameSitePolicy._internal('None', 'None');
|
static const NONE = HTTPCookieSameSitePolicy._internal('None', 'None');
|
||||||
|
|
||||||
|
///SameSite=Strict;
|
||||||
|
///
|
||||||
|
///Cookies will only be sent in a first-party context and not be sent along with requests initiated by third party websites.
|
||||||
|
static const STRICT = HTTPCookieSameSitePolicy._internal('Strict', 'Strict');
|
||||||
|
|
||||||
///Set of all values of [HTTPCookieSameSitePolicy].
|
///Set of all values of [HTTPCookieSameSitePolicy].
|
||||||
static final Set<HTTPCookieSameSitePolicy> values = [
|
static final Set<HTTPCookieSameSitePolicy> values = [
|
||||||
HTTPCookieSameSitePolicy.LAX,
|
HTTPCookieSameSitePolicy.LAX,
|
||||||
HTTPCookieSameSitePolicy.STRICT,
|
|
||||||
HTTPCookieSameSitePolicy.NONE,
|
HTTPCookieSameSitePolicy.NONE,
|
||||||
|
HTTPCookieSameSitePolicy.STRICT,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [HTTPCookieSameSitePolicy] instance from [String] value.
|
///Gets a possible [HTTPCookieSameSitePolicy] instance from [String] value.
|
||||||
|
|
|
@ -8,12 +8,12 @@ part of 'in_app_webview_hit_test_result.dart';
|
||||||
|
|
||||||
///Class that represents the hit result for hitting an HTML elements.
|
///Class that represents the hit result for hitting an HTML elements.
|
||||||
class InAppWebViewHitTestResult {
|
class InAppWebViewHitTestResult {
|
||||||
///The type of the hit test result.
|
|
||||||
InAppWebViewHitTestResultType? type;
|
|
||||||
|
|
||||||
///Additional type-dependant information about the result.
|
///Additional type-dependant information about the result.
|
||||||
String? extra;
|
String? extra;
|
||||||
InAppWebViewHitTestResult({this.type, this.extra});
|
|
||||||
|
///The type of the hit test result.
|
||||||
|
InAppWebViewHitTestResultType? type;
|
||||||
|
InAppWebViewHitTestResult({this.extra, this.type});
|
||||||
|
|
||||||
///Gets a possible [InAppWebViewHitTestResult] instance from a [Map] value.
|
///Gets a possible [InAppWebViewHitTestResult] instance from a [Map] value.
|
||||||
static InAppWebViewHitTestResult? fromMap(Map<String, dynamic>? map) {
|
static InAppWebViewHitTestResult? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -21,8 +21,8 @@ class InAppWebViewHitTestResult {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = InAppWebViewHitTestResult(
|
final instance = InAppWebViewHitTestResult(
|
||||||
type: InAppWebViewHitTestResultType.fromNativeValue(map['type']),
|
|
||||||
extra: map['extra'],
|
extra: map['extra'],
|
||||||
|
type: InAppWebViewHitTestResultType.fromNativeValue(map['type']),
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ class InAppWebViewHitTestResult {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"type": type?.toNativeValue(),
|
|
||||||
"extra": extra,
|
"extra": extra,
|
||||||
|
"type": type?.toNativeValue(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +42,6 @@ class InAppWebViewHitTestResult {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'InAppWebViewHitTestResult{type: $type, extra: $extra}';
|
return 'InAppWebViewHitTestResult{extra: $extra, type: $type}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,21 +16,21 @@ class InAppWebViewHitTestResultType {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
InAppWebViewHitTestResultType._internal(value, nativeValue());
|
InAppWebViewHitTestResultType._internal(value, nativeValue());
|
||||||
|
|
||||||
///Default [InAppWebViewHitTestResult], where the target is unknown.
|
///[InAppWebViewHitTestResult] for hitting an edit text area.
|
||||||
static const UNKNOWN_TYPE = InAppWebViewHitTestResultType._internal(0, 0);
|
static const EDIT_TEXT_TYPE = InAppWebViewHitTestResultType._internal(9, 9);
|
||||||
|
|
||||||
///[InAppWebViewHitTestResult] for hitting a phone number.
|
|
||||||
static const PHONE_TYPE = InAppWebViewHitTestResultType._internal(2, 2);
|
|
||||||
|
|
||||||
///[InAppWebViewHitTestResult] for hitting a map address.
|
|
||||||
static const GEO_TYPE = InAppWebViewHitTestResultType._internal(3, 3);
|
|
||||||
|
|
||||||
///[InAppWebViewHitTestResult] for hitting an email address.
|
///[InAppWebViewHitTestResult] for hitting an email address.
|
||||||
static const EMAIL_TYPE = InAppWebViewHitTestResultType._internal(4, 4);
|
static const EMAIL_TYPE = InAppWebViewHitTestResultType._internal(4, 4);
|
||||||
|
|
||||||
|
///[InAppWebViewHitTestResult] for hitting a map address.
|
||||||
|
static const GEO_TYPE = InAppWebViewHitTestResultType._internal(3, 3);
|
||||||
|
|
||||||
///[InAppWebViewHitTestResult] for hitting an HTML::img tag.
|
///[InAppWebViewHitTestResult] for hitting an HTML::img tag.
|
||||||
static const IMAGE_TYPE = InAppWebViewHitTestResultType._internal(5, 5);
|
static const IMAGE_TYPE = InAppWebViewHitTestResultType._internal(5, 5);
|
||||||
|
|
||||||
|
///[InAppWebViewHitTestResult] for hitting a phone number.
|
||||||
|
static const PHONE_TYPE = InAppWebViewHitTestResultType._internal(2, 2);
|
||||||
|
|
||||||
///[InAppWebViewHitTestResult] for hitting a HTML::a tag with src=http.
|
///[InAppWebViewHitTestResult] for hitting a HTML::a tag with src=http.
|
||||||
static const SRC_ANCHOR_TYPE = InAppWebViewHitTestResultType._internal(7, 7);
|
static const SRC_ANCHOR_TYPE = InAppWebViewHitTestResultType._internal(7, 7);
|
||||||
|
|
||||||
|
@ -38,19 +38,19 @@ class InAppWebViewHitTestResultType {
|
||||||
static const SRC_IMAGE_ANCHOR_TYPE =
|
static const SRC_IMAGE_ANCHOR_TYPE =
|
||||||
InAppWebViewHitTestResultType._internal(8, 8);
|
InAppWebViewHitTestResultType._internal(8, 8);
|
||||||
|
|
||||||
///[InAppWebViewHitTestResult] for hitting an edit text area.
|
///Default [InAppWebViewHitTestResult], where the target is unknown.
|
||||||
static const EDIT_TEXT_TYPE = InAppWebViewHitTestResultType._internal(9, 9);
|
static const UNKNOWN_TYPE = InAppWebViewHitTestResultType._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [InAppWebViewHitTestResultType].
|
///Set of all values of [InAppWebViewHitTestResultType].
|
||||||
static final Set<InAppWebViewHitTestResultType> values = [
|
static final Set<InAppWebViewHitTestResultType> values = [
|
||||||
InAppWebViewHitTestResultType.UNKNOWN_TYPE,
|
InAppWebViewHitTestResultType.EDIT_TEXT_TYPE,
|
||||||
InAppWebViewHitTestResultType.PHONE_TYPE,
|
|
||||||
InAppWebViewHitTestResultType.GEO_TYPE,
|
|
||||||
InAppWebViewHitTestResultType.EMAIL_TYPE,
|
InAppWebViewHitTestResultType.EMAIL_TYPE,
|
||||||
|
InAppWebViewHitTestResultType.GEO_TYPE,
|
||||||
InAppWebViewHitTestResultType.IMAGE_TYPE,
|
InAppWebViewHitTestResultType.IMAGE_TYPE,
|
||||||
|
InAppWebViewHitTestResultType.PHONE_TYPE,
|
||||||
InAppWebViewHitTestResultType.SRC_ANCHOR_TYPE,
|
InAppWebViewHitTestResultType.SRC_ANCHOR_TYPE,
|
||||||
InAppWebViewHitTestResultType.SRC_IMAGE_ANCHOR_TYPE,
|
InAppWebViewHitTestResultType.SRC_IMAGE_ANCHOR_TYPE,
|
||||||
InAppWebViewHitTestResultType.EDIT_TEXT_TYPE,
|
InAppWebViewHitTestResultType.UNKNOWN_TYPE,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [InAppWebViewHitTestResultType] instance from [int] value.
|
///Gets a possible [InAppWebViewHitTestResultType] instance from [int] value.
|
||||||
|
@ -94,22 +94,22 @@ class InAppWebViewHitTestResultType {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 9:
|
||||||
return 'UNKNOWN_TYPE';
|
return 'EDIT_TEXT_TYPE';
|
||||||
case 2:
|
|
||||||
return 'PHONE_TYPE';
|
|
||||||
case 3:
|
|
||||||
return 'GEO_TYPE';
|
|
||||||
case 4:
|
case 4:
|
||||||
return 'EMAIL_TYPE';
|
return 'EMAIL_TYPE';
|
||||||
|
case 3:
|
||||||
|
return 'GEO_TYPE';
|
||||||
case 5:
|
case 5:
|
||||||
return 'IMAGE_TYPE';
|
return 'IMAGE_TYPE';
|
||||||
|
case 2:
|
||||||
|
return 'PHONE_TYPE';
|
||||||
case 7:
|
case 7:
|
||||||
return 'SRC_ANCHOR_TYPE';
|
return 'SRC_ANCHOR_TYPE';
|
||||||
case 8:
|
case 8:
|
||||||
return 'SRC_IMAGE_ANCHOR_TYPE';
|
return 'SRC_IMAGE_ANCHOR_TYPE';
|
||||||
case 9:
|
case 0:
|
||||||
return 'EDIT_TEXT_TYPE';
|
return 'UNKNOWN_TYPE';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,34 +8,34 @@ part of 'in_app_webview_initial_data.dart';
|
||||||
|
|
||||||
///Initial [data] as a content for an [WebView] instance, using [baseUrl] as the base URL for it.
|
///Initial [data] as a content for an [WebView] instance, using [baseUrl] as the base URL for it.
|
||||||
class InAppWebViewInitialData {
|
class InAppWebViewInitialData {
|
||||||
///A String of data in the given encoding.
|
///Use [historyUrl] instead.
|
||||||
String data;
|
@Deprecated('Use historyUrl instead')
|
||||||
|
Uri? androidHistoryUrl;
|
||||||
///The MIME type of the data, e.g. "text/html". The default value is `"text/html"`.
|
|
||||||
String mimeType;
|
|
||||||
|
|
||||||
///The encoding of the data. The default value is `"utf8"`.
|
|
||||||
String encoding;
|
|
||||||
|
|
||||||
///The URL to use as the page's base URL. If `null` defaults to `about:blank`.
|
///The URL to use as the page's base URL. If `null` defaults to `about:blank`.
|
||||||
WebUri? baseUrl;
|
WebUri? baseUrl;
|
||||||
|
|
||||||
///Use [historyUrl] instead.
|
///A String of data in the given encoding.
|
||||||
@Deprecated('Use historyUrl instead')
|
String data;
|
||||||
Uri? androidHistoryUrl;
|
|
||||||
|
///The encoding of the data. The default value is `"utf8"`.
|
||||||
|
String encoding;
|
||||||
|
|
||||||
///The URL to use as the history entry. If `null` defaults to `about:blank`. If non-null, this must be a valid URL.
|
///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**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
///- Android native WebView
|
||||||
WebUri? historyUrl;
|
WebUri? historyUrl;
|
||||||
|
|
||||||
|
///The MIME type of the data, e.g. "text/html". The default value is `"text/html"`.
|
||||||
|
String mimeType;
|
||||||
InAppWebViewInitialData(
|
InAppWebViewInitialData(
|
||||||
{required this.data,
|
{@Deprecated('Use historyUrl instead') this.androidHistoryUrl,
|
||||||
this.mimeType = "text/html",
|
|
||||||
this.encoding = "utf8",
|
|
||||||
this.baseUrl,
|
this.baseUrl,
|
||||||
@Deprecated('Use historyUrl instead') this.androidHistoryUrl,
|
required this.data,
|
||||||
this.historyUrl}) {
|
this.encoding = "utf8",
|
||||||
|
this.historyUrl,
|
||||||
|
this.mimeType = "text/html"}) {
|
||||||
historyUrl = historyUrl ??
|
historyUrl = historyUrl ??
|
||||||
(androidHistoryUrl != null ? WebUri.uri(androidHistoryUrl!) : null);
|
(androidHistoryUrl != null ? WebUri.uri(androidHistoryUrl!) : null);
|
||||||
}
|
}
|
||||||
|
@ -46,25 +46,25 @@ class InAppWebViewInitialData {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = InAppWebViewInitialData(
|
final instance = InAppWebViewInitialData(
|
||||||
data: map['data'],
|
|
||||||
baseUrl: map['baseUrl'] != null ? WebUri(map['baseUrl']) : null,
|
|
||||||
androidHistoryUrl:
|
androidHistoryUrl:
|
||||||
map['historyUrl'] != null ? Uri.tryParse(map['historyUrl']) : null,
|
map['historyUrl'] != null ? Uri.tryParse(map['historyUrl']) : null,
|
||||||
|
baseUrl: map['baseUrl'] != null ? WebUri(map['baseUrl']) : null,
|
||||||
|
data: map['data'],
|
||||||
historyUrl: map['historyUrl'] != null ? WebUri(map['historyUrl']) : null,
|
historyUrl: map['historyUrl'] != null ? WebUri(map['historyUrl']) : null,
|
||||||
);
|
);
|
||||||
instance.mimeType = map['mimeType'];
|
|
||||||
instance.encoding = map['encoding'];
|
instance.encoding = map['encoding'];
|
||||||
|
instance.mimeType = map['mimeType'];
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"data": data,
|
|
||||||
"mimeType": mimeType,
|
|
||||||
"encoding": encoding,
|
|
||||||
"baseUrl": baseUrl?.toString(),
|
"baseUrl": baseUrl?.toString(),
|
||||||
|
"data": data,
|
||||||
|
"encoding": encoding,
|
||||||
"historyUrl": historyUrl?.toString(),
|
"historyUrl": historyUrl?.toString(),
|
||||||
|
"mimeType": mimeType,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,6 @@ class InAppWebViewInitialData {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'InAppWebViewInitialData{data: $data, mimeType: $mimeType, encoding: $encoding, baseUrl: $baseUrl, historyUrl: $historyUrl}';
|
return 'InAppWebViewInitialData{baseUrl: $baseUrl, data: $data, encoding: $encoding, historyUrl: $historyUrl, mimeType: $mimeType}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,17 +8,17 @@ part of 'in_app_webview_rect.dart';
|
||||||
|
|
||||||
///A class that represents a structure that contains the location and dimensions of a rectangle.
|
///A class that represents a structure that contains the location and dimensions of a rectangle.
|
||||||
class InAppWebViewRect {
|
class InAppWebViewRect {
|
||||||
|
///rect height
|
||||||
|
double height;
|
||||||
|
|
||||||
|
///rect width
|
||||||
|
double width;
|
||||||
|
|
||||||
///x position
|
///x position
|
||||||
double x;
|
double x;
|
||||||
|
|
||||||
///y position
|
///y position
|
||||||
double y;
|
double y;
|
||||||
|
|
||||||
///rect width
|
|
||||||
double width;
|
|
||||||
|
|
||||||
///rect height
|
|
||||||
double height;
|
|
||||||
InAppWebViewRect(
|
InAppWebViewRect(
|
||||||
{required this.x,
|
{required this.x,
|
||||||
required this.y,
|
required this.y,
|
||||||
|
@ -33,10 +33,10 @@ class InAppWebViewRect {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = InAppWebViewRect(
|
final instance = InAppWebViewRect(
|
||||||
|
height: map['height'],
|
||||||
|
width: map['width'],
|
||||||
x: map['x'],
|
x: map['x'],
|
||||||
y: map['y'],
|
y: map['y'],
|
||||||
width: map['width'],
|
|
||||||
height: map['height'],
|
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -44,10 +44,10 @@ class InAppWebViewRect {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
|
"height": height,
|
||||||
|
"width": width,
|
||||||
"x": x,
|
"x": x,
|
||||||
"y": y,
|
"y": y,
|
||||||
"width": width,
|
|
||||||
"height": height,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,6 @@ class InAppWebViewRect {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'InAppWebViewRect{x: $x, y: $y, width: $width, height: $height}';
|
return 'InAppWebViewRect{height: $height, width: $width, x: $x, y: $y}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,6 @@ part of 'js_alert_request.dart';
|
||||||
|
|
||||||
///Class that represents the request of the [WebView.onJsAlert] event.
|
///Class that represents the request of the [WebView.onJsAlert] event.
|
||||||
class JsAlertRequest {
|
class JsAlertRequest {
|
||||||
///The url of the page requesting the dialog.
|
|
||||||
WebUri? url;
|
|
||||||
|
|
||||||
///Message to be displayed in the window.
|
|
||||||
String? message;
|
|
||||||
|
|
||||||
///Use [isMainFrame] instead.
|
///Use [isMainFrame] instead.
|
||||||
@Deprecated('Use isMainFrame instead')
|
@Deprecated('Use isMainFrame instead')
|
||||||
bool? iosIsMainFrame;
|
bool? iosIsMainFrame;
|
||||||
|
@ -24,11 +18,17 @@ class JsAlertRequest {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
bool? isMainFrame;
|
bool? isMainFrame;
|
||||||
|
|
||||||
|
///Message to be displayed in the window.
|
||||||
|
String? message;
|
||||||
|
|
||||||
|
///The url of the page requesting the dialog.
|
||||||
|
WebUri? url;
|
||||||
JsAlertRequest(
|
JsAlertRequest(
|
||||||
{this.url,
|
{@Deprecated('Use isMainFrame instead') this.iosIsMainFrame,
|
||||||
|
this.isMainFrame,
|
||||||
this.message,
|
this.message,
|
||||||
@Deprecated('Use isMainFrame instead') this.iosIsMainFrame,
|
this.url}) {
|
||||||
this.isMainFrame}) {
|
|
||||||
isMainFrame = isMainFrame ?? iosIsMainFrame;
|
isMainFrame = isMainFrame ?? iosIsMainFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ class JsAlertRequest {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = JsAlertRequest(
|
final instance = JsAlertRequest(
|
||||||
url: map['url'] != null ? WebUri(map['url']) : null,
|
|
||||||
message: map['message'],
|
|
||||||
iosIsMainFrame: map['isMainFrame'],
|
iosIsMainFrame: map['isMainFrame'],
|
||||||
isMainFrame: map['isMainFrame'],
|
isMainFrame: map['isMainFrame'],
|
||||||
|
message: map['message'],
|
||||||
|
url: map['url'] != null ? WebUri(map['url']) : null,
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -49,9 +49,9 @@ class JsAlertRequest {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"url": url?.toString(),
|
|
||||||
"message": message,
|
|
||||||
"isMainFrame": isMainFrame,
|
"isMainFrame": isMainFrame,
|
||||||
|
"message": message,
|
||||||
|
"url": url?.toString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,6 @@ class JsAlertRequest {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'JsAlertRequest{url: $url, message: $message, isMainFrame: $isMainFrame}';
|
return 'JsAlertRequest{isMainFrame: $isMainFrame, message: $message, url: $url}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ part of 'js_alert_response.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 [WebView.onJsAlert] event to control a JavaScript alert dialog.
|
||||||
class JsAlertResponse {
|
class JsAlertResponse {
|
||||||
///Message to be displayed in the window.
|
///Action used to confirm that the user hit confirm button.
|
||||||
String message;
|
JsAlertResponseAction? action;
|
||||||
|
|
||||||
///Title of the confirm button.
|
///Title of the confirm button.
|
||||||
String confirmButtonTitle;
|
String confirmButtonTitle;
|
||||||
|
@ -17,13 +17,13 @@ class JsAlertResponse {
|
||||||
///Whether the client will handle the alert dialog.
|
///Whether the client will handle the alert dialog.
|
||||||
bool handledByClient;
|
bool handledByClient;
|
||||||
|
|
||||||
///Action used to confirm that the user hit confirm button.
|
///Message to be displayed in the window.
|
||||||
JsAlertResponseAction? action;
|
String message;
|
||||||
JsAlertResponse(
|
JsAlertResponse(
|
||||||
{this.message = "",
|
{this.action = JsAlertResponseAction.CONFIRM,
|
||||||
this.confirmButtonTitle = "",
|
this.confirmButtonTitle = "",
|
||||||
this.handledByClient = false,
|
this.handledByClient = false,
|
||||||
this.action = JsAlertResponseAction.CONFIRM});
|
this.message = ""});
|
||||||
|
|
||||||
///Gets a possible [JsAlertResponse] instance from a [Map] value.
|
///Gets a possible [JsAlertResponse] instance from a [Map] value.
|
||||||
static JsAlertResponse? fromMap(Map<String, dynamic>? map) {
|
static JsAlertResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -31,20 +31,20 @@ class JsAlertResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = JsAlertResponse();
|
final instance = JsAlertResponse();
|
||||||
instance.message = map['message'];
|
instance.action = JsAlertResponseAction.fromNativeValue(map['action']);
|
||||||
instance.confirmButtonTitle = map['confirmButtonTitle'];
|
instance.confirmButtonTitle = map['confirmButtonTitle'];
|
||||||
instance.handledByClient = map['handledByClient'];
|
instance.handledByClient = map['handledByClient'];
|
||||||
instance.action = JsAlertResponseAction.fromNativeValue(map['action']);
|
instance.message = map['message'];
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"message": message,
|
"action": action?.toNativeValue(),
|
||||||
"confirmButtonTitle": confirmButtonTitle,
|
"confirmButtonTitle": confirmButtonTitle,
|
||||||
"handledByClient": handledByClient,
|
"handledByClient": handledByClient,
|
||||||
"action": action?.toNativeValue(),
|
"message": message,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,6 @@ class JsAlertResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'JsAlertResponse{message: $message, confirmButtonTitle: $confirmButtonTitle, handledByClient: $handledByClient, action: $action}';
|
return 'JsAlertResponse{action: $action, confirmButtonTitle: $confirmButtonTitle, handledByClient: $handledByClient, message: $message}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,12 @@ part of 'js_before_unload_request.dart';
|
||||||
|
|
||||||
///Class that represents the request of the [WebView.onJsBeforeUnload] event.
|
///Class that represents the request of the [WebView.onJsBeforeUnload] event.
|
||||||
class JsBeforeUnloadRequest {
|
class JsBeforeUnloadRequest {
|
||||||
///The url of the page requesting the dialog.
|
|
||||||
WebUri? url;
|
|
||||||
|
|
||||||
///Message to be displayed in the window.
|
///Message to be displayed in the window.
|
||||||
String? message;
|
String? message;
|
||||||
JsBeforeUnloadRequest({this.url, this.message});
|
|
||||||
|
///The url of the page requesting the dialog.
|
||||||
|
WebUri? url;
|
||||||
|
JsBeforeUnloadRequest({this.message, this.url});
|
||||||
|
|
||||||
///Gets a possible [JsBeforeUnloadRequest] instance from a [Map] value.
|
///Gets a possible [JsBeforeUnloadRequest] instance from a [Map] value.
|
||||||
static JsBeforeUnloadRequest? fromMap(Map<String, dynamic>? map) {
|
static JsBeforeUnloadRequest? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -21,8 +21,8 @@ class JsBeforeUnloadRequest {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = JsBeforeUnloadRequest(
|
final instance = JsBeforeUnloadRequest(
|
||||||
url: map['url'] != null ? WebUri(map['url']) : null,
|
|
||||||
message: map['message'],
|
message: map['message'],
|
||||||
|
url: map['url'] != null ? WebUri(map['url']) : null,
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ class JsBeforeUnloadRequest {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"url": url?.toString(),
|
|
||||||
"message": message,
|
"message": message,
|
||||||
|
"url": url?.toString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +42,6 @@ class JsBeforeUnloadRequest {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'JsBeforeUnloadRequest{url: $url, message: $message}';
|
return 'JsBeforeUnloadRequest{message: $message, url: $url}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,26 +8,26 @@ part of 'js_before_unload_response.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 [WebView.onJsBeforeUnload] event to control a JavaScript alert dialog.
|
||||||
class JsBeforeUnloadResponse {
|
class JsBeforeUnloadResponse {
|
||||||
///Message to be displayed in the window.
|
///Action used to confirm that the user hit confirm or cancel button.
|
||||||
String message;
|
JsBeforeUnloadResponseAction? action;
|
||||||
|
|
||||||
///Title of the confirm button.
|
|
||||||
String confirmButtonTitle;
|
|
||||||
|
|
||||||
///Title of the cancel button.
|
///Title of the cancel button.
|
||||||
String cancelButtonTitle;
|
String cancelButtonTitle;
|
||||||
|
|
||||||
|
///Title of the confirm button.
|
||||||
|
String confirmButtonTitle;
|
||||||
|
|
||||||
///Whether the client will handle the alert dialog.
|
///Whether the client will handle the alert dialog.
|
||||||
bool handledByClient;
|
bool handledByClient;
|
||||||
|
|
||||||
///Action used to confirm that the user hit confirm or cancel button.
|
///Message to be displayed in the window.
|
||||||
JsBeforeUnloadResponseAction? action;
|
String message;
|
||||||
JsBeforeUnloadResponse(
|
JsBeforeUnloadResponse(
|
||||||
{this.message = "",
|
{this.action = JsBeforeUnloadResponseAction.CONFIRM,
|
||||||
this.confirmButtonTitle = "",
|
|
||||||
this.cancelButtonTitle = "",
|
this.cancelButtonTitle = "",
|
||||||
|
this.confirmButtonTitle = "",
|
||||||
this.handledByClient = false,
|
this.handledByClient = false,
|
||||||
this.action = JsBeforeUnloadResponseAction.CONFIRM});
|
this.message = ""});
|
||||||
|
|
||||||
///Gets a possible [JsBeforeUnloadResponse] instance from a [Map] value.
|
///Gets a possible [JsBeforeUnloadResponse] instance from a [Map] value.
|
||||||
static JsBeforeUnloadResponse? fromMap(Map<String, dynamic>? map) {
|
static JsBeforeUnloadResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -35,23 +35,23 @@ class JsBeforeUnloadResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = JsBeforeUnloadResponse();
|
final instance = JsBeforeUnloadResponse();
|
||||||
instance.message = map['message'];
|
|
||||||
instance.confirmButtonTitle = map['confirmButtonTitle'];
|
|
||||||
instance.cancelButtonTitle = map['cancelButtonTitle'];
|
|
||||||
instance.handledByClient = map['handledByClient'];
|
|
||||||
instance.action =
|
instance.action =
|
||||||
JsBeforeUnloadResponseAction.fromNativeValue(map['action']);
|
JsBeforeUnloadResponseAction.fromNativeValue(map['action']);
|
||||||
|
instance.cancelButtonTitle = map['cancelButtonTitle'];
|
||||||
|
instance.confirmButtonTitle = map['confirmButtonTitle'];
|
||||||
|
instance.handledByClient = map['handledByClient'];
|
||||||
|
instance.message = map['message'];
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"message": message,
|
|
||||||
"confirmButtonTitle": confirmButtonTitle,
|
|
||||||
"cancelButtonTitle": cancelButtonTitle,
|
|
||||||
"handledByClient": handledByClient,
|
|
||||||
"action": action?.toNativeValue(),
|
"action": action?.toNativeValue(),
|
||||||
|
"cancelButtonTitle": cancelButtonTitle,
|
||||||
|
"confirmButtonTitle": confirmButtonTitle,
|
||||||
|
"handledByClient": handledByClient,
|
||||||
|
"message": message,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,6 @@ class JsBeforeUnloadResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'JsBeforeUnloadResponse{message: $message, confirmButtonTitle: $confirmButtonTitle, cancelButtonTitle: $cancelButtonTitle, handledByClient: $handledByClient, action: $action}';
|
return 'JsBeforeUnloadResponse{action: $action, cancelButtonTitle: $cancelButtonTitle, confirmButtonTitle: $confirmButtonTitle, handledByClient: $handledByClient, message: $message}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,16 +16,16 @@ class JsBeforeUnloadResponseAction {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
JsBeforeUnloadResponseAction._internal(value, nativeValue());
|
JsBeforeUnloadResponseAction._internal(value, nativeValue());
|
||||||
|
|
||||||
///Confirm that the user hit confirm button.
|
|
||||||
static const CONFIRM = JsBeforeUnloadResponseAction._internal(0, 0);
|
|
||||||
|
|
||||||
///Confirm that the user hit cancel button.
|
///Confirm that the user hit cancel button.
|
||||||
static const CANCEL = JsBeforeUnloadResponseAction._internal(1, 1);
|
static const CANCEL = JsBeforeUnloadResponseAction._internal(1, 1);
|
||||||
|
|
||||||
|
///Confirm that the user hit confirm button.
|
||||||
|
static const CONFIRM = JsBeforeUnloadResponseAction._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [JsBeforeUnloadResponseAction].
|
///Set of all values of [JsBeforeUnloadResponseAction].
|
||||||
static final Set<JsBeforeUnloadResponseAction> values = [
|
static final Set<JsBeforeUnloadResponseAction> values = [
|
||||||
JsBeforeUnloadResponseAction.CONFIRM,
|
|
||||||
JsBeforeUnloadResponseAction.CANCEL,
|
JsBeforeUnloadResponseAction.CANCEL,
|
||||||
|
JsBeforeUnloadResponseAction.CONFIRM,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [JsBeforeUnloadResponseAction] instance from [int] value.
|
///Gets a possible [JsBeforeUnloadResponseAction] instance from [int] value.
|
||||||
|
@ -69,10 +69,10 @@ class JsBeforeUnloadResponseAction {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'CONFIRM';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'CANCEL';
|
return 'CANCEL';
|
||||||
|
case 0:
|
||||||
|
return 'CONFIRM';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,6 @@ part of 'js_confirm_request.dart';
|
||||||
|
|
||||||
///Class that represents the request of the [WebView.onJsConfirm] event.
|
///Class that represents the request of the [WebView.onJsConfirm] event.
|
||||||
class JsConfirmRequest {
|
class JsConfirmRequest {
|
||||||
///The url of the page requesting the dialog.
|
|
||||||
WebUri? url;
|
|
||||||
|
|
||||||
///Message to be displayed in the window.
|
|
||||||
String? message;
|
|
||||||
|
|
||||||
///Use [isMainFrame] instead.
|
///Use [isMainFrame] instead.
|
||||||
@Deprecated('Use isMainFrame instead')
|
@Deprecated('Use isMainFrame instead')
|
||||||
bool? iosIsMainFrame;
|
bool? iosIsMainFrame;
|
||||||
|
@ -24,11 +18,17 @@ class JsConfirmRequest {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
bool? isMainFrame;
|
bool? isMainFrame;
|
||||||
|
|
||||||
|
///Message to be displayed in the window.
|
||||||
|
String? message;
|
||||||
|
|
||||||
|
///The url of the page requesting the dialog.
|
||||||
|
WebUri? url;
|
||||||
JsConfirmRequest(
|
JsConfirmRequest(
|
||||||
{this.url,
|
{@Deprecated('Use isMainFrame instead') this.iosIsMainFrame,
|
||||||
|
this.isMainFrame,
|
||||||
this.message,
|
this.message,
|
||||||
@Deprecated('Use isMainFrame instead') this.iosIsMainFrame,
|
this.url}) {
|
||||||
this.isMainFrame}) {
|
|
||||||
isMainFrame = isMainFrame ?? iosIsMainFrame;
|
isMainFrame = isMainFrame ?? iosIsMainFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ class JsConfirmRequest {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = JsConfirmRequest(
|
final instance = JsConfirmRequest(
|
||||||
url: map['url'] != null ? WebUri(map['url']) : null,
|
|
||||||
message: map['message'],
|
|
||||||
iosIsMainFrame: map['isMainFrame'],
|
iosIsMainFrame: map['isMainFrame'],
|
||||||
isMainFrame: map['isMainFrame'],
|
isMainFrame: map['isMainFrame'],
|
||||||
|
message: map['message'],
|
||||||
|
url: map['url'] != null ? WebUri(map['url']) : null,
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -49,9 +49,9 @@ class JsConfirmRequest {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"url": url?.toString(),
|
|
||||||
"message": message,
|
|
||||||
"isMainFrame": isMainFrame,
|
"isMainFrame": isMainFrame,
|
||||||
|
"message": message,
|
||||||
|
"url": url?.toString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,6 @@ class JsConfirmRequest {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'JsConfirmRequest{url: $url, message: $message, isMainFrame: $isMainFrame}';
|
return 'JsConfirmRequest{isMainFrame: $isMainFrame, message: $message, url: $url}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,26 +8,26 @@ part of 'js_confirm_response.dart';
|
||||||
|
|
||||||
///Class that represents the response used by the [WebView.onJsConfirm] event to control a JavaScript confirm dialog.
|
///Class that represents the response used by the [WebView.onJsConfirm] event to control a JavaScript confirm dialog.
|
||||||
class JsConfirmResponse {
|
class JsConfirmResponse {
|
||||||
///Message to be displayed in the window.
|
///Action used to confirm that the user hit confirm or cancel button.
|
||||||
String message;
|
JsConfirmResponseAction? action;
|
||||||
|
|
||||||
///Title of the confirm button.
|
|
||||||
String confirmButtonTitle;
|
|
||||||
|
|
||||||
///Title of the cancel button.
|
///Title of the cancel button.
|
||||||
String cancelButtonTitle;
|
String cancelButtonTitle;
|
||||||
|
|
||||||
|
///Title of the confirm button.
|
||||||
|
String confirmButtonTitle;
|
||||||
|
|
||||||
///Whether the client will handle the confirm dialog.
|
///Whether the client will handle the confirm dialog.
|
||||||
bool handledByClient;
|
bool handledByClient;
|
||||||
|
|
||||||
///Action used to confirm that the user hit confirm or cancel button.
|
///Message to be displayed in the window.
|
||||||
JsConfirmResponseAction? action;
|
String message;
|
||||||
JsConfirmResponse(
|
JsConfirmResponse(
|
||||||
{this.message = "",
|
{this.action = JsConfirmResponseAction.CANCEL,
|
||||||
this.confirmButtonTitle = "",
|
|
||||||
this.cancelButtonTitle = "",
|
this.cancelButtonTitle = "",
|
||||||
|
this.confirmButtonTitle = "",
|
||||||
this.handledByClient = false,
|
this.handledByClient = false,
|
||||||
this.action = JsConfirmResponseAction.CANCEL});
|
this.message = ""});
|
||||||
|
|
||||||
///Gets a possible [JsConfirmResponse] instance from a [Map] value.
|
///Gets a possible [JsConfirmResponse] instance from a [Map] value.
|
||||||
static JsConfirmResponse? fromMap(Map<String, dynamic>? map) {
|
static JsConfirmResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -35,22 +35,22 @@ class JsConfirmResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = JsConfirmResponse();
|
final instance = JsConfirmResponse();
|
||||||
instance.message = map['message'];
|
|
||||||
instance.confirmButtonTitle = map['confirmButtonTitle'];
|
|
||||||
instance.cancelButtonTitle = map['cancelButtonTitle'];
|
|
||||||
instance.handledByClient = map['handledByClient'];
|
|
||||||
instance.action = JsConfirmResponseAction.fromNativeValue(map['action']);
|
instance.action = JsConfirmResponseAction.fromNativeValue(map['action']);
|
||||||
|
instance.cancelButtonTitle = map['cancelButtonTitle'];
|
||||||
|
instance.confirmButtonTitle = map['confirmButtonTitle'];
|
||||||
|
instance.handledByClient = map['handledByClient'];
|
||||||
|
instance.message = map['message'];
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"message": message,
|
|
||||||
"confirmButtonTitle": confirmButtonTitle,
|
|
||||||
"cancelButtonTitle": cancelButtonTitle,
|
|
||||||
"handledByClient": handledByClient,
|
|
||||||
"action": action?.toNativeValue(),
|
"action": action?.toNativeValue(),
|
||||||
|
"cancelButtonTitle": cancelButtonTitle,
|
||||||
|
"confirmButtonTitle": confirmButtonTitle,
|
||||||
|
"handledByClient": handledByClient,
|
||||||
|
"message": message,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +61,6 @@ class JsConfirmResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'JsConfirmResponse{message: $message, confirmButtonTitle: $confirmButtonTitle, cancelButtonTitle: $cancelButtonTitle, handledByClient: $handledByClient, action: $action}';
|
return 'JsConfirmResponse{action: $action, cancelButtonTitle: $cancelButtonTitle, confirmButtonTitle: $confirmButtonTitle, handledByClient: $handledByClient, message: $message}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,16 +16,16 @@ class JsConfirmResponseAction {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
JsConfirmResponseAction._internal(value, nativeValue());
|
JsConfirmResponseAction._internal(value, nativeValue());
|
||||||
|
|
||||||
///Confirm that the user hit confirm button.
|
|
||||||
static const CONFIRM = JsConfirmResponseAction._internal(0, 0);
|
|
||||||
|
|
||||||
///Confirm that the user hit cancel button.
|
///Confirm that the user hit cancel button.
|
||||||
static const CANCEL = JsConfirmResponseAction._internal(1, 1);
|
static const CANCEL = JsConfirmResponseAction._internal(1, 1);
|
||||||
|
|
||||||
|
///Confirm that the user hit confirm button.
|
||||||
|
static const CONFIRM = JsConfirmResponseAction._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [JsConfirmResponseAction].
|
///Set of all values of [JsConfirmResponseAction].
|
||||||
static final Set<JsConfirmResponseAction> values = [
|
static final Set<JsConfirmResponseAction> values = [
|
||||||
JsConfirmResponseAction.CONFIRM,
|
|
||||||
JsConfirmResponseAction.CANCEL,
|
JsConfirmResponseAction.CANCEL,
|
||||||
|
JsConfirmResponseAction.CONFIRM,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [JsConfirmResponseAction] instance from [int] value.
|
///Gets a possible [JsConfirmResponseAction] instance from [int] value.
|
||||||
|
@ -69,10 +69,10 @@ class JsConfirmResponseAction {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'CONFIRM';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'CANCEL';
|
return 'CANCEL';
|
||||||
|
case 0:
|
||||||
|
return 'CONFIRM';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,6 @@ part of 'js_prompt_request.dart';
|
||||||
|
|
||||||
///Class that represents the request of the [WebView.onJsPrompt] event.
|
///Class that represents the request of the [WebView.onJsPrompt] event.
|
||||||
class JsPromptRequest {
|
class JsPromptRequest {
|
||||||
///The url of the page requesting the dialog.
|
|
||||||
WebUri? url;
|
|
||||||
|
|
||||||
///Message to be displayed in the window.
|
|
||||||
String? message;
|
|
||||||
|
|
||||||
///The default value displayed in the prompt dialog.
|
///The default value displayed in the prompt dialog.
|
||||||
String? defaultValue;
|
String? defaultValue;
|
||||||
|
|
||||||
|
@ -27,12 +21,18 @@ class JsPromptRequest {
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
bool? isMainFrame;
|
bool? isMainFrame;
|
||||||
|
|
||||||
|
///Message to be displayed in the window.
|
||||||
|
String? message;
|
||||||
|
|
||||||
|
///The url of the page requesting the dialog.
|
||||||
|
WebUri? url;
|
||||||
JsPromptRequest(
|
JsPromptRequest(
|
||||||
{this.url,
|
{this.defaultValue,
|
||||||
this.message,
|
|
||||||
this.defaultValue,
|
|
||||||
@Deprecated('Use isMainFrame instead') this.iosIsMainFrame,
|
@Deprecated('Use isMainFrame instead') this.iosIsMainFrame,
|
||||||
this.isMainFrame}) {
|
this.isMainFrame,
|
||||||
|
this.message,
|
||||||
|
this.url}) {
|
||||||
isMainFrame = isMainFrame ?? iosIsMainFrame;
|
isMainFrame = isMainFrame ?? iosIsMainFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,11 +42,11 @@ class JsPromptRequest {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = JsPromptRequest(
|
final instance = JsPromptRequest(
|
||||||
url: map['url'] != null ? WebUri(map['url']) : null,
|
|
||||||
message: map['message'],
|
|
||||||
defaultValue: map['defaultValue'],
|
defaultValue: map['defaultValue'],
|
||||||
iosIsMainFrame: map['isMainFrame'],
|
iosIsMainFrame: map['isMainFrame'],
|
||||||
isMainFrame: map['isMainFrame'],
|
isMainFrame: map['isMainFrame'],
|
||||||
|
message: map['message'],
|
||||||
|
url: map['url'] != null ? WebUri(map['url']) : null,
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -54,10 +54,10 @@ class JsPromptRequest {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"url": url?.toString(),
|
|
||||||
"message": message,
|
|
||||||
"defaultValue": defaultValue,
|
"defaultValue": defaultValue,
|
||||||
"isMainFrame": isMainFrame,
|
"isMainFrame": isMainFrame,
|
||||||
|
"message": message,
|
||||||
|
"url": url?.toString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +68,6 @@ class JsPromptRequest {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'JsPromptRequest{url: $url, message: $message, defaultValue: $defaultValue, isMainFrame: $isMainFrame}';
|
return 'JsPromptRequest{defaultValue: $defaultValue, isMainFrame: $isMainFrame, message: $message, url: $url}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,34 +8,34 @@ part of 'js_prompt_response.dart';
|
||||||
|
|
||||||
///Class that represents the response used by the [WebView.onJsPrompt] event to control a JavaScript prompt dialog.
|
///Class that represents the response used by the [WebView.onJsPrompt] event to control a JavaScript prompt dialog.
|
||||||
class JsPromptResponse {
|
class JsPromptResponse {
|
||||||
///Message to be displayed in the window.
|
///Action used to confirm that the user hit confirm or cancel button.
|
||||||
String message;
|
JsPromptResponseAction? action;
|
||||||
|
|
||||||
///The default value displayed in the prompt dialog.
|
|
||||||
String defaultValue;
|
|
||||||
|
|
||||||
///Title of the confirm button.
|
|
||||||
String confirmButtonTitle;
|
|
||||||
|
|
||||||
///Title of the cancel button.
|
///Title of the cancel button.
|
||||||
String cancelButtonTitle;
|
String cancelButtonTitle;
|
||||||
|
|
||||||
|
///Title of the confirm button.
|
||||||
|
String confirmButtonTitle;
|
||||||
|
|
||||||
|
///The default value displayed in the prompt dialog.
|
||||||
|
String defaultValue;
|
||||||
|
|
||||||
///Whether the client will handle the prompt dialog.
|
///Whether the client will handle the prompt dialog.
|
||||||
bool handledByClient;
|
bool handledByClient;
|
||||||
|
|
||||||
|
///Message to be displayed in the window.
|
||||||
|
String message;
|
||||||
|
|
||||||
///Value of the prompt dialog.
|
///Value of the prompt dialog.
|
||||||
String? value;
|
String? value;
|
||||||
|
|
||||||
///Action used to confirm that the user hit confirm or cancel button.
|
|
||||||
JsPromptResponseAction? action;
|
|
||||||
JsPromptResponse(
|
JsPromptResponse(
|
||||||
{this.message = "",
|
{this.action = JsPromptResponseAction.CANCEL,
|
||||||
this.defaultValue = "",
|
|
||||||
this.confirmButtonTitle = "",
|
|
||||||
this.cancelButtonTitle = "",
|
this.cancelButtonTitle = "",
|
||||||
|
this.confirmButtonTitle = "",
|
||||||
|
this.defaultValue = "",
|
||||||
this.handledByClient = false,
|
this.handledByClient = false,
|
||||||
this.value,
|
this.message = "",
|
||||||
this.action = JsPromptResponseAction.CANCEL});
|
this.value});
|
||||||
|
|
||||||
///Gets a possible [JsPromptResponse] instance from a [Map] value.
|
///Gets a possible [JsPromptResponse] instance from a [Map] value.
|
||||||
static JsPromptResponse? fromMap(Map<String, dynamic>? map) {
|
static JsPromptResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -45,25 +45,25 @@ class JsPromptResponse {
|
||||||
final instance = JsPromptResponse(
|
final instance = JsPromptResponse(
|
||||||
value: map['value'],
|
value: map['value'],
|
||||||
);
|
);
|
||||||
instance.message = map['message'];
|
|
||||||
instance.defaultValue = map['defaultValue'];
|
|
||||||
instance.confirmButtonTitle = map['confirmButtonTitle'];
|
|
||||||
instance.cancelButtonTitle = map['cancelButtonTitle'];
|
|
||||||
instance.handledByClient = map['handledByClient'];
|
|
||||||
instance.action = JsPromptResponseAction.fromNativeValue(map['action']);
|
instance.action = JsPromptResponseAction.fromNativeValue(map['action']);
|
||||||
|
instance.cancelButtonTitle = map['cancelButtonTitle'];
|
||||||
|
instance.confirmButtonTitle = map['confirmButtonTitle'];
|
||||||
|
instance.defaultValue = map['defaultValue'];
|
||||||
|
instance.handledByClient = map['handledByClient'];
|
||||||
|
instance.message = map['message'];
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"message": message,
|
|
||||||
"defaultValue": defaultValue,
|
|
||||||
"confirmButtonTitle": confirmButtonTitle,
|
|
||||||
"cancelButtonTitle": cancelButtonTitle,
|
|
||||||
"handledByClient": handledByClient,
|
|
||||||
"value": value,
|
|
||||||
"action": action?.toNativeValue(),
|
"action": action?.toNativeValue(),
|
||||||
|
"cancelButtonTitle": cancelButtonTitle,
|
||||||
|
"confirmButtonTitle": confirmButtonTitle,
|
||||||
|
"defaultValue": defaultValue,
|
||||||
|
"handledByClient": handledByClient,
|
||||||
|
"message": message,
|
||||||
|
"value": value,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +74,6 @@ class JsPromptResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'JsPromptResponse{message: $message, defaultValue: $defaultValue, confirmButtonTitle: $confirmButtonTitle, cancelButtonTitle: $cancelButtonTitle, handledByClient: $handledByClient, value: $value, action: $action}';
|
return 'JsPromptResponse{action: $action, cancelButtonTitle: $cancelButtonTitle, confirmButtonTitle: $confirmButtonTitle, defaultValue: $defaultValue, handledByClient: $handledByClient, message: $message, value: $value}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,16 +16,16 @@ class JsPromptResponseAction {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
JsPromptResponseAction._internal(value, nativeValue());
|
JsPromptResponseAction._internal(value, nativeValue());
|
||||||
|
|
||||||
///Confirm that the user hit confirm button.
|
|
||||||
static const CONFIRM = JsPromptResponseAction._internal(0, 0);
|
|
||||||
|
|
||||||
///Confirm that the user hit cancel button.
|
///Confirm that the user hit cancel button.
|
||||||
static const CANCEL = JsPromptResponseAction._internal(1, 1);
|
static const CANCEL = JsPromptResponseAction._internal(1, 1);
|
||||||
|
|
||||||
|
///Confirm that the user hit confirm button.
|
||||||
|
static const CONFIRM = JsPromptResponseAction._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [JsPromptResponseAction].
|
///Set of all values of [JsPromptResponseAction].
|
||||||
static final Set<JsPromptResponseAction> values = [
|
static final Set<JsPromptResponseAction> values = [
|
||||||
JsPromptResponseAction.CONFIRM,
|
|
||||||
JsPromptResponseAction.CANCEL,
|
JsPromptResponseAction.CANCEL,
|
||||||
|
JsPromptResponseAction.CONFIRM,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [JsPromptResponseAction] instance from [int] value.
|
///Gets a possible [JsPromptResponseAction] instance from [int] value.
|
||||||
|
@ -69,10 +69,10 @@ class JsPromptResponseAction {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'CONFIRM';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'CANCEL';
|
return 'CANCEL';
|
||||||
|
case 0:
|
||||||
|
return 'CONFIRM';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||||
|
|
||||||
import '../in_app_webview/in_app_webview_settings.dart';
|
import '../in_app_webview/in_app_webview_settings.dart';
|
||||||
import '../in_app_webview/android/in_app_webview_options.dart';
|
|
||||||
|
|
||||||
part 'layout_algorithm.g.dart';
|
part 'layout_algorithm.g.dart';
|
||||||
|
|
||||||
|
@ -40,7 +39,7 @@ class AndroidLayoutAlgorithm_ {
|
||||||
static const NORMAL = const AndroidLayoutAlgorithm_._internal("NORMAL");
|
static const NORMAL = const AndroidLayoutAlgorithm_._internal("NORMAL");
|
||||||
|
|
||||||
///TEXT_AUTOSIZING boosts font size of paragraphs based on heuristics to make the text readable when viewing a wide-viewport layout in the overview mode.
|
///TEXT_AUTOSIZING boosts font size of paragraphs based on heuristics to make the text readable when viewing a wide-viewport layout in the overview mode.
|
||||||
///It is recommended to enable zoom support [AndroidInAppWebViewOptions.supportZoom] when using this mode.
|
///It is recommended to enable zoom support [InAppWebViewOptions.supportZoom] when using this mode.
|
||||||
///
|
///
|
||||||
///**NOTE**: available on Android 19+.
|
///**NOTE**: available on Android 19+.
|
||||||
static const TEXT_AUTOSIZING =
|
static const TEXT_AUTOSIZING =
|
||||||
|
|
|
@ -16,6 +16,10 @@ class LayoutAlgorithm {
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
LayoutAlgorithm._internal(value, nativeValue());
|
LayoutAlgorithm._internal(value, nativeValue());
|
||||||
|
|
||||||
|
///NARROW_COLUMNS makes all columns no wider than the screen if possible. Only use this for API levels prior to `Build.VERSION_CODES.KITKAT`.
|
||||||
|
static const NARROW_COLUMNS =
|
||||||
|
LayoutAlgorithm._internal('NARROW_COLUMNS', 'NARROW_COLUMNS');
|
||||||
|
|
||||||
///NORMAL means no rendering changes. This is the recommended choice for maximum compatibility across different platforms and Android versions.
|
///NORMAL means no rendering changes. This is the recommended choice for maximum compatibility across different platforms and Android versions.
|
||||||
static const NORMAL = LayoutAlgorithm._internal('NORMAL', 'NORMAL');
|
static const NORMAL = LayoutAlgorithm._internal('NORMAL', 'NORMAL');
|
||||||
|
|
||||||
|
@ -26,15 +30,11 @@ class LayoutAlgorithm {
|
||||||
static const TEXT_AUTOSIZING =
|
static const TEXT_AUTOSIZING =
|
||||||
LayoutAlgorithm._internal('TEXT_AUTOSIZING', 'TEXT_AUTOSIZING');
|
LayoutAlgorithm._internal('TEXT_AUTOSIZING', 'TEXT_AUTOSIZING');
|
||||||
|
|
||||||
///NARROW_COLUMNS makes all columns no wider than the screen if possible. Only use this for API levels prior to `Build.VERSION_CODES.KITKAT`.
|
|
||||||
static const NARROW_COLUMNS =
|
|
||||||
LayoutAlgorithm._internal('NARROW_COLUMNS', 'NARROW_COLUMNS');
|
|
||||||
|
|
||||||
///Set of all values of [LayoutAlgorithm].
|
///Set of all values of [LayoutAlgorithm].
|
||||||
static final Set<LayoutAlgorithm> values = [
|
static final Set<LayoutAlgorithm> values = [
|
||||||
|
LayoutAlgorithm.NARROW_COLUMNS,
|
||||||
LayoutAlgorithm.NORMAL,
|
LayoutAlgorithm.NORMAL,
|
||||||
LayoutAlgorithm.TEXT_AUTOSIZING,
|
LayoutAlgorithm.TEXT_AUTOSIZING,
|
||||||
LayoutAlgorithm.NARROW_COLUMNS,
|
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [LayoutAlgorithm] instance from [String] value.
|
///Gets a possible [LayoutAlgorithm] instance from [String] value.
|
||||||
|
@ -93,25 +93,25 @@ class AndroidLayoutAlgorithm {
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
AndroidLayoutAlgorithm._internal(value, nativeValue());
|
AndroidLayoutAlgorithm._internal(value, nativeValue());
|
||||||
|
|
||||||
|
///NARROW_COLUMNS makes all columns no wider than the screen if possible. Only use this for API levels prior to `Build.VERSION_CODES.KITKAT`.
|
||||||
|
static const NARROW_COLUMNS =
|
||||||
|
AndroidLayoutAlgorithm._internal('NARROW_COLUMNS', 'NARROW_COLUMNS');
|
||||||
|
|
||||||
///NORMAL means no rendering changes. This is the recommended choice for maximum compatibility across different platforms and Android versions.
|
///NORMAL means no rendering changes. This is the recommended choice for maximum compatibility across different platforms and Android versions.
|
||||||
static const NORMAL = AndroidLayoutAlgorithm._internal('NORMAL', 'NORMAL');
|
static const NORMAL = AndroidLayoutAlgorithm._internal('NORMAL', 'NORMAL');
|
||||||
|
|
||||||
///TEXT_AUTOSIZING boosts font size of paragraphs based on heuristics to make the text readable when viewing a wide-viewport layout in the overview mode.
|
///TEXT_AUTOSIZING boosts font size of paragraphs based on heuristics to make the text readable when viewing a wide-viewport layout in the overview mode.
|
||||||
///It is recommended to enable zoom support [AndroidInAppWebViewOptions.supportZoom] when using this mode.
|
///It is recommended to enable zoom support [InAppWebViewOptions.supportZoom] when using this mode.
|
||||||
///
|
///
|
||||||
///**NOTE**: available on Android 19+.
|
///**NOTE**: available on Android 19+.
|
||||||
static const TEXT_AUTOSIZING =
|
static const TEXT_AUTOSIZING =
|
||||||
AndroidLayoutAlgorithm._internal('TEXT_AUTOSIZING', 'TEXT_AUTOSIZING');
|
AndroidLayoutAlgorithm._internal('TEXT_AUTOSIZING', 'TEXT_AUTOSIZING');
|
||||||
|
|
||||||
///NARROW_COLUMNS makes all columns no wider than the screen if possible. Only use this for API levels prior to `Build.VERSION_CODES.KITKAT`.
|
|
||||||
static const NARROW_COLUMNS =
|
|
||||||
AndroidLayoutAlgorithm._internal('NARROW_COLUMNS', 'NARROW_COLUMNS');
|
|
||||||
|
|
||||||
///Set of all values of [AndroidLayoutAlgorithm].
|
///Set of all values of [AndroidLayoutAlgorithm].
|
||||||
static final Set<AndroidLayoutAlgorithm> values = [
|
static final Set<AndroidLayoutAlgorithm> values = [
|
||||||
|
AndroidLayoutAlgorithm.NARROW_COLUMNS,
|
||||||
AndroidLayoutAlgorithm.NORMAL,
|
AndroidLayoutAlgorithm.NORMAL,
|
||||||
AndroidLayoutAlgorithm.TEXT_AUTOSIZING,
|
AndroidLayoutAlgorithm.TEXT_AUTOSIZING,
|
||||||
AndroidLayoutAlgorithm.NARROW_COLUMNS,
|
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [AndroidLayoutAlgorithm] instance from [String] value.
|
///Gets a possible [AndroidLayoutAlgorithm] instance from [String] value.
|
||||||
|
|
|
@ -16,32 +16,32 @@ class LayoutInDisplayCutoutMode {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
LayoutInDisplayCutoutMode._internal(value, nativeValue());
|
LayoutInDisplayCutoutMode._internal(value, nativeValue());
|
||||||
|
|
||||||
|
///The window is always allowed to extend into the DisplayCutout areas on the all edges of the screen.
|
||||||
|
///
|
||||||
|
///**NOTE**: available on Android 30+.
|
||||||
|
static const ALWAYS = LayoutInDisplayCutoutMode._internal(3, 3);
|
||||||
|
|
||||||
///With this default setting, content renders into the cutout area when displayed in portrait mode, but content is letterboxed when displayed in landscape mode.
|
///With this default setting, content renders into the cutout area when displayed in portrait mode, but content is letterboxed when displayed in landscape mode.
|
||||||
///
|
///
|
||||||
///**NOTE**: available on Android 28+.
|
///**NOTE**: available on Android 28+.
|
||||||
static const DEFAULT = LayoutInDisplayCutoutMode._internal(0, 0);
|
static const DEFAULT = LayoutInDisplayCutoutMode._internal(0, 0);
|
||||||
|
|
||||||
///Content renders into the cutout area in both portrait and landscape modes.
|
|
||||||
///
|
|
||||||
///**NOTE**: available on Android 28+.
|
|
||||||
static const SHORT_EDGES = LayoutInDisplayCutoutMode._internal(1, 1);
|
|
||||||
|
|
||||||
///Content never renders into the cutout area.
|
///Content never renders into the cutout area.
|
||||||
///
|
///
|
||||||
///**NOTE**: available on Android 28+.
|
///**NOTE**: available on Android 28+.
|
||||||
static const NEVER = LayoutInDisplayCutoutMode._internal(2, 2);
|
static const NEVER = LayoutInDisplayCutoutMode._internal(2, 2);
|
||||||
|
|
||||||
///The window is always allowed to extend into the DisplayCutout areas on the all edges of the screen.
|
///Content renders into the cutout area in both portrait and landscape modes.
|
||||||
///
|
///
|
||||||
///**NOTE**: available on Android 30+.
|
///**NOTE**: available on Android 28+.
|
||||||
static const ALWAYS = LayoutInDisplayCutoutMode._internal(3, 3);
|
static const SHORT_EDGES = LayoutInDisplayCutoutMode._internal(1, 1);
|
||||||
|
|
||||||
///Set of all values of [LayoutInDisplayCutoutMode].
|
///Set of all values of [LayoutInDisplayCutoutMode].
|
||||||
static final Set<LayoutInDisplayCutoutMode> values = [
|
static final Set<LayoutInDisplayCutoutMode> values = [
|
||||||
LayoutInDisplayCutoutMode.DEFAULT,
|
|
||||||
LayoutInDisplayCutoutMode.SHORT_EDGES,
|
|
||||||
LayoutInDisplayCutoutMode.NEVER,
|
|
||||||
LayoutInDisplayCutoutMode.ALWAYS,
|
LayoutInDisplayCutoutMode.ALWAYS,
|
||||||
|
LayoutInDisplayCutoutMode.DEFAULT,
|
||||||
|
LayoutInDisplayCutoutMode.NEVER,
|
||||||
|
LayoutInDisplayCutoutMode.SHORT_EDGES,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [LayoutInDisplayCutoutMode] instance from [int] value.
|
///Gets a possible [LayoutInDisplayCutoutMode] instance from [int] value.
|
||||||
|
@ -85,14 +85,14 @@ class LayoutInDisplayCutoutMode {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'DEFAULT';
|
|
||||||
case 1:
|
|
||||||
return 'SHORT_EDGES';
|
|
||||||
case 2:
|
|
||||||
return 'NEVER';
|
|
||||||
case 3:
|
case 3:
|
||||||
return 'ALWAYS';
|
return 'ALWAYS';
|
||||||
|
case 0:
|
||||||
|
return 'DEFAULT';
|
||||||
|
case 2:
|
||||||
|
return 'NEVER';
|
||||||
|
case 1:
|
||||||
|
return 'SHORT_EDGES';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
@ -114,32 +114,32 @@ class AndroidLayoutInDisplayCutoutMode {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
AndroidLayoutInDisplayCutoutMode._internal(value, nativeValue());
|
AndroidLayoutInDisplayCutoutMode._internal(value, nativeValue());
|
||||||
|
|
||||||
|
///The window is always allowed to extend into the DisplayCutout areas on the all edges of the screen.
|
||||||
|
///
|
||||||
|
///**NOTE**: available on Android 30+.
|
||||||
|
static const ALWAYS = AndroidLayoutInDisplayCutoutMode._internal(3, 3);
|
||||||
|
|
||||||
///With this default setting, content renders into the cutout area when displayed in portrait mode, but content is letterboxed when displayed in landscape mode.
|
///With this default setting, content renders into the cutout area when displayed in portrait mode, but content is letterboxed when displayed in landscape mode.
|
||||||
///
|
///
|
||||||
///**NOTE**: available on Android 28+.
|
///**NOTE**: available on Android 28+.
|
||||||
static const DEFAULT = AndroidLayoutInDisplayCutoutMode._internal(0, 0);
|
static const DEFAULT = AndroidLayoutInDisplayCutoutMode._internal(0, 0);
|
||||||
|
|
||||||
///Content renders into the cutout area in both portrait and landscape modes.
|
|
||||||
///
|
|
||||||
///**NOTE**: available on Android 28+.
|
|
||||||
static const SHORT_EDGES = AndroidLayoutInDisplayCutoutMode._internal(1, 1);
|
|
||||||
|
|
||||||
///Content never renders into the cutout area.
|
///Content never renders into the cutout area.
|
||||||
///
|
///
|
||||||
///**NOTE**: available on Android 28+.
|
///**NOTE**: available on Android 28+.
|
||||||
static const NEVER = AndroidLayoutInDisplayCutoutMode._internal(2, 2);
|
static const NEVER = AndroidLayoutInDisplayCutoutMode._internal(2, 2);
|
||||||
|
|
||||||
///The window is always allowed to extend into the DisplayCutout areas on the all edges of the screen.
|
///Content renders into the cutout area in both portrait and landscape modes.
|
||||||
///
|
///
|
||||||
///**NOTE**: available on Android 30+.
|
///**NOTE**: available on Android 28+.
|
||||||
static const ALWAYS = AndroidLayoutInDisplayCutoutMode._internal(3, 3);
|
static const SHORT_EDGES = AndroidLayoutInDisplayCutoutMode._internal(1, 1);
|
||||||
|
|
||||||
///Set of all values of [AndroidLayoutInDisplayCutoutMode].
|
///Set of all values of [AndroidLayoutInDisplayCutoutMode].
|
||||||
static final Set<AndroidLayoutInDisplayCutoutMode> values = [
|
static final Set<AndroidLayoutInDisplayCutoutMode> values = [
|
||||||
AndroidLayoutInDisplayCutoutMode.DEFAULT,
|
|
||||||
AndroidLayoutInDisplayCutoutMode.SHORT_EDGES,
|
|
||||||
AndroidLayoutInDisplayCutoutMode.NEVER,
|
|
||||||
AndroidLayoutInDisplayCutoutMode.ALWAYS,
|
AndroidLayoutInDisplayCutoutMode.ALWAYS,
|
||||||
|
AndroidLayoutInDisplayCutoutMode.DEFAULT,
|
||||||
|
AndroidLayoutInDisplayCutoutMode.NEVER,
|
||||||
|
AndroidLayoutInDisplayCutoutMode.SHORT_EDGES,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [AndroidLayoutInDisplayCutoutMode] instance from [int] value.
|
///Gets a possible [AndroidLayoutInDisplayCutoutMode] instance from [int] value.
|
||||||
|
@ -183,14 +183,14 @@ class AndroidLayoutInDisplayCutoutMode {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'DEFAULT';
|
|
||||||
case 1:
|
|
||||||
return 'SHORT_EDGES';
|
|
||||||
case 2:
|
|
||||||
return 'NEVER';
|
|
||||||
case 3:
|
case 3:
|
||||||
return 'ALWAYS';
|
return 'ALWAYS';
|
||||||
|
case 0:
|
||||||
|
return 'DEFAULT';
|
||||||
|
case 2:
|
||||||
|
return 'NEVER';
|
||||||
|
case 1:
|
||||||
|
return 'SHORT_EDGES';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,18 +9,18 @@ part of 'loaded_resource.dart';
|
||||||
///Class representing a resource response of the [WebView].
|
///Class representing a resource response of the [WebView].
|
||||||
///It is used by the method [WebView.onLoadResource].
|
///It is used by the method [WebView.onLoadResource].
|
||||||
class LoadedResource {
|
class LoadedResource {
|
||||||
|
///Returns the [DOMHighResTimeStamp](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) duration to fetch a resource.
|
||||||
|
double? duration;
|
||||||
|
|
||||||
///A string representing the type of resource.
|
///A string representing the type of resource.
|
||||||
String? initiatorType;
|
String? initiatorType;
|
||||||
|
|
||||||
///Resource URL.
|
|
||||||
WebUri? url;
|
|
||||||
|
|
||||||
///Returns the [DOMHighResTimeStamp](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) for the time a resource fetch started.
|
///Returns the [DOMHighResTimeStamp](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) for the time a resource fetch started.
|
||||||
double? startTime;
|
double? startTime;
|
||||||
|
|
||||||
///Returns the [DOMHighResTimeStamp](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp) duration to fetch a resource.
|
///Resource URL.
|
||||||
double? duration;
|
WebUri? url;
|
||||||
LoadedResource({this.initiatorType, this.url, this.startTime, this.duration});
|
LoadedResource({this.duration, this.initiatorType, this.startTime, this.url});
|
||||||
|
|
||||||
///Gets a possible [LoadedResource] instance from a [Map] value.
|
///Gets a possible [LoadedResource] instance from a [Map] value.
|
||||||
static LoadedResource? fromMap(Map<String, dynamic>? map) {
|
static LoadedResource? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -28,10 +28,10 @@ class LoadedResource {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = LoadedResource(
|
final instance = LoadedResource(
|
||||||
initiatorType: map['initiatorType'],
|
|
||||||
url: map['url'] != null ? WebUri(map['url']) : null,
|
|
||||||
startTime: map['startTime'],
|
|
||||||
duration: map['duration'],
|
duration: map['duration'],
|
||||||
|
initiatorType: map['initiatorType'],
|
||||||
|
startTime: map['startTime'],
|
||||||
|
url: map['url'] != null ? WebUri(map['url']) : null,
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -39,10 +39,10 @@ class LoadedResource {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"initiatorType": initiatorType,
|
|
||||||
"url": url?.toString(),
|
|
||||||
"startTime": startTime,
|
|
||||||
"duration": duration,
|
"duration": duration,
|
||||||
|
"initiatorType": initiatorType,
|
||||||
|
"startTime": startTime,
|
||||||
|
"url": url?.toString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,6 @@ class LoadedResource {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'LoadedResource{initiatorType: $initiatorType, url: $url, startTime: $startTime, duration: $duration}';
|
return 'LoadedResource{duration: $duration, initiatorType: $initiatorType, startTime: $startTime, url: $url}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,16 +8,16 @@ part of 'login_request.dart';
|
||||||
|
|
||||||
///Class used by [WebView.onReceivedLoginRequest] event.
|
///Class used by [WebView.onReceivedLoginRequest] event.
|
||||||
class LoginRequest {
|
class LoginRequest {
|
||||||
///The account realm used to look up accounts.
|
|
||||||
String realm;
|
|
||||||
|
|
||||||
///An optional account. If not `null`, the account should be checked against accounts on the device.
|
///An optional account. If not `null`, the account should be checked against accounts on the device.
|
||||||
///If it is a valid account, it should be used to log in the user. This value may be `null`.
|
///If it is a valid account, it should be used to log in the user. This value may be `null`.
|
||||||
String? account;
|
String? account;
|
||||||
|
|
||||||
///Authenticator specific arguments used to log in the user.
|
///Authenticator specific arguments used to log in the user.
|
||||||
String args;
|
String args;
|
||||||
LoginRequest({required this.realm, this.account, required this.args});
|
|
||||||
|
///The account realm used to look up accounts.
|
||||||
|
String realm;
|
||||||
|
LoginRequest({this.account, required this.args, required this.realm});
|
||||||
|
|
||||||
///Gets a possible [LoginRequest] instance from a [Map] value.
|
///Gets a possible [LoginRequest] instance from a [Map] value.
|
||||||
static LoginRequest? fromMap(Map<String, dynamic>? map) {
|
static LoginRequest? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -25,9 +25,9 @@ class LoginRequest {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = LoginRequest(
|
final instance = LoginRequest(
|
||||||
realm: map['realm'],
|
|
||||||
account: map['account'],
|
account: map['account'],
|
||||||
args: map['args'],
|
args: map['args'],
|
||||||
|
realm: map['realm'],
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -35,9 +35,9 @@ class LoginRequest {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"realm": realm,
|
|
||||||
"account": account,
|
"account": account,
|
||||||
"args": args,
|
"args": args,
|
||||||
|
"realm": realm,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,6 @@ class LoginRequest {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'LoginRequest{realm: $realm, account: $account, args: $args}';
|
return 'LoginRequest{account: $account, args: $args, realm: $realm}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,20 +16,20 @@ class MediaCaptureState {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
MediaCaptureState._internal(value, nativeValue());
|
MediaCaptureState._internal(value, nativeValue());
|
||||||
|
|
||||||
///The media device is off.
|
|
||||||
static const NONE = MediaCaptureState._internal(0, 0);
|
|
||||||
|
|
||||||
///The media device is actively capturing audio or video.
|
///The media device is actively capturing audio or video.
|
||||||
static const ACTIVE = MediaCaptureState._internal(1, 1);
|
static const ACTIVE = MediaCaptureState._internal(1, 1);
|
||||||
|
|
||||||
///The media device is muted, and not actively capturing audio or video.
|
///The media device is muted, and not actively capturing audio or video.
|
||||||
static const MUTED = MediaCaptureState._internal(2, 2);
|
static const MUTED = MediaCaptureState._internal(2, 2);
|
||||||
|
|
||||||
|
///The media device is off.
|
||||||
|
static const NONE = MediaCaptureState._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [MediaCaptureState].
|
///Set of all values of [MediaCaptureState].
|
||||||
static final Set<MediaCaptureState> values = [
|
static final Set<MediaCaptureState> values = [
|
||||||
MediaCaptureState.NONE,
|
|
||||||
MediaCaptureState.ACTIVE,
|
MediaCaptureState.ACTIVE,
|
||||||
MediaCaptureState.MUTED,
|
MediaCaptureState.MUTED,
|
||||||
|
MediaCaptureState.NONE,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [MediaCaptureState] instance from [int] value.
|
///Gets a possible [MediaCaptureState] instance from [int] value.
|
||||||
|
@ -73,12 +73,12 @@ class MediaCaptureState {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'NONE';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'ACTIVE';
|
return 'ACTIVE';
|
||||||
case 2:
|
case 2:
|
||||||
return 'MUTED';
|
return 'MUTED';
|
||||||
|
case 0:
|
||||||
|
return 'NONE';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,20 +19,20 @@ class MediaPlaybackState {
|
||||||
///There is no media to play back.
|
///There is no media to play back.
|
||||||
static const NONE = MediaPlaybackState._internal(0, 0);
|
static const NONE = MediaPlaybackState._internal(0, 0);
|
||||||
|
|
||||||
///The media is playing.
|
|
||||||
static const PLAYING = MediaPlaybackState._internal(1, 1);
|
|
||||||
|
|
||||||
///The media playback is paused.
|
///The media playback is paused.
|
||||||
static const PAUSED = MediaPlaybackState._internal(2, 2);
|
static const PAUSED = MediaPlaybackState._internal(2, 2);
|
||||||
|
|
||||||
|
///The media is playing.
|
||||||
|
static const PLAYING = MediaPlaybackState._internal(1, 1);
|
||||||
|
|
||||||
///The media is not playing, and cannot be resumed until the user revokes the suspension.
|
///The media is not playing, and cannot be resumed until the user revokes the suspension.
|
||||||
static const SUSPENDED = MediaPlaybackState._internal(3, 3);
|
static const SUSPENDED = MediaPlaybackState._internal(3, 3);
|
||||||
|
|
||||||
///Set of all values of [MediaPlaybackState].
|
///Set of all values of [MediaPlaybackState].
|
||||||
static final Set<MediaPlaybackState> values = [
|
static final Set<MediaPlaybackState> values = [
|
||||||
MediaPlaybackState.NONE,
|
MediaPlaybackState.NONE,
|
||||||
MediaPlaybackState.PLAYING,
|
|
||||||
MediaPlaybackState.PAUSED,
|
MediaPlaybackState.PAUSED,
|
||||||
|
MediaPlaybackState.PLAYING,
|
||||||
MediaPlaybackState.SUSPENDED,
|
MediaPlaybackState.SUSPENDED,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
|
@ -79,10 +79,10 @@ class MediaPlaybackState {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 0:
|
||||||
return 'NONE';
|
return 'NONE';
|
||||||
case 1:
|
|
||||||
return 'PLAYING';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'PAUSED';
|
return 'PAUSED';
|
||||||
|
case 1:
|
||||||
|
return 'PLAYING';
|
||||||
case 3:
|
case 3:
|
||||||
return 'SUSPENDED';
|
return 'SUSPENDED';
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,15 +8,15 @@ part of 'meta_tag.dart';
|
||||||
|
|
||||||
///Class that represents a `<meta>` HTML tag. It is used by the [InAppWebViewController.getMetaTags] method.
|
///Class that represents a `<meta>` HTML tag. It is used by the [InAppWebViewController.getMetaTags] method.
|
||||||
class MetaTag {
|
class MetaTag {
|
||||||
///The meta tag name value.
|
///The meta tag attributes list.
|
||||||
String? name;
|
List<MetaTagAttribute>? attrs;
|
||||||
|
|
||||||
///The meta tag content value.
|
///The meta tag content value.
|
||||||
String? content;
|
String? content;
|
||||||
|
|
||||||
///The meta tag attributes list.
|
///The meta tag name value.
|
||||||
List<MetaTagAttribute>? attrs;
|
String? name;
|
||||||
MetaTag({this.name, this.content, this.attrs});
|
MetaTag({this.attrs, this.content, this.name});
|
||||||
|
|
||||||
///Gets a possible [MetaTag] instance from a [Map] value.
|
///Gets a possible [MetaTag] instance from a [Map] value.
|
||||||
static MetaTag? fromMap(Map<String, dynamic>? map) {
|
static MetaTag? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -24,12 +24,12 @@ class MetaTag {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = MetaTag(
|
final instance = MetaTag(
|
||||||
name: map['name'],
|
|
||||||
content: map['content'],
|
|
||||||
attrs: map['attrs'] != null
|
attrs: map['attrs'] != null
|
||||||
? List<MetaTagAttribute>.from(map['attrs'].map(
|
? List<MetaTagAttribute>.from(map['attrs'].map(
|
||||||
(e) => MetaTagAttribute.fromMap(e?.cast<String, dynamic>())!))
|
(e) => MetaTagAttribute.fromMap(e?.cast<String, dynamic>())!))
|
||||||
: null,
|
: null,
|
||||||
|
content: map['content'],
|
||||||
|
name: map['name'],
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,9 @@ class MetaTag {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"name": name,
|
|
||||||
"content": content,
|
|
||||||
"attrs": attrs?.map((e) => e.toMap()).toList(),
|
"attrs": attrs?.map((e) => e.toMap()).toList(),
|
||||||
|
"content": content,
|
||||||
|
"name": name,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,6 @@ class MetaTag {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'MetaTag{name: $name, content: $content, attrs: $attrs}';
|
return 'MetaTag{attrs: $attrs, content: $content, name: $name}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,6 @@ class MixedContentMode {
|
||||||
///This is the least secure mode of operation for the WebView, and where possible apps should not set this mode.
|
///This is the least secure mode of operation for the WebView, and where possible apps should not set this mode.
|
||||||
static const MIXED_CONTENT_ALWAYS_ALLOW = MixedContentMode._internal(0, 0);
|
static const MIXED_CONTENT_ALWAYS_ALLOW = MixedContentMode._internal(0, 0);
|
||||||
|
|
||||||
///In this mode, the WebView will not allow a secure origin to load content from an insecure origin.
|
|
||||||
///This is the preferred and most secure mode of operation for the WebView and apps are strongly advised to use this mode.
|
|
||||||
static const MIXED_CONTENT_NEVER_ALLOW = MixedContentMode._internal(1, 1);
|
|
||||||
|
|
||||||
///In this mode, the WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
|
///In this mode, the WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
|
||||||
///Some insecure content may be allowed to be loaded by a secure origin and other types of content will be blocked.
|
///Some insecure content may be allowed to be loaded by a secure origin and other types of content will be blocked.
|
||||||
///The types of content are allowed or blocked may change release to release and are not explicitly defined.
|
///The types of content are allowed or blocked may change release to release and are not explicitly defined.
|
||||||
|
@ -32,11 +28,15 @@ class MixedContentMode {
|
||||||
static const MIXED_CONTENT_COMPATIBILITY_MODE =
|
static const MIXED_CONTENT_COMPATIBILITY_MODE =
|
||||||
MixedContentMode._internal(2, 2);
|
MixedContentMode._internal(2, 2);
|
||||||
|
|
||||||
|
///In this mode, the WebView will not allow a secure origin to load content from an insecure origin.
|
||||||
|
///This is the preferred and most secure mode of operation for the WebView and apps are strongly advised to use this mode.
|
||||||
|
static const MIXED_CONTENT_NEVER_ALLOW = MixedContentMode._internal(1, 1);
|
||||||
|
|
||||||
///Set of all values of [MixedContentMode].
|
///Set of all values of [MixedContentMode].
|
||||||
static final Set<MixedContentMode> values = [
|
static final Set<MixedContentMode> values = [
|
||||||
MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW,
|
MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW,
|
||||||
MixedContentMode.MIXED_CONTENT_NEVER_ALLOW,
|
|
||||||
MixedContentMode.MIXED_CONTENT_COMPATIBILITY_MODE,
|
MixedContentMode.MIXED_CONTENT_COMPATIBILITY_MODE,
|
||||||
|
MixedContentMode.MIXED_CONTENT_NEVER_ALLOW,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [MixedContentMode] instance from [int] value.
|
///Gets a possible [MixedContentMode] instance from [int] value.
|
||||||
|
@ -82,10 +82,10 @@ class MixedContentMode {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 0:
|
||||||
return 'MIXED_CONTENT_ALWAYS_ALLOW';
|
return 'MIXED_CONTENT_ALWAYS_ALLOW';
|
||||||
case 1:
|
|
||||||
return 'MIXED_CONTENT_NEVER_ALLOW';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'MIXED_CONTENT_COMPATIBILITY_MODE';
|
return 'MIXED_CONTENT_COMPATIBILITY_MODE';
|
||||||
|
case 1:
|
||||||
|
return 'MIXED_CONTENT_NEVER_ALLOW';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
@ -111,11 +111,6 @@ class AndroidMixedContentMode {
|
||||||
static const MIXED_CONTENT_ALWAYS_ALLOW =
|
static const MIXED_CONTENT_ALWAYS_ALLOW =
|
||||||
AndroidMixedContentMode._internal(0, 0);
|
AndroidMixedContentMode._internal(0, 0);
|
||||||
|
|
||||||
///In this mode, the WebView will not allow a secure origin to load content from an insecure origin.
|
|
||||||
///This is the preferred and most secure mode of operation for the WebView and apps are strongly advised to use this mode.
|
|
||||||
static const MIXED_CONTENT_NEVER_ALLOW =
|
|
||||||
AndroidMixedContentMode._internal(1, 1);
|
|
||||||
|
|
||||||
///In this mode, the WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
|
///In this mode, the WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
|
||||||
///Some insecure content may be allowed to be loaded by a secure origin and other types of content will be blocked.
|
///Some insecure content may be allowed to be loaded by a secure origin and other types of content will be blocked.
|
||||||
///The types of content are allowed or blocked may change release to release and are not explicitly defined.
|
///The types of content are allowed or blocked may change release to release and are not explicitly defined.
|
||||||
|
@ -124,11 +119,16 @@ class AndroidMixedContentMode {
|
||||||
static const MIXED_CONTENT_COMPATIBILITY_MODE =
|
static const MIXED_CONTENT_COMPATIBILITY_MODE =
|
||||||
AndroidMixedContentMode._internal(2, 2);
|
AndroidMixedContentMode._internal(2, 2);
|
||||||
|
|
||||||
|
///In this mode, the WebView will not allow a secure origin to load content from an insecure origin.
|
||||||
|
///This is the preferred and most secure mode of operation for the WebView and apps are strongly advised to use this mode.
|
||||||
|
static const MIXED_CONTENT_NEVER_ALLOW =
|
||||||
|
AndroidMixedContentMode._internal(1, 1);
|
||||||
|
|
||||||
///Set of all values of [AndroidMixedContentMode].
|
///Set of all values of [AndroidMixedContentMode].
|
||||||
static final Set<AndroidMixedContentMode> values = [
|
static final Set<AndroidMixedContentMode> values = [
|
||||||
AndroidMixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW,
|
AndroidMixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW,
|
||||||
AndroidMixedContentMode.MIXED_CONTENT_NEVER_ALLOW,
|
|
||||||
AndroidMixedContentMode.MIXED_CONTENT_COMPATIBILITY_MODE,
|
AndroidMixedContentMode.MIXED_CONTENT_COMPATIBILITY_MODE,
|
||||||
|
AndroidMixedContentMode.MIXED_CONTENT_NEVER_ALLOW,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [AndroidMixedContentMode] instance from [int] value.
|
///Gets a possible [AndroidMixedContentMode] instance from [int] value.
|
||||||
|
@ -174,10 +174,10 @@ class AndroidMixedContentMode {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 0:
|
||||||
return 'MIXED_CONTENT_ALWAYS_ALLOW';
|
return 'MIXED_CONTENT_ALWAYS_ALLOW';
|
||||||
case 1:
|
|
||||||
return 'MIXED_CONTENT_NEVER_ALLOW';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'MIXED_CONTENT_COMPATIBILITY_MODE';
|
return 'MIXED_CONTENT_COMPATIBILITY_MODE';
|
||||||
|
case 1:
|
||||||
|
return 'MIXED_CONTENT_NEVER_ALLOW';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,14 +16,10 @@ class ModalPresentationStyle {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
ModalPresentationStyle._internal(value, nativeValue());
|
ModalPresentationStyle._internal(value, nativeValue());
|
||||||
|
|
||||||
///A presentation style in which the presented view covers the screen.
|
///The default presentation style chosen by the system.
|
||||||
static const FULL_SCREEN = ModalPresentationStyle._internal(0, 0);
|
///
|
||||||
|
///**NOTE**: available on iOS 13.0+.
|
||||||
///A presentation style that partially covers the underlying content.
|
static const AUTOMATIC = ModalPresentationStyle._internal(9, 9);
|
||||||
static const PAGE_SHEET = ModalPresentationStyle._internal(1, 1);
|
|
||||||
|
|
||||||
///A presentation style that displays the content centered in the screen.
|
|
||||||
static const FORM_SHEET = ModalPresentationStyle._internal(2, 2);
|
|
||||||
|
|
||||||
///A presentation style where the content is displayed over another view controller’s content.
|
///A presentation style where the content is displayed over another view controller’s content.
|
||||||
static const CURRENT_CONTEXT = ModalPresentationStyle._internal(3, 3);
|
static const CURRENT_CONTEXT = ModalPresentationStyle._internal(3, 3);
|
||||||
|
@ -31,35 +27,39 @@ class ModalPresentationStyle {
|
||||||
///A custom view presentation style that is managed by a custom presentation controller and one or more custom animator objects.
|
///A custom view presentation style that is managed by a custom presentation controller and one or more custom animator objects.
|
||||||
static const CUSTOM = ModalPresentationStyle._internal(4, 4);
|
static const CUSTOM = ModalPresentationStyle._internal(4, 4);
|
||||||
|
|
||||||
///A view presentation style in which the presented view covers the screen.
|
///A presentation style that displays the content centered in the screen.
|
||||||
static const OVER_FULL_SCREEN = ModalPresentationStyle._internal(5, 5);
|
static const FORM_SHEET = ModalPresentationStyle._internal(2, 2);
|
||||||
|
|
||||||
///A presentation style where the content is displayed over another view controller’s content.
|
///A presentation style in which the presented view covers the screen.
|
||||||
static const OVER_CURRENT_CONTEXT = ModalPresentationStyle._internal(6, 6);
|
static const FULL_SCREEN = ModalPresentationStyle._internal(0, 0);
|
||||||
|
|
||||||
///A presentation style where the content is displayed in a popover view.
|
|
||||||
static const POPOVER = ModalPresentationStyle._internal(7, 7);
|
|
||||||
|
|
||||||
///A presentation style that indicates no adaptations should be made.
|
///A presentation style that indicates no adaptations should be made.
|
||||||
static const NONE = ModalPresentationStyle._internal(8, 8);
|
static const NONE = ModalPresentationStyle._internal(8, 8);
|
||||||
|
|
||||||
///The default presentation style chosen by the system.
|
///A presentation style where the content is displayed over another view controller’s content.
|
||||||
///
|
static const OVER_CURRENT_CONTEXT = ModalPresentationStyle._internal(6, 6);
|
||||||
///**NOTE**: available on iOS 13.0+.
|
|
||||||
static const AUTOMATIC = ModalPresentationStyle._internal(9, 9);
|
///A view presentation style in which the presented view covers the screen.
|
||||||
|
static const OVER_FULL_SCREEN = ModalPresentationStyle._internal(5, 5);
|
||||||
|
|
||||||
|
///A presentation style that partially covers the underlying content.
|
||||||
|
static const PAGE_SHEET = ModalPresentationStyle._internal(1, 1);
|
||||||
|
|
||||||
|
///A presentation style where the content is displayed in a popover view.
|
||||||
|
static const POPOVER = ModalPresentationStyle._internal(7, 7);
|
||||||
|
|
||||||
///Set of all values of [ModalPresentationStyle].
|
///Set of all values of [ModalPresentationStyle].
|
||||||
static final Set<ModalPresentationStyle> values = [
|
static final Set<ModalPresentationStyle> values = [
|
||||||
ModalPresentationStyle.FULL_SCREEN,
|
ModalPresentationStyle.AUTOMATIC,
|
||||||
ModalPresentationStyle.PAGE_SHEET,
|
|
||||||
ModalPresentationStyle.FORM_SHEET,
|
|
||||||
ModalPresentationStyle.CURRENT_CONTEXT,
|
ModalPresentationStyle.CURRENT_CONTEXT,
|
||||||
ModalPresentationStyle.CUSTOM,
|
ModalPresentationStyle.CUSTOM,
|
||||||
ModalPresentationStyle.OVER_FULL_SCREEN,
|
ModalPresentationStyle.FORM_SHEET,
|
||||||
ModalPresentationStyle.OVER_CURRENT_CONTEXT,
|
ModalPresentationStyle.FULL_SCREEN,
|
||||||
ModalPresentationStyle.POPOVER,
|
|
||||||
ModalPresentationStyle.NONE,
|
ModalPresentationStyle.NONE,
|
||||||
ModalPresentationStyle.AUTOMATIC,
|
ModalPresentationStyle.OVER_CURRENT_CONTEXT,
|
||||||
|
ModalPresentationStyle.OVER_FULL_SCREEN,
|
||||||
|
ModalPresentationStyle.PAGE_SHEET,
|
||||||
|
ModalPresentationStyle.POPOVER,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [ModalPresentationStyle] instance from [int] value.
|
///Gets a possible [ModalPresentationStyle] instance from [int] value.
|
||||||
|
@ -103,26 +103,26 @@ class ModalPresentationStyle {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 9:
|
||||||
return 'FULL_SCREEN';
|
return 'AUTOMATIC';
|
||||||
case 1:
|
|
||||||
return 'PAGE_SHEET';
|
|
||||||
case 2:
|
|
||||||
return 'FORM_SHEET';
|
|
||||||
case 3:
|
case 3:
|
||||||
return 'CURRENT_CONTEXT';
|
return 'CURRENT_CONTEXT';
|
||||||
case 4:
|
case 4:
|
||||||
return 'CUSTOM';
|
return 'CUSTOM';
|
||||||
case 5:
|
case 2:
|
||||||
return 'OVER_FULL_SCREEN';
|
return 'FORM_SHEET';
|
||||||
case 6:
|
case 0:
|
||||||
return 'OVER_CURRENT_CONTEXT';
|
return 'FULL_SCREEN';
|
||||||
case 7:
|
|
||||||
return 'POPOVER';
|
|
||||||
case 8:
|
case 8:
|
||||||
return 'NONE';
|
return 'NONE';
|
||||||
case 9:
|
case 6:
|
||||||
return 'AUTOMATIC';
|
return 'OVER_CURRENT_CONTEXT';
|
||||||
|
case 5:
|
||||||
|
return 'OVER_FULL_SCREEN';
|
||||||
|
case 1:
|
||||||
|
return 'PAGE_SHEET';
|
||||||
|
case 7:
|
||||||
|
return 'POPOVER';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
@ -140,14 +140,10 @@ class IOSUIModalPresentationStyle {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
IOSUIModalPresentationStyle._internal(value, nativeValue());
|
IOSUIModalPresentationStyle._internal(value, nativeValue());
|
||||||
|
|
||||||
///A presentation style in which the presented view covers the screen.
|
///The default presentation style chosen by the system.
|
||||||
static const FULL_SCREEN = IOSUIModalPresentationStyle._internal(0, 0);
|
///
|
||||||
|
///**NOTE**: available on iOS 13.0+.
|
||||||
///A presentation style that partially covers the underlying content.
|
static const AUTOMATIC = IOSUIModalPresentationStyle._internal(9, 9);
|
||||||
static const PAGE_SHEET = IOSUIModalPresentationStyle._internal(1, 1);
|
|
||||||
|
|
||||||
///A presentation style that displays the content centered in the screen.
|
|
||||||
static const FORM_SHEET = IOSUIModalPresentationStyle._internal(2, 2);
|
|
||||||
|
|
||||||
///A presentation style where the content is displayed over another view controller’s content.
|
///A presentation style where the content is displayed over another view controller’s content.
|
||||||
static const CURRENT_CONTEXT = IOSUIModalPresentationStyle._internal(3, 3);
|
static const CURRENT_CONTEXT = IOSUIModalPresentationStyle._internal(3, 3);
|
||||||
|
@ -155,36 +151,40 @@ class IOSUIModalPresentationStyle {
|
||||||
///A custom view presentation style that is managed by a custom presentation controller and one or more custom animator objects.
|
///A custom view presentation style that is managed by a custom presentation controller and one or more custom animator objects.
|
||||||
static const CUSTOM = IOSUIModalPresentationStyle._internal(4, 4);
|
static const CUSTOM = IOSUIModalPresentationStyle._internal(4, 4);
|
||||||
|
|
||||||
///A view presentation style in which the presented view covers the screen.
|
///A presentation style that displays the content centered in the screen.
|
||||||
static const OVER_FULL_SCREEN = IOSUIModalPresentationStyle._internal(5, 5);
|
static const FORM_SHEET = IOSUIModalPresentationStyle._internal(2, 2);
|
||||||
|
|
||||||
|
///A presentation style in which the presented view covers the screen.
|
||||||
|
static const FULL_SCREEN = IOSUIModalPresentationStyle._internal(0, 0);
|
||||||
|
|
||||||
|
///A presentation style that indicates no adaptations should be made.
|
||||||
|
static const NONE = IOSUIModalPresentationStyle._internal(8, 8);
|
||||||
|
|
||||||
///A presentation style where the content is displayed over another view controller’s content.
|
///A presentation style where the content is displayed over another view controller’s content.
|
||||||
static const OVER_CURRENT_CONTEXT =
|
static const OVER_CURRENT_CONTEXT =
|
||||||
IOSUIModalPresentationStyle._internal(6, 6);
|
IOSUIModalPresentationStyle._internal(6, 6);
|
||||||
|
|
||||||
|
///A view presentation style in which the presented view covers the screen.
|
||||||
|
static const OVER_FULL_SCREEN = IOSUIModalPresentationStyle._internal(5, 5);
|
||||||
|
|
||||||
|
///A presentation style that partially covers the underlying content.
|
||||||
|
static const PAGE_SHEET = IOSUIModalPresentationStyle._internal(1, 1);
|
||||||
|
|
||||||
///A presentation style where the content is displayed in a popover view.
|
///A presentation style where the content is displayed in a popover view.
|
||||||
static const POPOVER = IOSUIModalPresentationStyle._internal(7, 7);
|
static const POPOVER = IOSUIModalPresentationStyle._internal(7, 7);
|
||||||
|
|
||||||
///A presentation style that indicates no adaptations should be made.
|
|
||||||
static const NONE = IOSUIModalPresentationStyle._internal(8, 8);
|
|
||||||
|
|
||||||
///The default presentation style chosen by the system.
|
|
||||||
///
|
|
||||||
///**NOTE**: available on iOS 13.0+.
|
|
||||||
static const AUTOMATIC = IOSUIModalPresentationStyle._internal(9, 9);
|
|
||||||
|
|
||||||
///Set of all values of [IOSUIModalPresentationStyle].
|
///Set of all values of [IOSUIModalPresentationStyle].
|
||||||
static final Set<IOSUIModalPresentationStyle> values = [
|
static final Set<IOSUIModalPresentationStyle> values = [
|
||||||
IOSUIModalPresentationStyle.FULL_SCREEN,
|
IOSUIModalPresentationStyle.AUTOMATIC,
|
||||||
IOSUIModalPresentationStyle.PAGE_SHEET,
|
|
||||||
IOSUIModalPresentationStyle.FORM_SHEET,
|
|
||||||
IOSUIModalPresentationStyle.CURRENT_CONTEXT,
|
IOSUIModalPresentationStyle.CURRENT_CONTEXT,
|
||||||
IOSUIModalPresentationStyle.CUSTOM,
|
IOSUIModalPresentationStyle.CUSTOM,
|
||||||
IOSUIModalPresentationStyle.OVER_FULL_SCREEN,
|
IOSUIModalPresentationStyle.FORM_SHEET,
|
||||||
IOSUIModalPresentationStyle.OVER_CURRENT_CONTEXT,
|
IOSUIModalPresentationStyle.FULL_SCREEN,
|
||||||
IOSUIModalPresentationStyle.POPOVER,
|
|
||||||
IOSUIModalPresentationStyle.NONE,
|
IOSUIModalPresentationStyle.NONE,
|
||||||
IOSUIModalPresentationStyle.AUTOMATIC,
|
IOSUIModalPresentationStyle.OVER_CURRENT_CONTEXT,
|
||||||
|
IOSUIModalPresentationStyle.OVER_FULL_SCREEN,
|
||||||
|
IOSUIModalPresentationStyle.PAGE_SHEET,
|
||||||
|
IOSUIModalPresentationStyle.POPOVER,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [IOSUIModalPresentationStyle] instance from [int] value.
|
///Gets a possible [IOSUIModalPresentationStyle] instance from [int] value.
|
||||||
|
@ -228,26 +228,26 @@ class IOSUIModalPresentationStyle {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 9:
|
||||||
return 'FULL_SCREEN';
|
return 'AUTOMATIC';
|
||||||
case 1:
|
|
||||||
return 'PAGE_SHEET';
|
|
||||||
case 2:
|
|
||||||
return 'FORM_SHEET';
|
|
||||||
case 3:
|
case 3:
|
||||||
return 'CURRENT_CONTEXT';
|
return 'CURRENT_CONTEXT';
|
||||||
case 4:
|
case 4:
|
||||||
return 'CUSTOM';
|
return 'CUSTOM';
|
||||||
case 5:
|
case 2:
|
||||||
return 'OVER_FULL_SCREEN';
|
return 'FORM_SHEET';
|
||||||
case 6:
|
case 0:
|
||||||
return 'OVER_CURRENT_CONTEXT';
|
return 'FULL_SCREEN';
|
||||||
case 7:
|
|
||||||
return 'POPOVER';
|
|
||||||
case 8:
|
case 8:
|
||||||
return 'NONE';
|
return 'NONE';
|
||||||
case 9:
|
case 6:
|
||||||
return 'AUTOMATIC';
|
return 'OVER_CURRENT_CONTEXT';
|
||||||
|
case 5:
|
||||||
|
return 'OVER_FULL_SCREEN';
|
||||||
|
case 1:
|
||||||
|
return 'PAGE_SHEET';
|
||||||
|
case 7:
|
||||||
|
return 'POPOVER';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,15 +20,15 @@ class ModalTransitionStyle {
|
||||||
///On dismissal, the view slides back down. This is the default transition style.
|
///On dismissal, the view slides back down. This is the default transition style.
|
||||||
static const COVER_VERTICAL = ModalTransitionStyle._internal(0, 0);
|
static const COVER_VERTICAL = ModalTransitionStyle._internal(0, 0);
|
||||||
|
|
||||||
|
///When the view controller is presented, the current view fades out while the new view fades in at the same time.
|
||||||
|
///On dismissal, a similar type of cross-fade is used to return to the original view.
|
||||||
|
static const CROSS_DISSOLVE = ModalTransitionStyle._internal(2, 2);
|
||||||
|
|
||||||
///When the view controller is presented, the current view initiates a horizontal 3D flip from right-to-left,
|
///When the view controller is presented, the current view initiates a horizontal 3D flip from right-to-left,
|
||||||
///resulting in the revealing of the new view as if it were on the back of the previous view.
|
///resulting in the revealing of the new view as if it were on the back of the previous view.
|
||||||
///On dismissal, the flip occurs from left-to-right, returning to the original view.
|
///On dismissal, the flip occurs from left-to-right, returning to the original view.
|
||||||
static const FLIP_HORIZONTAL = ModalTransitionStyle._internal(1, 1);
|
static const FLIP_HORIZONTAL = ModalTransitionStyle._internal(1, 1);
|
||||||
|
|
||||||
///When the view controller is presented, the current view fades out while the new view fades in at the same time.
|
|
||||||
///On dismissal, a similar type of cross-fade is used to return to the original view.
|
|
||||||
static const CROSS_DISSOLVE = ModalTransitionStyle._internal(2, 2);
|
|
||||||
|
|
||||||
///When the view controller is presented, one corner of the current view curls up to reveal the presented view underneath.
|
///When the view controller is presented, one corner of the current view curls up to reveal the presented view underneath.
|
||||||
///On dismissal, the curled up page unfurls itself back on top of the presented view.
|
///On dismissal, the curled up page unfurls itself back on top of the presented view.
|
||||||
///A view controller presented using this transition is itself prevented from presenting any additional view controllers.
|
///A view controller presented using this transition is itself prevented from presenting any additional view controllers.
|
||||||
|
@ -37,8 +37,8 @@ class ModalTransitionStyle {
|
||||||
///Set of all values of [ModalTransitionStyle].
|
///Set of all values of [ModalTransitionStyle].
|
||||||
static final Set<ModalTransitionStyle> values = [
|
static final Set<ModalTransitionStyle> values = [
|
||||||
ModalTransitionStyle.COVER_VERTICAL,
|
ModalTransitionStyle.COVER_VERTICAL,
|
||||||
ModalTransitionStyle.FLIP_HORIZONTAL,
|
|
||||||
ModalTransitionStyle.CROSS_DISSOLVE,
|
ModalTransitionStyle.CROSS_DISSOLVE,
|
||||||
|
ModalTransitionStyle.FLIP_HORIZONTAL,
|
||||||
ModalTransitionStyle.PARTIAL_CURL,
|
ModalTransitionStyle.PARTIAL_CURL,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
|
@ -85,10 +85,10 @@ class ModalTransitionStyle {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 0:
|
||||||
return 'COVER_VERTICAL';
|
return 'COVER_VERTICAL';
|
||||||
case 1:
|
|
||||||
return 'FLIP_HORIZONTAL';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'CROSS_DISSOLVE';
|
return 'CROSS_DISSOLVE';
|
||||||
|
case 1:
|
||||||
|
return 'FLIP_HORIZONTAL';
|
||||||
case 3:
|
case 3:
|
||||||
return 'PARTIAL_CURL';
|
return 'PARTIAL_CURL';
|
||||||
}
|
}
|
||||||
|
@ -112,15 +112,15 @@ class IOSUIModalTransitionStyle {
|
||||||
///On dismissal, the view slides back down. This is the default transition style.
|
///On dismissal, the view slides back down. This is the default transition style.
|
||||||
static const COVER_VERTICAL = IOSUIModalTransitionStyle._internal(0, 0);
|
static const COVER_VERTICAL = IOSUIModalTransitionStyle._internal(0, 0);
|
||||||
|
|
||||||
|
///When the view controller is presented, the current view fades out while the new view fades in at the same time.
|
||||||
|
///On dismissal, a similar type of cross-fade is used to return to the original view.
|
||||||
|
static const CROSS_DISSOLVE = IOSUIModalTransitionStyle._internal(2, 2);
|
||||||
|
|
||||||
///When the view controller is presented, the current view initiates a horizontal 3D flip from right-to-left,
|
///When the view controller is presented, the current view initiates a horizontal 3D flip from right-to-left,
|
||||||
///resulting in the revealing of the new view as if it were on the back of the previous view.
|
///resulting in the revealing of the new view as if it were on the back of the previous view.
|
||||||
///On dismissal, the flip occurs from left-to-right, returning to the original view.
|
///On dismissal, the flip occurs from left-to-right, returning to the original view.
|
||||||
static const FLIP_HORIZONTAL = IOSUIModalTransitionStyle._internal(1, 1);
|
static const FLIP_HORIZONTAL = IOSUIModalTransitionStyle._internal(1, 1);
|
||||||
|
|
||||||
///When the view controller is presented, the current view fades out while the new view fades in at the same time.
|
|
||||||
///On dismissal, a similar type of cross-fade is used to return to the original view.
|
|
||||||
static const CROSS_DISSOLVE = IOSUIModalTransitionStyle._internal(2, 2);
|
|
||||||
|
|
||||||
///When the view controller is presented, one corner of the current view curls up to reveal the presented view underneath.
|
///When the view controller is presented, one corner of the current view curls up to reveal the presented view underneath.
|
||||||
///On dismissal, the curled up page unfurls itself back on top of the presented view.
|
///On dismissal, the curled up page unfurls itself back on top of the presented view.
|
||||||
///A view controller presented using this transition is itself prevented from presenting any additional view controllers.
|
///A view controller presented using this transition is itself prevented from presenting any additional view controllers.
|
||||||
|
@ -129,8 +129,8 @@ class IOSUIModalTransitionStyle {
|
||||||
///Set of all values of [IOSUIModalTransitionStyle].
|
///Set of all values of [IOSUIModalTransitionStyle].
|
||||||
static final Set<IOSUIModalTransitionStyle> values = [
|
static final Set<IOSUIModalTransitionStyle> values = [
|
||||||
IOSUIModalTransitionStyle.COVER_VERTICAL,
|
IOSUIModalTransitionStyle.COVER_VERTICAL,
|
||||||
IOSUIModalTransitionStyle.FLIP_HORIZONTAL,
|
|
||||||
IOSUIModalTransitionStyle.CROSS_DISSOLVE,
|
IOSUIModalTransitionStyle.CROSS_DISSOLVE,
|
||||||
|
IOSUIModalTransitionStyle.FLIP_HORIZONTAL,
|
||||||
IOSUIModalTransitionStyle.PARTIAL_CURL,
|
IOSUIModalTransitionStyle.PARTIAL_CURL,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
|
@ -177,10 +177,10 @@ class IOSUIModalTransitionStyle {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
case 0:
|
||||||
return 'COVER_VERTICAL';
|
return 'COVER_VERTICAL';
|
||||||
case 1:
|
|
||||||
return 'FLIP_HORIZONTAL';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'CROSS_DISSOLVE';
|
return 'CROSS_DISSOLVE';
|
||||||
|
case 1:
|
||||||
|
return 'FLIP_HORIZONTAL';
|
||||||
case 3:
|
case 3:
|
||||||
return 'PARTIAL_CURL';
|
return 'PARTIAL_CURL';
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,24 +8,14 @@ part of 'navigation_action.dart';
|
||||||
|
|
||||||
///An object that contains information about an action that causes navigation to occur.
|
///An object that contains information about an action that causes navigation to occur.
|
||||||
class NavigationAction {
|
class NavigationAction {
|
||||||
///The URL request object associated with the navigation action.
|
|
||||||
///
|
|
||||||
///**NOTE for Android**: If the request is associated to the [WebView.onCreateWindow] event
|
|
||||||
///and the window has been created using JavaScript, [request.url] will be `null`,
|
|
||||||
///the [request.method] is always `GET`, and [request.headers] value is always `null`.
|
|
||||||
///Also, on Android < 21, the [request.method] is always `GET` and [request.headers] value is always `null`.
|
|
||||||
URLRequest request;
|
|
||||||
|
|
||||||
///Indicates whether the request was made for the main frame.
|
|
||||||
///
|
|
||||||
///**NOTE for Android**: If the request is associated to the [WebView.onCreateWindow] event, this is always `true`.
|
|
||||||
///Also, on Android < 21, this is always `true`.
|
|
||||||
bool isForMainFrame;
|
|
||||||
|
|
||||||
///Use [hasGesture] instead.
|
///Use [hasGesture] instead.
|
||||||
@Deprecated('Use hasGesture instead')
|
@Deprecated('Use hasGesture instead')
|
||||||
bool? androidHasGesture;
|
bool? androidHasGesture;
|
||||||
|
|
||||||
|
///Use [isRedirect] instead.
|
||||||
|
@Deprecated('Use isRedirect instead')
|
||||||
|
bool? androidIsRedirect;
|
||||||
|
|
||||||
///Gets whether a gesture (such as a click) was associated with the request.
|
///Gets whether a gesture (such as a click) was associated with the request.
|
||||||
///For security reasons in certain situations this method may return `false` even though
|
///For security reasons in certain situations this method may return `false` even though
|
||||||
///the sequence of events which caused the request to be created was initiated by a user
|
///the sequence of events which caused the request to be created was initiated by a user
|
||||||
|
@ -37,9 +27,23 @@ class NavigationAction {
|
||||||
///- Android native WebView 21+ ([Official API - WebResourceRequest.hasGesture](https://developer.android.com/reference/android/webkit/WebResourceRequest#hasGesture()))
|
///- Android native WebView 21+ ([Official API - WebResourceRequest.hasGesture](https://developer.android.com/reference/android/webkit/WebResourceRequest#hasGesture()))
|
||||||
bool? hasGesture;
|
bool? hasGesture;
|
||||||
|
|
||||||
///Use [isRedirect] instead.
|
///Use [sourceFrame] instead.
|
||||||
@Deprecated('Use isRedirect instead')
|
@Deprecated('Use sourceFrame instead')
|
||||||
bool? androidIsRedirect;
|
IOSWKFrameInfo? iosSourceFrame;
|
||||||
|
|
||||||
|
///Use [targetFrame] instead.
|
||||||
|
@Deprecated('Use targetFrame instead')
|
||||||
|
IOSWKFrameInfo? iosTargetFrame;
|
||||||
|
|
||||||
|
///Use [navigationType] instead.
|
||||||
|
@Deprecated('Use navigationType instead')
|
||||||
|
IOSWKNavigationType? iosWKNavigationType;
|
||||||
|
|
||||||
|
///Indicates whether the request was made for the main frame.
|
||||||
|
///
|
||||||
|
///**NOTE for Android**: If the request is associated to the [WebView.onCreateWindow] event, this is always `true`.
|
||||||
|
///Also, on Android < 21, this is always `true`.
|
||||||
|
bool isForMainFrame;
|
||||||
|
|
||||||
///Gets whether the request was a result of a server-side redirect.
|
///Gets whether the request was a result of a server-side redirect.
|
||||||
///
|
///
|
||||||
|
@ -50,10 +54,6 @@ class NavigationAction {
|
||||||
///- Android native WebView 21+ ([Official API - WebResourceRequest.isRedirect](https://developer.android.com/reference/android/webkit/WebResourceRequest#isRedirect()))
|
///- Android native WebView 21+ ([Official API - WebResourceRequest.isRedirect](https://developer.android.com/reference/android/webkit/WebResourceRequest#isRedirect()))
|
||||||
bool? isRedirect;
|
bool? isRedirect;
|
||||||
|
|
||||||
///Use [navigationType] instead.
|
|
||||||
@Deprecated('Use navigationType instead')
|
|
||||||
IOSWKNavigationType? iosWKNavigationType;
|
|
||||||
|
|
||||||
///The type of action triggering the navigation.ì
|
///The type of action triggering the navigation.ì
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -61,9 +61,20 @@ class NavigationAction {
|
||||||
///- MacOS ([Official API - WKNavigationAction.navigationType](https://developer.apple.com/documentation/webkit/wknavigationaction/1401914-navigationtype))
|
///- MacOS ([Official API - WKNavigationAction.navigationType](https://developer.apple.com/documentation/webkit/wknavigationaction/1401914-navigationtype))
|
||||||
NavigationType? navigationType;
|
NavigationType? navigationType;
|
||||||
|
|
||||||
///Use [sourceFrame] instead.
|
///The URL request object associated with the navigation action.
|
||||||
@Deprecated('Use sourceFrame instead')
|
///
|
||||||
IOSWKFrameInfo? iosSourceFrame;
|
///**NOTE for Android**: If the request is associated to the [WebView.onCreateWindow] event
|
||||||
|
///and the window has been created using JavaScript, [request.url] will be `null`,
|
||||||
|
///the [request.method] is always `GET`, and [request.headers] value is always `null`.
|
||||||
|
///Also, on Android < 21, the [request.method] is always `GET` and [request.headers] value is always `null`.
|
||||||
|
URLRequest request;
|
||||||
|
|
||||||
|
///A value indicating whether the web content used a download attribute to indicate that this should be downloaded.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS 14.5+ ([Official API - WKNavigationAction.shouldPerformDownload](https://developer.apple.com/documentation/webkit/wknavigationaction/3727357-shouldperformdownload))
|
||||||
|
///- MacOS 11.3+ ([Official API - WKNavigationAction.shouldPerformDownload](https://developer.apple.com/documentation/webkit/wknavigationaction/3727357-shouldperformdownload))
|
||||||
|
bool? shouldPerformDownload;
|
||||||
|
|
||||||
///The frame that requested the navigation.
|
///The frame that requested the navigation.
|
||||||
///
|
///
|
||||||
|
@ -72,43 +83,32 @@ class NavigationAction {
|
||||||
///- MacOS ([Official API - WKNavigationAction.sourceFrame](https://developer.apple.com/documentation/webkit/wknavigationaction/1401926-sourceframe))
|
///- MacOS ([Official API - WKNavigationAction.sourceFrame](https://developer.apple.com/documentation/webkit/wknavigationaction/1401926-sourceframe))
|
||||||
FrameInfo? sourceFrame;
|
FrameInfo? sourceFrame;
|
||||||
|
|
||||||
///Use [targetFrame] instead.
|
|
||||||
@Deprecated('Use targetFrame instead')
|
|
||||||
IOSWKFrameInfo? iosTargetFrame;
|
|
||||||
|
|
||||||
///The frame in which to display the new content.
|
///The frame in which to display the new content.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS ([Official API - WKNavigationAction.targetFrame](https://developer.apple.com/documentation/webkit/wknavigationaction/1401918-targetframe))
|
///- iOS ([Official API - WKNavigationAction.targetFrame](https://developer.apple.com/documentation/webkit/wknavigationaction/1401918-targetframe))
|
||||||
///- MacOS ([Official API - WKNavigationAction.targetFrame](https://developer.apple.com/documentation/webkit/wknavigationaction/1401918-targetframe))
|
///- MacOS ([Official API - WKNavigationAction.targetFrame](https://developer.apple.com/documentation/webkit/wknavigationaction/1401918-targetframe))
|
||||||
FrameInfo? targetFrame;
|
FrameInfo? targetFrame;
|
||||||
|
|
||||||
///A value indicating whether the web content used a download attribute to indicate that this should be downloaded.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- iOS 14.5+ ([Official API - WKNavigationAction.shouldPerformDownload](https://developer.apple.com/documentation/webkit/wknavigationaction/3727357-shouldperformdownload))
|
|
||||||
///- MacOS 11.3+ ([Official API - WKNavigationAction.shouldPerformDownload](https://developer.apple.com/documentation/webkit/wknavigationaction/3727357-shouldperformdownload))
|
|
||||||
bool? shouldPerformDownload;
|
|
||||||
NavigationAction(
|
NavigationAction(
|
||||||
{required this.request,
|
{@Deprecated('Use hasGesture instead') this.androidHasGesture,
|
||||||
required this.isForMainFrame,
|
|
||||||
@Deprecated('Use hasGesture instead') this.androidHasGesture,
|
|
||||||
this.hasGesture,
|
|
||||||
@Deprecated('Use isRedirect instead') this.androidIsRedirect,
|
@Deprecated('Use isRedirect instead') this.androidIsRedirect,
|
||||||
this.isRedirect,
|
this.hasGesture,
|
||||||
@Deprecated('Use navigationType instead') this.iosWKNavigationType,
|
|
||||||
this.navigationType,
|
|
||||||
@Deprecated('Use sourceFrame instead') this.iosSourceFrame,
|
@Deprecated('Use sourceFrame instead') this.iosSourceFrame,
|
||||||
this.sourceFrame,
|
|
||||||
@Deprecated('Use targetFrame instead') this.iosTargetFrame,
|
@Deprecated('Use targetFrame instead') this.iosTargetFrame,
|
||||||
this.targetFrame,
|
@Deprecated('Use navigationType instead') this.iosWKNavigationType,
|
||||||
this.shouldPerformDownload}) {
|
required this.isForMainFrame,
|
||||||
|
this.isRedirect,
|
||||||
|
this.navigationType,
|
||||||
|
required this.request,
|
||||||
|
this.shouldPerformDownload,
|
||||||
|
this.sourceFrame,
|
||||||
|
this.targetFrame}) {
|
||||||
hasGesture = hasGesture ?? androidHasGesture;
|
hasGesture = hasGesture ?? androidHasGesture;
|
||||||
isRedirect = isRedirect ?? androidIsRedirect;
|
isRedirect = isRedirect ?? androidIsRedirect;
|
||||||
navigationType = navigationType ??
|
|
||||||
NavigationType.fromNativeValue(iosWKNavigationType?.toNativeValue());
|
|
||||||
sourceFrame = sourceFrame ?? FrameInfo.fromMap(iosSourceFrame?.toMap());
|
sourceFrame = sourceFrame ?? FrameInfo.fromMap(iosSourceFrame?.toMap());
|
||||||
targetFrame = targetFrame ?? FrameInfo.fromMap(iosTargetFrame?.toMap());
|
targetFrame = targetFrame ?? FrameInfo.fromMap(iosTargetFrame?.toMap());
|
||||||
|
navigationType = navigationType ??
|
||||||
|
NavigationType.fromNativeValue(iosWKNavigationType?.toNativeValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
///Gets a possible [NavigationAction] instance from a [Map] value.
|
///Gets a possible [NavigationAction] instance from a [Map] value.
|
||||||
|
@ -117,24 +117,24 @@ class NavigationAction {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = NavigationAction(
|
final instance = NavigationAction(
|
||||||
request: URLRequest.fromMap(map['request']?.cast<String, dynamic>())!,
|
|
||||||
isForMainFrame: map['isForMainFrame'],
|
|
||||||
androidHasGesture: map['hasGesture'],
|
androidHasGesture: map['hasGesture'],
|
||||||
hasGesture: map['hasGesture'],
|
|
||||||
androidIsRedirect: map['isRedirect'],
|
androidIsRedirect: map['isRedirect'],
|
||||||
isRedirect: map['isRedirect'],
|
hasGesture: map['hasGesture'],
|
||||||
iosWKNavigationType:
|
|
||||||
IOSWKNavigationType.fromNativeValue(map['navigationType']),
|
|
||||||
navigationType: NavigationType.fromNativeValue(map['navigationType']),
|
|
||||||
iosSourceFrame:
|
iosSourceFrame:
|
||||||
IOSWKFrameInfo.fromMap(map['sourceFrame']?.cast<String, dynamic>()),
|
IOSWKFrameInfo.fromMap(map['sourceFrame']?.cast<String, dynamic>()),
|
||||||
sourceFrame:
|
|
||||||
FrameInfo.fromMap(map['sourceFrame']?.cast<String, dynamic>()),
|
|
||||||
iosTargetFrame:
|
iosTargetFrame:
|
||||||
IOSWKFrameInfo.fromMap(map['targetFrame']?.cast<String, dynamic>()),
|
IOSWKFrameInfo.fromMap(map['targetFrame']?.cast<String, dynamic>()),
|
||||||
|
iosWKNavigationType:
|
||||||
|
IOSWKNavigationType.fromNativeValue(map['navigationType']),
|
||||||
|
isForMainFrame: map['isForMainFrame'],
|
||||||
|
isRedirect: map['isRedirect'],
|
||||||
|
navigationType: NavigationType.fromNativeValue(map['navigationType']),
|
||||||
|
request: URLRequest.fromMap(map['request']?.cast<String, dynamic>())!,
|
||||||
|
shouldPerformDownload: map['shouldPerformDownload'],
|
||||||
|
sourceFrame:
|
||||||
|
FrameInfo.fromMap(map['sourceFrame']?.cast<String, dynamic>()),
|
||||||
targetFrame:
|
targetFrame:
|
||||||
FrameInfo.fromMap(map['targetFrame']?.cast<String, dynamic>()),
|
FrameInfo.fromMap(map['targetFrame']?.cast<String, dynamic>()),
|
||||||
shouldPerformDownload: map['shouldPerformDownload'],
|
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -142,14 +142,14 @@ class NavigationAction {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"request": request.toMap(),
|
|
||||||
"isForMainFrame": isForMainFrame,
|
|
||||||
"hasGesture": hasGesture,
|
"hasGesture": hasGesture,
|
||||||
|
"isForMainFrame": isForMainFrame,
|
||||||
"isRedirect": isRedirect,
|
"isRedirect": isRedirect,
|
||||||
"navigationType": navigationType?.toNativeValue(),
|
"navigationType": navigationType?.toNativeValue(),
|
||||||
|
"request": request.toMap(),
|
||||||
|
"shouldPerformDownload": shouldPerformDownload,
|
||||||
"sourceFrame": sourceFrame?.toMap(),
|
"sourceFrame": sourceFrame?.toMap(),
|
||||||
"targetFrame": targetFrame?.toMap(),
|
"targetFrame": targetFrame?.toMap(),
|
||||||
"shouldPerformDownload": shouldPerformDownload,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,6 +160,6 @@ class NavigationAction {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'NavigationAction{request: $request, isForMainFrame: $isForMainFrame, hasGesture: $hasGesture, isRedirect: $isRedirect, navigationType: $navigationType, sourceFrame: $sourceFrame, targetFrame: $targetFrame, shouldPerformDownload: $shouldPerformDownload}';
|
return 'NavigationAction{hasGesture: $hasGesture, isForMainFrame: $isForMainFrame, isRedirect: $isRedirect, navigationType: $navigationType, request: $request, shouldPerformDownload: $shouldPerformDownload, sourceFrame: $sourceFrame, targetFrame: $targetFrame}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,12 @@ class NavigationActionPolicy {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
NavigationActionPolicy._internal(value, nativeValue());
|
NavigationActionPolicy._internal(value, nativeValue());
|
||||||
|
|
||||||
///Cancel the navigation.
|
|
||||||
static const CANCEL = NavigationActionPolicy._internal(0, 0);
|
|
||||||
|
|
||||||
///Allow the navigation to continue.
|
///Allow the navigation to continue.
|
||||||
static const ALLOW = NavigationActionPolicy._internal(1, 1);
|
static const ALLOW = NavigationActionPolicy._internal(1, 1);
|
||||||
|
|
||||||
|
///Cancel the navigation.
|
||||||
|
static const CANCEL = NavigationActionPolicy._internal(0, 0);
|
||||||
|
|
||||||
///Turn the navigation into a download.
|
///Turn the navigation into a download.
|
||||||
///
|
///
|
||||||
///**NOTE**: available only on iOS 14.5+. It will fallback to [CANCEL].
|
///**NOTE**: available only on iOS 14.5+. It will fallback to [CANCEL].
|
||||||
|
@ -30,8 +30,8 @@ class NavigationActionPolicy {
|
||||||
|
|
||||||
///Set of all values of [NavigationActionPolicy].
|
///Set of all values of [NavigationActionPolicy].
|
||||||
static final Set<NavigationActionPolicy> values = [
|
static final Set<NavigationActionPolicy> values = [
|
||||||
NavigationActionPolicy.CANCEL,
|
|
||||||
NavigationActionPolicy.ALLOW,
|
NavigationActionPolicy.ALLOW,
|
||||||
|
NavigationActionPolicy.CANCEL,
|
||||||
NavigationActionPolicy.DOWNLOAD,
|
NavigationActionPolicy.DOWNLOAD,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
|
@ -76,10 +76,10 @@ class NavigationActionPolicy {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'CANCEL';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'ALLOW';
|
return 'ALLOW';
|
||||||
|
case 0:
|
||||||
|
return 'CANCEL';
|
||||||
case 2:
|
case 2:
|
||||||
return 'DOWNLOAD';
|
return 'DOWNLOAD';
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,18 +8,18 @@ part of 'navigation_response.dart';
|
||||||
|
|
||||||
///Class that represents the navigation response used by the [WebView.onNavigationResponse] event.
|
///Class that represents the navigation response used by the [WebView.onNavigationResponse] event.
|
||||||
class NavigationResponse {
|
class NavigationResponse {
|
||||||
///The URL for the response.
|
///A Boolean value that indicates whether WebKit is capable of displaying the response’s MIME type natively.
|
||||||
URLResponse? response;
|
bool canShowMIMEType;
|
||||||
|
|
||||||
///A Boolean value that indicates whether the response targets the web view’s main frame.
|
///A Boolean value that indicates whether the response targets the web view’s main frame.
|
||||||
bool isForMainFrame;
|
bool isForMainFrame;
|
||||||
|
|
||||||
///A Boolean value that indicates whether WebKit is capable of displaying the response’s MIME type natively.
|
///The URL for the response.
|
||||||
bool canShowMIMEType;
|
URLResponse? response;
|
||||||
NavigationResponse(
|
NavigationResponse(
|
||||||
{this.response,
|
{required this.canShowMIMEType,
|
||||||
required this.isForMainFrame,
|
required this.isForMainFrame,
|
||||||
required this.canShowMIMEType});
|
this.response});
|
||||||
|
|
||||||
///Gets a possible [NavigationResponse] instance from a [Map] value.
|
///Gets a possible [NavigationResponse] instance from a [Map] value.
|
||||||
static NavigationResponse? fromMap(Map<String, dynamic>? map) {
|
static NavigationResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -27,9 +27,9 @@ class NavigationResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = NavigationResponse(
|
final instance = NavigationResponse(
|
||||||
response: URLResponse.fromMap(map['response']?.cast<String, dynamic>()),
|
|
||||||
isForMainFrame: map['isForMainFrame'],
|
|
||||||
canShowMIMEType: map['canShowMIMEType'],
|
canShowMIMEType: map['canShowMIMEType'],
|
||||||
|
isForMainFrame: map['isForMainFrame'],
|
||||||
|
response: URLResponse.fromMap(map['response']?.cast<String, dynamic>()),
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,9 @@ class NavigationResponse {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"response": response?.toMap(),
|
|
||||||
"isForMainFrame": isForMainFrame,
|
|
||||||
"canShowMIMEType": canShowMIMEType,
|
"canShowMIMEType": canShowMIMEType,
|
||||||
|
"isForMainFrame": isForMainFrame,
|
||||||
|
"response": response?.toMap(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class NavigationResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'NavigationResponse{response: $response, isForMainFrame: $isForMainFrame, canShowMIMEType: $canShowMIMEType}';
|
return 'NavigationResponse{canShowMIMEType: $canShowMIMEType, isForMainFrame: $isForMainFrame, response: $response}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,18 +58,18 @@ class NavigationResponse {
|
||||||
///Use [NavigationResponse] instead.
|
///Use [NavigationResponse] instead.
|
||||||
@Deprecated('Use NavigationResponse instead')
|
@Deprecated('Use NavigationResponse instead')
|
||||||
class IOSWKNavigationResponse {
|
class IOSWKNavigationResponse {
|
||||||
///The URL for the response.
|
///A Boolean value that indicates whether WebKit is capable of displaying the response’s MIME type natively.
|
||||||
IOSURLResponse? response;
|
bool canShowMIMEType;
|
||||||
|
|
||||||
///A Boolean value that indicates whether the response targets the web view’s main frame.
|
///A Boolean value that indicates whether the response targets the web view’s main frame.
|
||||||
bool isForMainFrame;
|
bool isForMainFrame;
|
||||||
|
|
||||||
///A Boolean value that indicates whether WebKit is capable of displaying the response’s MIME type natively.
|
///The URL for the response.
|
||||||
bool canShowMIMEType;
|
IOSURLResponse? response;
|
||||||
IOSWKNavigationResponse(
|
IOSWKNavigationResponse(
|
||||||
{this.response,
|
{required this.canShowMIMEType,
|
||||||
required this.isForMainFrame,
|
required this.isForMainFrame,
|
||||||
required this.canShowMIMEType});
|
this.response});
|
||||||
|
|
||||||
///Gets a possible [IOSWKNavigationResponse] instance from a [Map] value.
|
///Gets a possible [IOSWKNavigationResponse] instance from a [Map] value.
|
||||||
static IOSWKNavigationResponse? fromMap(Map<String, dynamic>? map) {
|
static IOSWKNavigationResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -77,10 +77,10 @@ class IOSWKNavigationResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = IOSWKNavigationResponse(
|
final instance = IOSWKNavigationResponse(
|
||||||
|
canShowMIMEType: map['canShowMIMEType'],
|
||||||
|
isForMainFrame: map['isForMainFrame'],
|
||||||
response:
|
response:
|
||||||
IOSURLResponse.fromMap(map['response']?.cast<String, dynamic>()),
|
IOSURLResponse.fromMap(map['response']?.cast<String, dynamic>()),
|
||||||
isForMainFrame: map['isForMainFrame'],
|
|
||||||
canShowMIMEType: map['canShowMIMEType'],
|
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -88,9 +88,9 @@ class IOSWKNavigationResponse {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"response": response?.toMap(),
|
|
||||||
"isForMainFrame": isForMainFrame,
|
|
||||||
"canShowMIMEType": canShowMIMEType,
|
"canShowMIMEType": canShowMIMEType,
|
||||||
|
"isForMainFrame": isForMainFrame,
|
||||||
|
"response": response?.toMap(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +101,6 @@ class IOSWKNavigationResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'IOSWKNavigationResponse{response: $response, isForMainFrame: $isForMainFrame, canShowMIMEType: $canShowMIMEType}';
|
return 'IOSWKNavigationResponse{canShowMIMEType: $canShowMIMEType, isForMainFrame: $isForMainFrame, response: $response}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,12 @@ class NavigationResponseAction {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
NavigationResponseAction._internal(value, nativeValue());
|
NavigationResponseAction._internal(value, nativeValue());
|
||||||
|
|
||||||
///Cancel the navigation.
|
|
||||||
static const CANCEL = NavigationResponseAction._internal(0, 0);
|
|
||||||
|
|
||||||
///Allow the navigation to continue.
|
///Allow the navigation to continue.
|
||||||
static const ALLOW = NavigationResponseAction._internal(1, 1);
|
static const ALLOW = NavigationResponseAction._internal(1, 1);
|
||||||
|
|
||||||
|
///Cancel the navigation.
|
||||||
|
static const CANCEL = NavigationResponseAction._internal(0, 0);
|
||||||
|
|
||||||
///Turn the navigation into a download.
|
///Turn the navigation into a download.
|
||||||
///
|
///
|
||||||
///**NOTE**: available only on iOS 14.5+. It will fallback to [CANCEL].
|
///**NOTE**: available only on iOS 14.5+. It will fallback to [CANCEL].
|
||||||
|
@ -30,8 +30,8 @@ class NavigationResponseAction {
|
||||||
|
|
||||||
///Set of all values of [NavigationResponseAction].
|
///Set of all values of [NavigationResponseAction].
|
||||||
static final Set<NavigationResponseAction> values = [
|
static final Set<NavigationResponseAction> values = [
|
||||||
NavigationResponseAction.CANCEL,
|
|
||||||
NavigationResponseAction.ALLOW,
|
NavigationResponseAction.ALLOW,
|
||||||
|
NavigationResponseAction.CANCEL,
|
||||||
NavigationResponseAction.DOWNLOAD,
|
NavigationResponseAction.DOWNLOAD,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
|
@ -76,10 +76,10 @@ class NavigationResponseAction {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'CANCEL';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'ALLOW';
|
return 'ALLOW';
|
||||||
|
case 0:
|
||||||
|
return 'CANCEL';
|
||||||
case 2:
|
case 2:
|
||||||
return 'DOWNLOAD';
|
return 'DOWNLOAD';
|
||||||
}
|
}
|
||||||
|
@ -100,16 +100,16 @@ class IOSNavigationResponseAction {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
IOSNavigationResponseAction._internal(value, nativeValue());
|
IOSNavigationResponseAction._internal(value, nativeValue());
|
||||||
|
|
||||||
///Cancel the navigation.
|
|
||||||
static const CANCEL = IOSNavigationResponseAction._internal(0, 0);
|
|
||||||
|
|
||||||
///Allow the navigation to continue.
|
///Allow the navigation to continue.
|
||||||
static const ALLOW = IOSNavigationResponseAction._internal(1, 1);
|
static const ALLOW = IOSNavigationResponseAction._internal(1, 1);
|
||||||
|
|
||||||
|
///Cancel the navigation.
|
||||||
|
static const CANCEL = IOSNavigationResponseAction._internal(0, 0);
|
||||||
|
|
||||||
///Set of all values of [IOSNavigationResponseAction].
|
///Set of all values of [IOSNavigationResponseAction].
|
||||||
static final Set<IOSNavigationResponseAction> values = [
|
static final Set<IOSNavigationResponseAction> values = [
|
||||||
IOSNavigationResponseAction.CANCEL,
|
|
||||||
IOSNavigationResponseAction.ALLOW,
|
IOSNavigationResponseAction.ALLOW,
|
||||||
|
IOSNavigationResponseAction.CANCEL,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [IOSNavigationResponseAction] instance from [int] value.
|
///Gets a possible [IOSNavigationResponseAction] instance from [int] value.
|
||||||
|
@ -153,10 +153,10 @@ class IOSNavigationResponseAction {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'CANCEL';
|
|
||||||
case 1:
|
case 1:
|
||||||
return 'ALLOW';
|
return 'ALLOW';
|
||||||
|
case 0:
|
||||||
|
return 'CANCEL';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,32 +16,32 @@ class NavigationType {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
NavigationType._internal(value, nativeValue());
|
NavigationType._internal(value, nativeValue());
|
||||||
|
|
||||||
///A link with an href attribute was activated by the user.
|
|
||||||
static const LINK_ACTIVATED = NavigationType._internal(0, 0);
|
|
||||||
|
|
||||||
///A form was submitted.
|
|
||||||
static const FORM_SUBMITTED = NavigationType._internal(1, 1);
|
|
||||||
|
|
||||||
///An item from the back-forward list was requested.
|
///An item from the back-forward list was requested.
|
||||||
static const BACK_FORWARD = NavigationType._internal(2, 2);
|
static const BACK_FORWARD = NavigationType._internal(2, 2);
|
||||||
|
|
||||||
///The webpage was reloaded.
|
|
||||||
static const RELOAD = NavigationType._internal(3, 3);
|
|
||||||
|
|
||||||
///A form was resubmitted (for example by going back, going forward, or reloading).
|
///A form was resubmitted (for example by going back, going forward, or reloading).
|
||||||
static const FORM_RESUBMITTED = NavigationType._internal(4, 4);
|
static const FORM_RESUBMITTED = NavigationType._internal(4, 4);
|
||||||
|
|
||||||
|
///A form was submitted.
|
||||||
|
static const FORM_SUBMITTED = NavigationType._internal(1, 1);
|
||||||
|
|
||||||
|
///A link with an href attribute was activated by the user.
|
||||||
|
static const LINK_ACTIVATED = NavigationType._internal(0, 0);
|
||||||
|
|
||||||
///Navigation is taking place for some other reason.
|
///Navigation is taking place for some other reason.
|
||||||
static const OTHER = NavigationType._internal(-1, -1);
|
static const OTHER = NavigationType._internal(-1, -1);
|
||||||
|
|
||||||
|
///The webpage was reloaded.
|
||||||
|
static const RELOAD = NavigationType._internal(3, 3);
|
||||||
|
|
||||||
///Set of all values of [NavigationType].
|
///Set of all values of [NavigationType].
|
||||||
static final Set<NavigationType> values = [
|
static final Set<NavigationType> values = [
|
||||||
NavigationType.LINK_ACTIVATED,
|
|
||||||
NavigationType.FORM_SUBMITTED,
|
|
||||||
NavigationType.BACK_FORWARD,
|
NavigationType.BACK_FORWARD,
|
||||||
NavigationType.RELOAD,
|
|
||||||
NavigationType.FORM_RESUBMITTED,
|
NavigationType.FORM_RESUBMITTED,
|
||||||
|
NavigationType.FORM_SUBMITTED,
|
||||||
|
NavigationType.LINK_ACTIVATED,
|
||||||
NavigationType.OTHER,
|
NavigationType.OTHER,
|
||||||
|
NavigationType.RELOAD,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [NavigationType] instance from [int] value.
|
///Gets a possible [NavigationType] instance from [int] value.
|
||||||
|
@ -85,18 +85,18 @@ class NavigationType {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'LINK_ACTIVATED';
|
|
||||||
case 1:
|
|
||||||
return 'FORM_SUBMITTED';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'BACK_FORWARD';
|
return 'BACK_FORWARD';
|
||||||
case 3:
|
|
||||||
return 'RELOAD';
|
|
||||||
case 4:
|
case 4:
|
||||||
return 'FORM_RESUBMITTED';
|
return 'FORM_RESUBMITTED';
|
||||||
|
case 1:
|
||||||
|
return 'FORM_SUBMITTED';
|
||||||
|
case 0:
|
||||||
|
return 'LINK_ACTIVATED';
|
||||||
case -1:
|
case -1:
|
||||||
return 'OTHER';
|
return 'OTHER';
|
||||||
|
case 3:
|
||||||
|
return 'RELOAD';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
@ -114,32 +114,32 @@ class IOSWKNavigationType {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
IOSWKNavigationType._internal(value, nativeValue());
|
IOSWKNavigationType._internal(value, nativeValue());
|
||||||
|
|
||||||
///A link with an href attribute was activated by the user.
|
|
||||||
static const LINK_ACTIVATED = IOSWKNavigationType._internal(0, 0);
|
|
||||||
|
|
||||||
///A form was submitted.
|
|
||||||
static const FORM_SUBMITTED = IOSWKNavigationType._internal(1, 1);
|
|
||||||
|
|
||||||
///An item from the back-forward list was requested.
|
///An item from the back-forward list was requested.
|
||||||
static const BACK_FORWARD = IOSWKNavigationType._internal(2, 2);
|
static const BACK_FORWARD = IOSWKNavigationType._internal(2, 2);
|
||||||
|
|
||||||
///The webpage was reloaded.
|
|
||||||
static const RELOAD = IOSWKNavigationType._internal(3, 3);
|
|
||||||
|
|
||||||
///A form was resubmitted (for example by going back, going forward, or reloading).
|
///A form was resubmitted (for example by going back, going forward, or reloading).
|
||||||
static const FORM_RESUBMITTED = IOSWKNavigationType._internal(4, 4);
|
static const FORM_RESUBMITTED = IOSWKNavigationType._internal(4, 4);
|
||||||
|
|
||||||
|
///A form was submitted.
|
||||||
|
static const FORM_SUBMITTED = IOSWKNavigationType._internal(1, 1);
|
||||||
|
|
||||||
|
///A link with an href attribute was activated by the user.
|
||||||
|
static const LINK_ACTIVATED = IOSWKNavigationType._internal(0, 0);
|
||||||
|
|
||||||
///Navigation is taking place for some other reason.
|
///Navigation is taking place for some other reason.
|
||||||
static const OTHER = IOSWKNavigationType._internal(-1, -1);
|
static const OTHER = IOSWKNavigationType._internal(-1, -1);
|
||||||
|
|
||||||
|
///The webpage was reloaded.
|
||||||
|
static const RELOAD = IOSWKNavigationType._internal(3, 3);
|
||||||
|
|
||||||
///Set of all values of [IOSWKNavigationType].
|
///Set of all values of [IOSWKNavigationType].
|
||||||
static final Set<IOSWKNavigationType> values = [
|
static final Set<IOSWKNavigationType> values = [
|
||||||
IOSWKNavigationType.LINK_ACTIVATED,
|
|
||||||
IOSWKNavigationType.FORM_SUBMITTED,
|
|
||||||
IOSWKNavigationType.BACK_FORWARD,
|
IOSWKNavigationType.BACK_FORWARD,
|
||||||
IOSWKNavigationType.RELOAD,
|
|
||||||
IOSWKNavigationType.FORM_RESUBMITTED,
|
IOSWKNavigationType.FORM_RESUBMITTED,
|
||||||
|
IOSWKNavigationType.FORM_SUBMITTED,
|
||||||
|
IOSWKNavigationType.LINK_ACTIVATED,
|
||||||
IOSWKNavigationType.OTHER,
|
IOSWKNavigationType.OTHER,
|
||||||
|
IOSWKNavigationType.RELOAD,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [IOSWKNavigationType] instance from [int] value.
|
///Gets a possible [IOSWKNavigationType] instance from [int] value.
|
||||||
|
@ -183,18 +183,18 @@ class IOSWKNavigationType {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 0:
|
|
||||||
return 'LINK_ACTIVATED';
|
|
||||||
case 1:
|
|
||||||
return 'FORM_SUBMITTED';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'BACK_FORWARD';
|
return 'BACK_FORWARD';
|
||||||
case 3:
|
|
||||||
return 'RELOAD';
|
|
||||||
case 4:
|
case 4:
|
||||||
return 'FORM_RESUBMITTED';
|
return 'FORM_RESUBMITTED';
|
||||||
|
case 1:
|
||||||
|
return 'FORM_SUBMITTED';
|
||||||
|
case 0:
|
||||||
|
return 'LINK_ACTIVATED';
|
||||||
case -1:
|
case -1:
|
||||||
return 'OTHER';
|
return 'OTHER';
|
||||||
|
case 3:
|
||||||
|
return 'RELOAD';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,9 @@ part of 'permission_request.dart';
|
||||||
|
|
||||||
///Class that represents the response used by the [WebView.onPermissionRequest] event.
|
///Class that represents the response used by the [WebView.onPermissionRequest] event.
|
||||||
class PermissionRequest {
|
class PermissionRequest {
|
||||||
|
///The frame that initiates the request in the web view.
|
||||||
|
FrameInfo? frame;
|
||||||
|
|
||||||
///The origin of web content which attempt to access the restricted resources.
|
///The origin of web content which attempt to access the restricted resources.
|
||||||
WebUri origin;
|
WebUri origin;
|
||||||
|
|
||||||
|
@ -16,11 +19,8 @@ class PermissionRequest {
|
||||||
///**NOTE for iOS**: this list will have only 1 element and will be used by the [PermissionResponse.action]
|
///**NOTE for iOS**: this list will have only 1 element and will be used by the [PermissionResponse.action]
|
||||||
///as the resource to consider when applying the corresponding action.
|
///as the resource to consider when applying the corresponding action.
|
||||||
List<PermissionResourceType> resources;
|
List<PermissionResourceType> resources;
|
||||||
|
|
||||||
///The frame that initiates the request in the web view.
|
|
||||||
FrameInfo? frame;
|
|
||||||
PermissionRequest(
|
PermissionRequest(
|
||||||
{required this.origin, this.resources = const [], this.frame});
|
{this.frame, required this.origin, this.resources = const []});
|
||||||
|
|
||||||
///Gets a possible [PermissionRequest] instance from a [Map] value.
|
///Gets a possible [PermissionRequest] instance from a [Map] value.
|
||||||
static PermissionRequest? fromMap(Map<String, dynamic>? map) {
|
static PermissionRequest? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -28,8 +28,8 @@ class PermissionRequest {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = PermissionRequest(
|
final instance = PermissionRequest(
|
||||||
origin: WebUri(map['origin']),
|
|
||||||
frame: FrameInfo.fromMap(map['frame']?.cast<String, dynamic>()),
|
frame: FrameInfo.fromMap(map['frame']?.cast<String, dynamic>()),
|
||||||
|
origin: WebUri(map['origin']),
|
||||||
);
|
);
|
||||||
instance.resources = List<PermissionResourceType>.from(map['resources']
|
instance.resources = List<PermissionResourceType>.from(map['resources']
|
||||||
.map((e) => PermissionResourceType.fromNativeValue(e)!));
|
.map((e) => PermissionResourceType.fromNativeValue(e)!));
|
||||||
|
@ -39,9 +39,9 @@ class PermissionRequest {
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
|
"frame": frame?.toMap(),
|
||||||
"origin": origin.toString(),
|
"origin": origin.toString(),
|
||||||
"resources": resources.map((e) => e.toNativeValue()).toList(),
|
"resources": resources.map((e) => e.toNativeValue()).toList(),
|
||||||
"frame": frame?.toMap(),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +52,6 @@ class PermissionRequest {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'PermissionRequest{origin: $origin, resources: $resources, frame: $frame}';
|
return 'PermissionRequest{frame: $frame, origin: $origin, resources: $resources}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,59 +16,6 @@ class PermissionResourceType {
|
||||||
String value, Function nativeValue) =>
|
String value, Function nativeValue) =>
|
||||||
PermissionResourceType._internal(value, nativeValue());
|
PermissionResourceType._internal(value, nativeValue());
|
||||||
|
|
||||||
///Resource belongs to audio capture device, like microphone.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView ([Official API - PermissionRequest.RESOURCE_AUDIO_CAPTURE](https://developer.android.com/reference/android/webkit/PermissionRequest#RESOURCE_AUDIO_CAPTURE))
|
|
||||||
///- iOS 15.0+ ([Official API - WKMediaCaptureType.microphone](https://developer.apple.com/documentation/webkit/wkmediacapturetype/microphone))
|
|
||||||
///- MacOS 12.0+ ([Official API - WKMediaCaptureType.microphone](https://developer.apple.com/documentation/webkit/wkmediacapturetype/microphone))
|
|
||||||
static final MICROPHONE =
|
|
||||||
PermissionResourceType._internalMultiPlatform('MICROPHONE', () {
|
|
||||||
switch (defaultTargetPlatform) {
|
|
||||||
case TargetPlatform.android:
|
|
||||||
return 'android.webkit.resource.AUDIO_CAPTURE';
|
|
||||||
case TargetPlatform.iOS:
|
|
||||||
return 1;
|
|
||||||
case TargetPlatform.macOS:
|
|
||||||
return 1;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
///Resource will allow sysex messages to be sent to or received from MIDI devices.
|
|
||||||
///These messages are privileged operations, e.g. modifying sound libraries and sampling data, or even updating the MIDI device's firmware.
|
|
||||||
///Permission may be requested for this resource in API levels 21 and above, if the Android device has been updated to WebView 45 or above.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView ([Official API - PermissionRequest.RESOURCE_MIDI_SYSEX](https://developer.android.com/reference/android/webkit/PermissionRequest#RESOURCE_MIDI_SYSEX))
|
|
||||||
static final MIDI_SYSEX =
|
|
||||||
PermissionResourceType._internalMultiPlatform('MIDI_SYSEX', () {
|
|
||||||
switch (defaultTargetPlatform) {
|
|
||||||
case TargetPlatform.android:
|
|
||||||
return 'android.webkit.resource.MIDI_SYSEX';
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
///Resource belongs to protected media identifier. After the user grants this resource, the origin can use EME APIs to generate the license requests.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView ([Official API - PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID](https://developer.android.com/reference/android/webkit/PermissionRequest#RESOURCE_PROTECTED_MEDIA_ID))
|
|
||||||
static final PROTECTED_MEDIA_ID =
|
|
||||||
PermissionResourceType._internalMultiPlatform('PROTECTED_MEDIA_ID', () {
|
|
||||||
switch (defaultTargetPlatform) {
|
|
||||||
case TargetPlatform.android:
|
|
||||||
return 'android.webkit.resource.PROTECTED_MEDIA_ID';
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
///Resource belongs to video capture device, like camera.
|
///Resource belongs to video capture device, like camera.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -128,14 +75,67 @@ class PermissionResourceType {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
///Resource belongs to audio capture device, like microphone.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView ([Official API - PermissionRequest.RESOURCE_AUDIO_CAPTURE](https://developer.android.com/reference/android/webkit/PermissionRequest#RESOURCE_AUDIO_CAPTURE))
|
||||||
|
///- iOS 15.0+ ([Official API - WKMediaCaptureType.microphone](https://developer.apple.com/documentation/webkit/wkmediacapturetype/microphone))
|
||||||
|
///- MacOS 12.0+ ([Official API - WKMediaCaptureType.microphone](https://developer.apple.com/documentation/webkit/wkmediacapturetype/microphone))
|
||||||
|
static final MICROPHONE =
|
||||||
|
PermissionResourceType._internalMultiPlatform('MICROPHONE', () {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.android:
|
||||||
|
return 'android.webkit.resource.AUDIO_CAPTURE';
|
||||||
|
case TargetPlatform.iOS:
|
||||||
|
return 1;
|
||||||
|
case TargetPlatform.macOS:
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
|
///Resource will allow sysex messages to be sent to or received from MIDI devices.
|
||||||
|
///These messages are privileged operations, e.g. modifying sound libraries and sampling data, or even updating the MIDI device's firmware.
|
||||||
|
///Permission may be requested for this resource in API levels 21 and above, if the Android device has been updated to WebView 45 or above.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView ([Official API - PermissionRequest.RESOURCE_MIDI_SYSEX](https://developer.android.com/reference/android/webkit/PermissionRequest#RESOURCE_MIDI_SYSEX))
|
||||||
|
static final MIDI_SYSEX =
|
||||||
|
PermissionResourceType._internalMultiPlatform('MIDI_SYSEX', () {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.android:
|
||||||
|
return 'android.webkit.resource.MIDI_SYSEX';
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
|
///Resource belongs to protected media identifier. After the user grants this resource, the origin can use EME APIs to generate the license requests.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView ([Official API - PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID](https://developer.android.com/reference/android/webkit/PermissionRequest#RESOURCE_PROTECTED_MEDIA_ID))
|
||||||
|
static final PROTECTED_MEDIA_ID =
|
||||||
|
PermissionResourceType._internalMultiPlatform('PROTECTED_MEDIA_ID', () {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.android:
|
||||||
|
return 'android.webkit.resource.PROTECTED_MEDIA_ID';
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
///Set of all values of [PermissionResourceType].
|
///Set of all values of [PermissionResourceType].
|
||||||
static final Set<PermissionResourceType> values = [
|
static final Set<PermissionResourceType> values = [
|
||||||
PermissionResourceType.MICROPHONE,
|
|
||||||
PermissionResourceType.MIDI_SYSEX,
|
|
||||||
PermissionResourceType.PROTECTED_MEDIA_ID,
|
|
||||||
PermissionResourceType.CAMERA,
|
PermissionResourceType.CAMERA,
|
||||||
PermissionResourceType.CAMERA_AND_MICROPHONE,
|
PermissionResourceType.CAMERA_AND_MICROPHONE,
|
||||||
PermissionResourceType.DEVICE_ORIENTATION_AND_MOTION,
|
PermissionResourceType.DEVICE_ORIENTATION_AND_MOTION,
|
||||||
|
PermissionResourceType.MICROPHONE,
|
||||||
|
PermissionResourceType.MIDI_SYSEX,
|
||||||
|
PermissionResourceType.PROTECTED_MEDIA_ID,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [PermissionResourceType] instance from [String] value.
|
///Gets a possible [PermissionResourceType] instance from [String] value.
|
||||||
|
|
|
@ -8,15 +8,15 @@ part of 'permission_response.dart';
|
||||||
|
|
||||||
///Class that represents the response used by the [WebView.onPermissionRequest] event.
|
///Class that represents the response used by the [WebView.onPermissionRequest] event.
|
||||||
class PermissionResponse {
|
class PermissionResponse {
|
||||||
|
///Indicate the [PermissionResponseAction] to take in response of a permission request.
|
||||||
|
PermissionResponseAction? action;
|
||||||
|
|
||||||
///Resources granted to be accessed by origin.
|
///Resources granted to be accessed by origin.
|
||||||
///
|
///
|
||||||
///**NOTE for iOS**: not used. The [action] taken is based on the [PermissionRequest.resources].
|
///**NOTE for iOS**: not used. The [action] taken is based on the [PermissionRequest.resources].
|
||||||
List<PermissionResourceType> resources;
|
List<PermissionResourceType> resources;
|
||||||
|
|
||||||
///Indicate the [PermissionResponseAction] to take in response of a permission request.
|
|
||||||
PermissionResponseAction? action;
|
|
||||||
PermissionResponse(
|
PermissionResponse(
|
||||||
{this.resources = const [], this.action = PermissionResponseAction.DENY});
|
{this.action = PermissionResponseAction.DENY, this.resources = const []});
|
||||||
|
|
||||||
///Gets a possible [PermissionResponse] instance from a [Map] value.
|
///Gets a possible [PermissionResponse] instance from a [Map] value.
|
||||||
static PermissionResponse? fromMap(Map<String, dynamic>? map) {
|
static PermissionResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -24,17 +24,17 @@ class PermissionResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = PermissionResponse();
|
final instance = PermissionResponse();
|
||||||
|
instance.action = PermissionResponseAction.fromNativeValue(map['action']);
|
||||||
instance.resources = List<PermissionResourceType>.from(map['resources']
|
instance.resources = List<PermissionResourceType>.from(map['resources']
|
||||||
.map((e) => PermissionResourceType.fromNativeValue(e)!));
|
.map((e) => PermissionResourceType.fromNativeValue(e)!));
|
||||||
instance.action = PermissionResponseAction.fromNativeValue(map['action']);
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"resources": resources.map((e) => e.toNativeValue()).toList(),
|
|
||||||
"action": action?.toNativeValue(),
|
"action": action?.toNativeValue(),
|
||||||
|
"resources": resources.map((e) => e.toNativeValue()).toList(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class PermissionResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'PermissionResponse{resources: $resources, action: $action}';
|
return 'PermissionResponse{action: $action, resources: $resources}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,14 +53,14 @@ class PermissionResponse {
|
||||||
///Use [PermissionResponse] instead.
|
///Use [PermissionResponse] instead.
|
||||||
@Deprecated('Use PermissionResponse instead')
|
@Deprecated('Use PermissionResponse instead')
|
||||||
class PermissionRequestResponse {
|
class PermissionRequestResponse {
|
||||||
///Resources granted to be accessed by origin.
|
|
||||||
List<String> resources;
|
|
||||||
|
|
||||||
///Indicate the [PermissionRequestResponseAction] to take in response of a permission request.
|
///Indicate the [PermissionRequestResponseAction] to take in response of a permission request.
|
||||||
PermissionRequestResponseAction? action;
|
PermissionRequestResponseAction? action;
|
||||||
|
|
||||||
|
///Resources granted to be accessed by origin.
|
||||||
|
List<String> resources;
|
||||||
PermissionRequestResponse(
|
PermissionRequestResponse(
|
||||||
{this.resources = const [],
|
{this.action = PermissionRequestResponseAction.DENY,
|
||||||
this.action = PermissionRequestResponseAction.DENY});
|
this.resources = const []});
|
||||||
|
|
||||||
///Gets a possible [PermissionRequestResponse] instance from a [Map] value.
|
///Gets a possible [PermissionRequestResponse] instance from a [Map] value.
|
||||||
static PermissionRequestResponse? fromMap(Map<String, dynamic>? map) {
|
static PermissionRequestResponse? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -68,17 +68,17 @@ class PermissionRequestResponse {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final instance = PermissionRequestResponse();
|
final instance = PermissionRequestResponse();
|
||||||
instance.resources = map['resources'].cast<String>();
|
|
||||||
instance.action =
|
instance.action =
|
||||||
PermissionRequestResponseAction.fromNativeValue(map['action']);
|
PermissionRequestResponseAction.fromNativeValue(map['action']);
|
||||||
|
instance.resources = map['resources'].cast<String>();
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts instance to a map.
|
///Converts instance to a map.
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"resources": resources,
|
|
||||||
"action": action?.toNativeValue(),
|
"action": action?.toNativeValue(),
|
||||||
|
"resources": resources,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +89,6 @@ class PermissionRequestResponse {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'PermissionRequestResponse{resources: $resources, action: $action}';
|
return 'PermissionRequestResponse{action: $action, resources: $resources}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,12 @@ class PrintJobAttributes {
|
||||||
///- MacOS
|
///- MacOS
|
||||||
PrintJobColorMode? colorMode;
|
PrintJobColorMode? colorMode;
|
||||||
|
|
||||||
|
///If `true`, produce detailed reports when an error occurs.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
bool? detailedErrorReporting;
|
||||||
|
|
||||||
///The duplex mode to use for the print job.
|
///The duplex mode to use for the print job.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -24,29 +30,11 @@ class PrintJobAttributes {
|
||||||
///- MacOS
|
///- MacOS
|
||||||
PrintJobDuplexMode? duplex;
|
PrintJobDuplexMode? duplex;
|
||||||
|
|
||||||
///The orientation of the printed content, portrait or landscape.
|
///A fax number.
|
||||||
PrintJobOrientation? orientation;
|
|
||||||
|
|
||||||
///The media size.
|
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- Android native WebView
|
|
||||||
PrintJobMediaSize? mediaSize;
|
|
||||||
|
|
||||||
///The supported resolution in DPI (dots per inch).
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
PrintJobResolution? resolution;
|
|
||||||
|
|
||||||
///The margins for each printed page.
|
|
||||||
///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**:
|
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
///- MacOS
|
||||||
EdgeInsets? margins;
|
String? faxNumber;
|
||||||
|
|
||||||
///The height of the page footer.
|
///The height of the page footer.
|
||||||
///
|
///
|
||||||
|
@ -57,6 +45,12 @@ class PrintJobAttributes {
|
||||||
///- iOS
|
///- iOS
|
||||||
double? footerHeight;
|
double? footerHeight;
|
||||||
|
|
||||||
|
///If `true`, a standard header and footer are added outside the margins of each page.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
bool? headerAndFooter;
|
||||||
|
|
||||||
///The height of the page header.
|
///The height of the page header.
|
||||||
///
|
///
|
||||||
///The header is measured in points from the top of [printableRect] and is above the content area.
|
///The header is measured in points from the top of [printableRect] and is above the content area.
|
||||||
|
@ -66,25 +60,56 @@ class PrintJobAttributes {
|
||||||
///- iOS
|
///- iOS
|
||||||
double? headerHeight;
|
double? headerHeight;
|
||||||
|
|
||||||
///The area in which printing can occur.
|
///The horizontal pagination mode.
|
||||||
///
|
|
||||||
///The value of this property is a rectangle that defines the area in which the printer can print content.
|
|
||||||
///Sometimes this is referred to as the imageable area of the paper.
|
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
|
||||||
///- MacOS
|
///- MacOS
|
||||||
InAppWebViewRect? printableRect;
|
PrintJobPaginationMode? horizontalPagination;
|
||||||
|
|
||||||
///The size of the paper used for printing.
|
///Indicates whether the image is centered horizontally.
|
||||||
///
|
///
|
||||||
///The value of this property is a rectangle that defines the size of paper chosen for the print job.
|
///**Supported Platforms/Implementations**:
|
||||||
///The origin is always (0,0).
|
///- MacOS
|
||||||
|
bool? isHorizontallyCentered;
|
||||||
|
|
||||||
|
///Indicates whether only the currently selected contents should be printed.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
bool? isSelectionOnly;
|
||||||
|
|
||||||
|
///Indicates whether the image is centered vertically.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
bool? isVerticallyCentered;
|
||||||
|
|
||||||
|
///The action specified for the job.
|
||||||
|
///
|
||||||
|
///**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**:
|
||||||
|
///- MacOS
|
||||||
|
WebUri? jobSavingURL;
|
||||||
|
|
||||||
|
///The human-readable name of the currently selected paper size, suitable for presentation in user interfaces.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
String? localizedPaperName;
|
||||||
|
|
||||||
|
///The margins for each printed page.
|
||||||
|
///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**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- iOS
|
///- iOS
|
||||||
///- MacOS
|
///- MacOS
|
||||||
InAppWebViewRect? paperRect;
|
EdgeInsets? margins;
|
||||||
|
|
||||||
///The maximum height of the content area.
|
///The maximum height of the content area.
|
||||||
///
|
///
|
||||||
|
@ -107,83 +132,11 @@ class PrintJobAttributes {
|
||||||
///- iOS
|
///- iOS
|
||||||
double? maximumContentWidth;
|
double? maximumContentWidth;
|
||||||
|
|
||||||
///The name of the currently selected paper size.
|
///The media size.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- MacOS
|
///- Android native WebView
|
||||||
String? paperName;
|
PrintJobMediaSize? mediaSize;
|
||||||
|
|
||||||
///The human-readable name of the currently selected paper size, suitable for presentation in user interfaces.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
String? localizedPaperName;
|
|
||||||
|
|
||||||
///The horizontal pagination mode.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
PrintJobPaginationMode? horizontalPagination;
|
|
||||||
|
|
||||||
///The vertical pagination to the specified mode.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
PrintJobPaginationMode? verticalPagination;
|
|
||||||
|
|
||||||
///The action specified for the job.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
PrintJobDisposition? jobDisposition;
|
|
||||||
|
|
||||||
///Indicates whether the image is centered horizontally.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
bool? isHorizontallyCentered;
|
|
||||||
|
|
||||||
///Indicates whether the image is centered vertically.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
bool? isVerticallyCentered;
|
|
||||||
|
|
||||||
///Indicates whether only the currently selected contents should be printed.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
bool? isSelectionOnly;
|
|
||||||
|
|
||||||
///The current scaling factor.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
double? scalingFactor;
|
|
||||||
|
|
||||||
///An URL containing the location to which the job file will be saved when the [jobDisposition] is [PrintJobDisposition.SAVE].
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
WebUri? jobSavingURL;
|
|
||||||
|
|
||||||
///If `true`, produce detailed reports when an error occurs.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
bool? detailedErrorReporting;
|
|
||||||
|
|
||||||
///A fax number.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
String? faxNumber;
|
|
||||||
|
|
||||||
///If `true`, a standard header and footer are added outside the margins of each page.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- MacOS
|
|
||||||
bool? headerAndFooter;
|
|
||||||
|
|
||||||
///If `true`, collates output.
|
///If `true`, collates output.
|
||||||
///
|
///
|
||||||
|
@ -191,6 +144,9 @@ class PrintJobAttributes {
|
||||||
///- MacOS
|
///- MacOS
|
||||||
bool? mustCollate;
|
bool? mustCollate;
|
||||||
|
|
||||||
|
///The orientation of the printed content, portrait or landscape.
|
||||||
|
PrintJobOrientation? orientation;
|
||||||
|
|
||||||
///The number of logical pages to be tiled horizontally on a physical sheet of paper.
|
///The number of logical pages to be tiled horizontally on a physical sheet of paper.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -203,41 +159,85 @@ class PrintJobAttributes {
|
||||||
///- MacOS
|
///- MacOS
|
||||||
int? pagesDown;
|
int? pagesDown;
|
||||||
|
|
||||||
|
///The name of the currently selected paper size.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
String? paperName;
|
||||||
|
|
||||||
|
///The size of the paper used for printing.
|
||||||
|
///
|
||||||
|
///The value of this property is a rectangle that defines the size of paper chosen for the print job.
|
||||||
|
///The origin is always (0,0).
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
InAppWebViewRect? paperRect;
|
||||||
|
|
||||||
|
///The area in which printing can occur.
|
||||||
|
///
|
||||||
|
///The value of this property is a rectangle that defines the area in which the printer can print content.
|
||||||
|
///Sometimes this is referred to as the imageable area of the paper.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- iOS
|
||||||
|
///- MacOS
|
||||||
|
InAppWebViewRect? printableRect;
|
||||||
|
|
||||||
|
///The supported resolution in DPI (dots per inch).
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
|
PrintJobResolution? resolution;
|
||||||
|
|
||||||
|
///The current scaling factor.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
double? scalingFactor;
|
||||||
|
|
||||||
///A timestamp that specifies the time at which printing should begin.
|
///A timestamp that specifies the time at which printing should begin.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
///- MacOS
|
///- MacOS
|
||||||
int? time;
|
int? time;
|
||||||
|
|
||||||
|
///The vertical pagination to the specified mode.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- MacOS
|
||||||
|
PrintJobPaginationMode? verticalPagination;
|
||||||
PrintJobAttributes(
|
PrintJobAttributes(
|
||||||
{this.colorMode,
|
{this.colorMode,
|
||||||
|
this.detailedErrorReporting,
|
||||||
this.duplex,
|
this.duplex,
|
||||||
this.orientation,
|
this.faxNumber,
|
||||||
this.mediaSize,
|
|
||||||
this.resolution,
|
|
||||||
this.margins,
|
|
||||||
this.footerHeight,
|
this.footerHeight,
|
||||||
|
this.headerAndFooter,
|
||||||
this.headerHeight,
|
this.headerHeight,
|
||||||
this.printableRect,
|
this.horizontalPagination,
|
||||||
this.paperRect,
|
this.isHorizontallyCentered,
|
||||||
|
this.isSelectionOnly,
|
||||||
|
this.isVerticallyCentered,
|
||||||
|
this.jobDisposition,
|
||||||
|
this.jobSavingURL,
|
||||||
|
this.localizedPaperName,
|
||||||
|
this.margins,
|
||||||
this.maximumContentHeight,
|
this.maximumContentHeight,
|
||||||
this.maximumContentWidth,
|
this.maximumContentWidth,
|
||||||
this.paperName,
|
this.mediaSize,
|
||||||
this.localizedPaperName,
|
|
||||||
this.horizontalPagination,
|
|
||||||
this.verticalPagination,
|
|
||||||
this.jobDisposition,
|
|
||||||
this.isHorizontallyCentered,
|
|
||||||
this.isVerticallyCentered,
|
|
||||||
this.isSelectionOnly,
|
|
||||||
this.scalingFactor,
|
|
||||||
this.jobSavingURL,
|
|
||||||
this.detailedErrorReporting,
|
|
||||||
this.faxNumber,
|
|
||||||
this.headerAndFooter,
|
|
||||||
this.mustCollate,
|
this.mustCollate,
|
||||||
|
this.orientation,
|
||||||
this.pagesAcross,
|
this.pagesAcross,
|
||||||
this.pagesDown,
|
this.pagesDown,
|
||||||
this.time});
|
this.paperName,
|
||||||
|
this.paperRect,
|
||||||
|
this.printableRect,
|
||||||
|
this.resolution,
|
||||||
|
this.scalingFactor,
|
||||||
|
this.time,
|
||||||
|
this.verticalPagination});
|
||||||
|
|
||||||
///Gets a possible [PrintJobAttributes] instance from a [Map] value.
|
///Gets a possible [PrintJobAttributes] instance from a [Map] value.
|
||||||
static PrintJobAttributes? fromMap(Map<String, dynamic>? map) {
|
static PrintJobAttributes? fromMap(Map<String, dynamic>? map) {
|
||||||
|
@ -246,42 +246,42 @@ class PrintJobAttributes {
|
||||||
}
|
}
|
||||||
final instance = PrintJobAttributes(
|
final instance = PrintJobAttributes(
|
||||||
colorMode: PrintJobColorMode.fromNativeValue(map['colorMode']),
|
colorMode: PrintJobColorMode.fromNativeValue(map['colorMode']),
|
||||||
|
detailedErrorReporting: map['detailedErrorReporting'],
|
||||||
duplex: PrintJobDuplexMode.fromNativeValue(map['duplex']),
|
duplex: PrintJobDuplexMode.fromNativeValue(map['duplex']),
|
||||||
orientation: PrintJobOrientation.fromNativeValue(map['orientation']),
|
faxNumber: map['faxNumber'],
|
||||||
mediaSize:
|
|
||||||
PrintJobMediaSize.fromMap(map['mediaSize']?.cast<String, dynamic>()),
|
|
||||||
resolution: PrintJobResolution.fromMap(
|
|
||||||
map['resolution']?.cast<String, dynamic>()),
|
|
||||||
margins: MapEdgeInsets.fromMap(map['margins']?.cast<String, dynamic>()),
|
|
||||||
footerHeight: map['footerHeight'],
|
footerHeight: map['footerHeight'],
|
||||||
|
headerAndFooter: map['headerAndFooter'],
|
||||||
headerHeight: map['headerHeight'],
|
headerHeight: map['headerHeight'],
|
||||||
printableRect: InAppWebViewRect.fromMap(
|
|
||||||
map['printableRect']?.cast<String, dynamic>()),
|
|
||||||
paperRect:
|
|
||||||
InAppWebViewRect.fromMap(map['paperRect']?.cast<String, dynamic>()),
|
|
||||||
maximumContentHeight: map['maximumContentHeight'],
|
|
||||||
maximumContentWidth: map['maximumContentWidth'],
|
|
||||||
paperName: map['paperName'],
|
|
||||||
localizedPaperName: map['localizedPaperName'],
|
|
||||||
horizontalPagination:
|
horizontalPagination:
|
||||||
PrintJobPaginationMode.fromNativeValue(map['horizontalPagination']),
|
PrintJobPaginationMode.fromNativeValue(map['horizontalPagination']),
|
||||||
verticalPagination:
|
isHorizontallyCentered: map['isHorizontallyCentered'],
|
||||||
PrintJobPaginationMode.fromNativeValue(map['verticalPagination']),
|
isSelectionOnly: map['isSelectionOnly'],
|
||||||
|
isVerticallyCentered: map['isVerticallyCentered'],
|
||||||
jobDisposition:
|
jobDisposition:
|
||||||
PrintJobDisposition.fromNativeValue(map['jobDisposition']),
|
PrintJobDisposition.fromNativeValue(map['jobDisposition']),
|
||||||
isHorizontallyCentered: map['isHorizontallyCentered'],
|
|
||||||
isVerticallyCentered: map['isVerticallyCentered'],
|
|
||||||
isSelectionOnly: map['isSelectionOnly'],
|
|
||||||
scalingFactor: map['scalingFactor'],
|
|
||||||
jobSavingURL:
|
jobSavingURL:
|
||||||
map['jobSavingURL'] != null ? WebUri(map['jobSavingURL']) : null,
|
map['jobSavingURL'] != null ? WebUri(map['jobSavingURL']) : null,
|
||||||
detailedErrorReporting: map['detailedErrorReporting'],
|
localizedPaperName: map['localizedPaperName'],
|
||||||
faxNumber: map['faxNumber'],
|
margins: MapEdgeInsets.fromMap(map['margins']?.cast<String, dynamic>()),
|
||||||
headerAndFooter: map['headerAndFooter'],
|
maximumContentHeight: map['maximumContentHeight'],
|
||||||
|
maximumContentWidth: map['maximumContentWidth'],
|
||||||
|
mediaSize:
|
||||||
|
PrintJobMediaSize.fromMap(map['mediaSize']?.cast<String, dynamic>()),
|
||||||
mustCollate: map['mustCollate'],
|
mustCollate: map['mustCollate'],
|
||||||
|
orientation: PrintJobOrientation.fromNativeValue(map['orientation']),
|
||||||
pagesAcross: map['pagesAcross'],
|
pagesAcross: map['pagesAcross'],
|
||||||
pagesDown: map['pagesDown'],
|
pagesDown: map['pagesDown'],
|
||||||
|
paperName: map['paperName'],
|
||||||
|
paperRect:
|
||||||
|
InAppWebViewRect.fromMap(map['paperRect']?.cast<String, dynamic>()),
|
||||||
|
printableRect: InAppWebViewRect.fromMap(
|
||||||
|
map['printableRect']?.cast<String, dynamic>()),
|
||||||
|
resolution: PrintJobResolution.fromMap(
|
||||||
|
map['resolution']?.cast<String, dynamic>()),
|
||||||
|
scalingFactor: map['scalingFactor'],
|
||||||
time: map['time'],
|
time: map['time'],
|
||||||
|
verticalPagination:
|
||||||
|
PrintJobPaginationMode.fromNativeValue(map['verticalPagination']),
|
||||||
);
|
);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -290,34 +290,34 @@ class PrintJobAttributes {
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"colorMode": colorMode?.toNativeValue(),
|
"colorMode": colorMode?.toNativeValue(),
|
||||||
|
"detailedErrorReporting": detailedErrorReporting,
|
||||||
"duplex": duplex?.toNativeValue(),
|
"duplex": duplex?.toNativeValue(),
|
||||||
"orientation": orientation?.toNativeValue(),
|
"faxNumber": faxNumber,
|
||||||
"mediaSize": mediaSize?.toMap(),
|
|
||||||
"resolution": resolution?.toMap(),
|
|
||||||
"margins": margins?.toMap(),
|
|
||||||
"footerHeight": footerHeight,
|
"footerHeight": footerHeight,
|
||||||
|
"headerAndFooter": headerAndFooter,
|
||||||
"headerHeight": headerHeight,
|
"headerHeight": headerHeight,
|
||||||
"printableRect": printableRect?.toMap(),
|
"horizontalPagination": horizontalPagination?.toNativeValue(),
|
||||||
"paperRect": paperRect?.toMap(),
|
"isHorizontallyCentered": isHorizontallyCentered,
|
||||||
|
"isSelectionOnly": isSelectionOnly,
|
||||||
|
"isVerticallyCentered": isVerticallyCentered,
|
||||||
|
"jobDisposition": jobDisposition?.toNativeValue(),
|
||||||
|
"jobSavingURL": jobSavingURL?.toString(),
|
||||||
|
"localizedPaperName": localizedPaperName,
|
||||||
|
"margins": margins?.toMap(),
|
||||||
"maximumContentHeight": maximumContentHeight,
|
"maximumContentHeight": maximumContentHeight,
|
||||||
"maximumContentWidth": maximumContentWidth,
|
"maximumContentWidth": maximumContentWidth,
|
||||||
"paperName": paperName,
|
"mediaSize": mediaSize?.toMap(),
|
||||||
"localizedPaperName": localizedPaperName,
|
|
||||||
"horizontalPagination": horizontalPagination?.toNativeValue(),
|
|
||||||
"verticalPagination": verticalPagination?.toNativeValue(),
|
|
||||||
"jobDisposition": jobDisposition?.toNativeValue(),
|
|
||||||
"isHorizontallyCentered": isHorizontallyCentered,
|
|
||||||
"isVerticallyCentered": isVerticallyCentered,
|
|
||||||
"isSelectionOnly": isSelectionOnly,
|
|
||||||
"scalingFactor": scalingFactor,
|
|
||||||
"jobSavingURL": jobSavingURL?.toString(),
|
|
||||||
"detailedErrorReporting": detailedErrorReporting,
|
|
||||||
"faxNumber": faxNumber,
|
|
||||||
"headerAndFooter": headerAndFooter,
|
|
||||||
"mustCollate": mustCollate,
|
"mustCollate": mustCollate,
|
||||||
|
"orientation": orientation?.toNativeValue(),
|
||||||
"pagesAcross": pagesAcross,
|
"pagesAcross": pagesAcross,
|
||||||
"pagesDown": pagesDown,
|
"pagesDown": pagesDown,
|
||||||
|
"paperName": paperName,
|
||||||
|
"paperRect": paperRect?.toMap(),
|
||||||
|
"printableRect": printableRect?.toMap(),
|
||||||
|
"resolution": resolution?.toMap(),
|
||||||
|
"scalingFactor": scalingFactor,
|
||||||
"time": time,
|
"time": time,
|
||||||
|
"verticalPagination": verticalPagination?.toNativeValue(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,6 +328,6 @@ class PrintJobAttributes {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'PrintJobAttributes{colorMode: $colorMode, duplex: $duplex, orientation: $orientation, mediaSize: $mediaSize, resolution: $resolution, margins: $margins, footerHeight: $footerHeight, headerHeight: $headerHeight, printableRect: $printableRect, paperRect: $paperRect, maximumContentHeight: $maximumContentHeight, maximumContentWidth: $maximumContentWidth, paperName: $paperName, localizedPaperName: $localizedPaperName, horizontalPagination: $horizontalPagination, verticalPagination: $verticalPagination, jobDisposition: $jobDisposition, isHorizontallyCentered: $isHorizontallyCentered, isVerticallyCentered: $isVerticallyCentered, isSelectionOnly: $isSelectionOnly, scalingFactor: $scalingFactor, jobSavingURL: $jobSavingURL, detailedErrorReporting: $detailedErrorReporting, faxNumber: $faxNumber, headerAndFooter: $headerAndFooter, mustCollate: $mustCollate, pagesAcross: $pagesAcross, pagesDown: $pagesDown, time: $time}';
|
return 'PrintJobAttributes{colorMode: $colorMode, detailedErrorReporting: $detailedErrorReporting, duplex: $duplex, faxNumber: $faxNumber, footerHeight: $footerHeight, headerAndFooter: $headerAndFooter, headerHeight: $headerHeight, horizontalPagination: $horizontalPagination, isHorizontallyCentered: $isHorizontallyCentered, isSelectionOnly: $isSelectionOnly, isVerticallyCentered: $isVerticallyCentered, jobDisposition: $jobDisposition, jobSavingURL: $jobSavingURL, localizedPaperName: $localizedPaperName, margins: $margins, maximumContentHeight: $maximumContentHeight, maximumContentWidth: $maximumContentWidth, mediaSize: $mediaSize, mustCollate: $mustCollate, orientation: $orientation, pagesAcross: $pagesAcross, pagesDown: $pagesDown, paperName: $paperName, paperRect: $paperRect, printableRect: $printableRect, resolution: $resolution, scalingFactor: $scalingFactor, time: $time, verticalPagination: $verticalPagination}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,23 +16,6 @@ class PrintJobColorMode {
|
||||||
int value, Function nativeValue) =>
|
int value, Function nativeValue) =>
|
||||||
PrintJobColorMode._internal(value, nativeValue());
|
PrintJobColorMode._internal(value, nativeValue());
|
||||||
|
|
||||||
///Monochrome color scheme, for example one color is used.
|
|
||||||
///
|
|
||||||
///**Supported Platforms/Implementations**:
|
|
||||||
///- Android native WebView
|
|
||||||
///- MacOS
|
|
||||||
static final MONOCHROME = PrintJobColorMode._internalMultiPlatform(1, () {
|
|
||||||
switch (defaultTargetPlatform) {
|
|
||||||
case TargetPlatform.android:
|
|
||||||
return 1;
|
|
||||||
case TargetPlatform.macOS:
|
|
||||||
return 'Gray';
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
///Color color scheme, for example many colors are used.
|
///Color color scheme, for example many colors are used.
|
||||||
///
|
///
|
||||||
///**Supported Platforms/Implementations**:
|
///**Supported Platforms/Implementations**:
|
||||||
|
@ -50,10 +33,27 @@ class PrintJobColorMode {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
///Monochrome color scheme, for example one color is used.
|
||||||
|
///
|
||||||
|
///**Supported Platforms/Implementations**:
|
||||||
|
///- Android native WebView
|
||||||
|
///- MacOS
|
||||||
|
static final MONOCHROME = PrintJobColorMode._internalMultiPlatform(1, () {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.android:
|
||||||
|
return 1;
|
||||||
|
case TargetPlatform.macOS:
|
||||||
|
return 'Gray';
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
///Set of all values of [PrintJobColorMode].
|
///Set of all values of [PrintJobColorMode].
|
||||||
static final Set<PrintJobColorMode> values = [
|
static final Set<PrintJobColorMode> values = [
|
||||||
PrintJobColorMode.MONOCHROME,
|
|
||||||
PrintJobColorMode.COLOR,
|
PrintJobColorMode.COLOR,
|
||||||
|
PrintJobColorMode.MONOCHROME,
|
||||||
].toSet();
|
].toSet();
|
||||||
|
|
||||||
///Gets a possible [PrintJobColorMode] instance from [int] value.
|
///Gets a possible [PrintJobColorMode] instance from [int] value.
|
||||||
|
@ -97,10 +97,10 @@ class PrintJobColorMode {
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
switch (_value) {
|
switch (_value) {
|
||||||
case 1:
|
|
||||||
return 'MONOCHROME';
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'COLOR';
|
return 'COLOR';
|
||||||
|
case 1:
|
||||||
|
return 'MONOCHROME';
|
||||||
}
|
}
|
||||||
return _value.toString();
|
return _value.toString();
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue