fixed remaining classes and properties
This commit is contained in:
parent
cdd2bdb09f
commit
0312d12859
|
@ -31,7 +31,7 @@ import com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebView;
|
|||
import com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebViewChromeClient;
|
||||
import com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebViewSettings;
|
||||
import com.pichillilorenzo.flutter_inappwebview.pull_to_refresh.PullToRefreshLayout;
|
||||
import com.pichillilorenzo.flutter_inappwebview.pull_to_refresh.PullToRefreshOptions;
|
||||
import com.pichillilorenzo.flutter_inappwebview.pull_to_refresh.PullToRefreshSettings;
|
||||
import com.pichillilorenzo.flutter_inappwebview.types.URLRequest;
|
||||
import com.pichillilorenzo.flutter_inappwebview.types.UserScript;
|
||||
|
||||
|
@ -81,13 +81,13 @@ public class InAppBrowserActivity extends AppCompatActivity implements InAppBrow
|
|||
|
||||
setContentView(R.layout.activity_web_view);
|
||||
|
||||
Map<String, Object> pullToRefreshInitialOptions = (Map<String, Object>) b.getSerializable("pullToRefreshInitialOptions");
|
||||
Map<String, Object> pullToRefreshInitialSettings = (Map<String, Object>) b.getSerializable("pullToRefreshInitialSettings");
|
||||
MethodChannel pullToRefreshLayoutChannel = new MethodChannel(manager.plugin.messenger, "com.pichillilorenzo/flutter_inappwebview_pull_to_refresh_" + id);
|
||||
PullToRefreshOptions pullToRefreshOptions = new PullToRefreshOptions();
|
||||
pullToRefreshOptions.parse(pullToRefreshInitialOptions);
|
||||
PullToRefreshSettings pullToRefreshSettings = new PullToRefreshSettings();
|
||||
pullToRefreshSettings.parse(pullToRefreshInitialSettings);
|
||||
pullToRefreshLayout = findViewById(R.id.pullToRefresh);
|
||||
pullToRefreshLayout.channel = pullToRefreshLayoutChannel;
|
||||
pullToRefreshLayout.options = pullToRefreshOptions;
|
||||
pullToRefreshLayout.options = pullToRefreshSettings;
|
||||
pullToRefreshLayout.prepare();
|
||||
|
||||
webView = findViewById(R.id.webView);
|
||||
|
|
|
@ -174,7 +174,7 @@ public class InAppBrowserManager implements MethodChannel.MethodCallHandler {
|
|||
Map<String, Object> contextMenu = (Map<String, Object>) arguments.get("contextMenu");
|
||||
Integer windowId = (Integer) arguments.get("windowId");
|
||||
List<Map<String, Object>> initialUserScripts = (List<Map<String, Object>>) arguments.get("initialUserScripts");
|
||||
Map<String, Object> pullToRefreshInitialOptions = (Map<String, Object>) arguments.get("pullToRefreshOptions");
|
||||
Map<String, Object> pullToRefreshInitialSettings = (Map<String, Object>) arguments.get("pullToRefreshSettings");
|
||||
|
||||
Bundle extras = new Bundle();
|
||||
extras.putString("fromActivity", activity.getClass().getName());
|
||||
|
@ -191,7 +191,7 @@ public class InAppBrowserManager implements MethodChannel.MethodCallHandler {
|
|||
extras.putSerializable("contextMenu", (Serializable) contextMenu);
|
||||
extras.putInt("windowId", windowId != null ? windowId : -1);
|
||||
extras.putSerializable("initialUserScripts", (Serializable) initialUserScripts);
|
||||
extras.putSerializable("pullToRefreshInitialOptions", (Serializable) pullToRefreshInitialOptions);
|
||||
extras.putSerializable("pullToRefreshInitialSettings", (Serializable) pullToRefreshInitialSettings);
|
||||
startInAppBrowserActivity(activity, extras);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin;
|
|||
import com.pichillilorenzo.flutter_inappwebview.InAppWebViewMethodHandler;
|
||||
import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.JavaScriptBridgeJS;
|
||||
import com.pichillilorenzo.flutter_inappwebview.pull_to_refresh.PullToRefreshLayout;
|
||||
import com.pichillilorenzo.flutter_inappwebview.pull_to_refresh.PullToRefreshOptions;
|
||||
import com.pichillilorenzo.flutter_inappwebview.pull_to_refresh.PullToRefreshSettings;
|
||||
import com.pichillilorenzo.flutter_inappwebview.types.PlatformWebView;
|
||||
import com.pichillilorenzo.flutter_inappwebview.types.URLRequest;
|
||||
import com.pichillilorenzo.flutter_inappwebview.types.UserScript;
|
||||
|
@ -55,7 +55,7 @@ public class FlutterWebView implements PlatformWebView {
|
|||
Map<String, Object> contextMenu = (Map<String, Object>) params.get("contextMenu");
|
||||
Integer windowId = (Integer) params.get("windowId");
|
||||
List<Map<String, Object>> initialUserScripts = (List<Map<String, Object>>) params.get("initialUserScripts");
|
||||
Map<String, Object> pullToRefreshInitialOptions = (Map<String, Object>) params.get("pullToRefreshOptions");
|
||||
Map<String, Object> pullToRefreshInitialSettings = (Map<String, Object>) params.get("pullToRefreshSettings");
|
||||
|
||||
InAppWebViewSettings options = new InAppWebViewSettings();
|
||||
options.parse(initialSettings);
|
||||
|
@ -81,9 +81,9 @@ public class FlutterWebView implements PlatformWebView {
|
|||
// set MATCH_PARENT layout params to the WebView, otherwise it won't take all the available space!
|
||||
webView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
MethodChannel pullToRefreshLayoutChannel = new MethodChannel(plugin.messenger, "com.pichillilorenzo/flutter_inappwebview_pull_to_refresh_" + id);
|
||||
PullToRefreshOptions pullToRefreshOptions = new PullToRefreshOptions();
|
||||
pullToRefreshOptions.parse(pullToRefreshInitialOptions);
|
||||
pullToRefreshLayout = new PullToRefreshLayout(context, pullToRefreshLayoutChannel, pullToRefreshOptions);
|
||||
PullToRefreshSettings pullToRefreshSettings = new PullToRefreshSettings();
|
||||
pullToRefreshSettings.parse(pullToRefreshInitialSettings);
|
||||
pullToRefreshLayout = new PullToRefreshLayout(context, pullToRefreshLayoutChannel, pullToRefreshSettings);
|
||||
pullToRefreshLayout.addView(webView);
|
||||
pullToRefreshLayout.prepare();
|
||||
}
|
||||
|
|
|
@ -21,9 +21,9 @@ public class PullToRefreshLayout extends SwipeRefreshLayout implements MethodCha
|
|||
static final String LOG_TAG = "PullToRefreshLayout";
|
||||
|
||||
public MethodChannel channel;
|
||||
public PullToRefreshOptions options;
|
||||
public PullToRefreshSettings options;
|
||||
|
||||
public PullToRefreshLayout(@NonNull Context context, @NonNull MethodChannel channel, @NonNull PullToRefreshOptions options) {
|
||||
public PullToRefreshLayout(@NonNull Context context, @NonNull MethodChannel channel, @NonNull PullToRefreshSettings options) {
|
||||
super(context);
|
||||
this.channel = channel;
|
||||
this.options = options;
|
||||
|
|
|
@ -7,8 +7,8 @@ import com.pichillilorenzo.flutter_inappwebview.IWebViewSettings;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class PullToRefreshOptions implements IWebViewSettings<PullToRefreshLayout> {
|
||||
public static final String LOG_TAG = "PullToRefreshOptions";
|
||||
public class PullToRefreshSettings implements IWebViewSettings<PullToRefreshLayout> {
|
||||
public static final String LOG_TAG = "PullToRefreshSettings";
|
||||
|
||||
public Boolean enabled = true;
|
||||
@Nullable
|
||||
|
@ -22,7 +22,7 @@ public class PullToRefreshOptions implements IWebViewSettings<PullToRefreshLayou
|
|||
@Nullable
|
||||
public Integer size;
|
||||
|
||||
public PullToRefreshOptions parse(Map<String, Object> options) {
|
||||
public PullToRefreshSettings parse(Map<String, Object> options) {
|
||||
for (Map.Entry<String, Object> pair : options.entrySet()) {
|
||||
String key = pair.getKey();
|
||||
Object value = pair.getValue();
|
||||
|
@ -56,20 +56,20 @@ public class PullToRefreshOptions implements IWebViewSettings<PullToRefreshLayou
|
|||
}
|
||||
|
||||
public Map<String, Object> toMap() {
|
||||
Map<String, Object> options = new HashMap<>();
|
||||
options.put("enabled", enabled);
|
||||
options.put("color", color);
|
||||
options.put("backgroundColor", backgroundColor);
|
||||
options.put("distanceToTriggerSync", distanceToTriggerSync);
|
||||
options.put("slingshotDistance", slingshotDistance);
|
||||
options.put("size", size);
|
||||
return options;
|
||||
Map<String, Object> settings = new HashMap<>();
|
||||
settings.put("enabled", enabled);
|
||||
settings.put("color", color);
|
||||
settings.put("backgroundColor", backgroundColor);
|
||||
settings.put("distanceToTriggerSync", distanceToTriggerSync);
|
||||
settings.put("slingshotDistance", slingshotDistance);
|
||||
settings.put("size", size);
|
||||
return settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getRealSettings(PullToRefreshLayout pullToRefreshLayout) {
|
||||
Map<String, Object> realOptions = toMap();
|
||||
return realOptions;
|
||||
Map<String, Object> realSettings = toMap();
|
||||
return realSettings;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
#
|
||||
# NOTE: This podspec is NOT to be published. It is only used as a local source!
|
||||
# This is a generated file; do not edit or check into version control.
|
||||
#
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'Flutter'
|
||||
s.version = '1.0.0'
|
||||
s.summary = 'High-performance, high-fidelity mobile apps.'
|
||||
s.homepage = 'https://flutter.io'
|
||||
s.license = { :type => 'MIT' }
|
||||
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
|
||||
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
|
||||
s.ios.deployment_target = '9.0'
|
||||
# Framework linking is handled by Flutter tooling, not CocoaPods.
|
||||
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
|
||||
s.vendored_frameworks = 'path/to/nothing'
|
||||
end
|
|
@ -3,11 +3,12 @@
|
|||
export "FLUTTER_ROOT=/Users/lorenzopichilli/fvm/versions/2.10.4"
|
||||
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
|
||||
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
||||
export "FLUTTER_TARGET=lib/main.dart"
|
||||
export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart"
|
||||
export "FLUTTER_BUILD_DIR=build"
|
||||
export "FLUTTER_BUILD_NAME=1.0.0"
|
||||
export "FLUTTER_BUILD_NUMBER=1"
|
||||
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
|
||||
export "DART_OBFUSCATION=false"
|
||||
export "TRACK_WIDGET_CREATION=false"
|
||||
export "TRACK_WIDGET_CREATION=true"
|
||||
export "TREE_SHAKE_ICONS=false"
|
||||
export "PACKAGE_CONFIG=.packages"
|
||||
export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json"
|
||||
|
|
|
@ -80,7 +80,7 @@ public class InAppBrowserManager: NSObject, FlutterPlugin {
|
|||
let contextMenu = arguments["contextMenu"] as! [String: Any]
|
||||
let windowId = arguments["windowId"] as? Int64
|
||||
let initialUserScripts = arguments["initialUserScripts"] as? [[String: Any]]
|
||||
let pullToRefreshInitialOptions = arguments["pullToRefreshOptions"] as! [String: Any?]
|
||||
let pullToRefreshInitialSettings = arguments["pullToRefreshSettings"] as! [String: Any?]
|
||||
|
||||
let webViewController = prepareInAppBrowserWebViewController(settings: settings)
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class InAppBrowserManager: NSObject, FlutterPlugin {
|
|||
webViewController.contextMenu = contextMenu
|
||||
webViewController.windowId = windowId
|
||||
webViewController.initialUserScripts = initialUserScripts ?? []
|
||||
webViewController.pullToRefreshInitialOptions = pullToRefreshInitialOptions
|
||||
webViewController.pullToRefreshInitialSettings = pullToRefreshInitialSettings
|
||||
|
||||
presentViewController(webViewController: webViewController)
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega
|
|||
var initialBaseUrl: String?
|
||||
var previousStatusBarStyle = -1
|
||||
var initialUserScripts: [[String: Any]] = []
|
||||
var pullToRefreshInitialOptions: [String: Any?] = [:]
|
||||
var pullToRefreshInitialSettings: [String: Any?] = [:]
|
||||
var methodCallDelegate: InAppWebViewMethodHandler?
|
||||
|
||||
public override func loadView() {
|
||||
|
@ -47,7 +47,7 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega
|
|||
userScripts.append(UserScript.fromMap(map: intialUserScript, windowId: windowId)!)
|
||||
}
|
||||
|
||||
let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(options: webViewSettings)
|
||||
let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(settings: webViewSettings)
|
||||
if let wId = windowId, let webViewTransport = InAppWebView.windowWebViews[wId] {
|
||||
webView = webViewTransport.webView
|
||||
webView.contextMenu = contextMenu
|
||||
|
@ -67,9 +67,9 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega
|
|||
|
||||
let pullToRefreshLayoutChannel = FlutterMethodChannel(name: "com.pichillilorenzo/flutter_inappwebview_pull_to_refresh_" + id,
|
||||
binaryMessenger: SwiftFlutterPlugin.instance!.registrar!.messenger())
|
||||
let pullToRefreshOptions = PullToRefreshSettings()
|
||||
let _ = pullToRefreshOptions.parse(options: pullToRefreshInitialOptions)
|
||||
let pullToRefreshControl = PullToRefreshControl(channel: pullToRefreshLayoutChannel, options: pullToRefreshOptions)
|
||||
let pullToRefreshSettings = PullToRefreshSettings()
|
||||
let _ = pullToRefreshSettings.parse(settings: pullToRefreshInitialSettings)
|
||||
let pullToRefreshControl = PullToRefreshControl(channel: pullToRefreshLayoutChannel, settings: pullToRefreshSettings)
|
||||
webView.pullToRefreshControl = pullToRefreshControl
|
||||
pullToRefreshControl.delegate = webView
|
||||
pullToRefreshControl.prepare()
|
||||
|
@ -429,8 +429,8 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega
|
|||
public func setSettings(newSettings: InAppBrowserSettings, newSettingsMap: [String: Any]) {
|
||||
|
||||
let newInAppWebViewOptions = InAppWebViewSettings()
|
||||
let _ = newInAppWebViewOptions.parse(options: newSettingsMap)
|
||||
self.webView.setOptions(newSettings: newInAppWebViewOptions, newOptionsMap: newSettingsMap)
|
||||
let _ = newInAppWebViewOptions.parse(settings: newSettingsMap)
|
||||
self.webView.setSettings(newSettings: newInAppWebViewOptions, newSettingsMap: newSettingsMap)
|
||||
|
||||
if newSettingsMap["hidden"] != nil, browserSettings?.hidden != newSettings.hidden {
|
||||
if newSettings.hidden {
|
||||
|
@ -474,7 +474,7 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega
|
|||
}
|
||||
|
||||
if newSettingsMap["hideToolbarBottom"] != nil, browserSettings?.hideToolbarBottom != newSettings.hideToolbarBottom {
|
||||
navigationController?.isToolbarHidden = !newOptions.hideToolbarBottom
|
||||
navigationController?.isToolbarHidden = !newSettings.hideToolbarBottom
|
||||
}
|
||||
|
||||
if newSettingsMap["toolbarBottomBackgroundColor"] != nil, browserSettings?.toolbarBottomBackgroundColor != newSettings.toolbarBottomBackgroundColor {
|
||||
|
|
|
@ -33,7 +33,7 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView {
|
|||
let contextMenu = params["contextMenu"] as? [String: Any]
|
||||
let windowId = params["windowId"] as? Int64
|
||||
let initialUserScripts = params["initialUserScripts"] as? [[String: Any]]
|
||||
let pullToRefreshInitialOptions = params["pullToRefreshOptions"] as! [String: Any?]
|
||||
let pullToRefreshInitialSettings = params["pullToRefreshSettings"] as! [String: Any?]
|
||||
|
||||
var userScripts: [UserScript] = []
|
||||
if let initialUserScripts = initialUserScripts {
|
||||
|
@ -44,7 +44,7 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView {
|
|||
|
||||
let settings = InAppWebViewSettings()
|
||||
let _ = settings.parse(settings: initialSettings)
|
||||
let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(options: settings)
|
||||
let preWebviewConfiguration = InAppWebView.preWKWebViewConfiguration(settings: settings)
|
||||
|
||||
if let wId = windowId, let webViewTransport = InAppWebView.windowWebViews[wId] {
|
||||
webView = webViewTransport.webView
|
||||
|
@ -65,9 +65,9 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView {
|
|||
|
||||
let pullToRefreshLayoutChannel = FlutterMethodChannel(name: "com.pichillilorenzo/flutter_inappwebview_pull_to_refresh_" + String(describing: viewId),
|
||||
binaryMessenger: registrar.messenger())
|
||||
let pullToRefreshOptions = PullToRefreshSettings()
|
||||
let _ = pullToRefreshOptions.parse(settings: pullToRefreshInitialOptions)
|
||||
let pullToRefreshControl = PullToRefreshControl(channel: pullToRefreshLayoutChannel, options: pullToRefreshOptions)
|
||||
let pullToRefreshSettings = PullToRefreshSettings()
|
||||
let _ = pullToRefreshSettings.parse(settings: pullToRefreshInitialSettings)
|
||||
let pullToRefreshControl = PullToRefreshControl(channel: pullToRefreshLayoutChannel, settings: pullToRefreshSettings)
|
||||
webView!.pullToRefreshControl = pullToRefreshControl
|
||||
pullToRefreshControl.delegate = webView!
|
||||
pullToRefreshControl.prepare()
|
||||
|
|
|
@ -11,14 +11,14 @@ import Flutter
|
|||
public class PullToRefreshControl : UIRefreshControl, FlutterPlugin {
|
||||
|
||||
var channel: FlutterMethodChannel?
|
||||
var options: PullToRefreshSettings?
|
||||
var settings: PullToRefreshSettings?
|
||||
var shouldCallOnRefresh = false
|
||||
var delegate: PullToRefreshDelegate?
|
||||
|
||||
public init(channel: FlutterMethodChannel?, options: PullToRefreshSettings?) {
|
||||
public init(channel: FlutterMethodChannel?, settings: PullToRefreshSettings?) {
|
||||
super.init()
|
||||
self.channel = channel
|
||||
self.options = options
|
||||
self.settings = settings
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
|
@ -31,7 +31,7 @@ public class PullToRefreshControl : UIRefreshControl, FlutterPlugin {
|
|||
|
||||
public func prepare() {
|
||||
self.channel?.setMethodCallHandler(self.handle)
|
||||
if let options = options {
|
||||
if let options = settings {
|
||||
if options.enabled {
|
||||
delegate?.enablePullToRefresh()
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// PullToRefreshOptions.swift
|
||||
// pullToRefreshSettings.swift
|
||||
// flutter_inappwebview
|
||||
//
|
||||
// Created by Lorenzo Pichilli on 03/03/21.
|
||||
|
|
|
@ -28,10 +28,8 @@ class ServiceWorkerController {
|
|||
}
|
||||
|
||||
static Future<dynamic> _handleMethod(MethodCall call) async {
|
||||
ServiceWorkerController controller =
|
||||
ServiceWorkerController.instance();
|
||||
ServiceWorkerClient? serviceWorkerClient =
|
||||
controller.serviceWorkerClient;
|
||||
ServiceWorkerController controller = ServiceWorkerController.instance();
|
||||
ServiceWorkerClient? serviceWorkerClient = controller.serviceWorkerClient;
|
||||
|
||||
switch (call.method) {
|
||||
case "shouldInterceptRequest":
|
||||
|
|
|
@ -98,8 +98,7 @@ class WebViewFeature {
|
|||
const WebViewFeature._internal("GET_WEB_VIEW_RENDERER");
|
||||
|
||||
///
|
||||
static const MULTI_PROCESS =
|
||||
const WebViewFeature._internal("MULTI_PROCESS");
|
||||
static const MULTI_PROCESS = const WebViewFeature._internal("MULTI_PROCESS");
|
||||
|
||||
///
|
||||
static const OFF_SCREEN_PRERASTER =
|
||||
|
@ -139,8 +138,7 @@ class WebViewFeature {
|
|||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY =
|
||||
const WebViewFeature._internal(
|
||||
"SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
|
||||
const WebViewFeature._internal("SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY");
|
||||
|
||||
///
|
||||
static const SAFE_BROWSING_RESPONSE_PROCEED =
|
||||
|
@ -162,8 +160,7 @@ class WebViewFeature {
|
|||
|
||||
///
|
||||
static const SERVICE_WORKER_BLOCK_NETWORK_LOADS =
|
||||
const WebViewFeature._internal(
|
||||
"SERVICE_WORKER_BLOCK_NETWORK_LOADS");
|
||||
const WebViewFeature._internal("SERVICE_WORKER_BLOCK_NETWORK_LOADS");
|
||||
|
||||
///
|
||||
static const SERVICE_WORKER_CACHE_MODE =
|
||||
|
@ -179,8 +176,7 @@ class WebViewFeature {
|
|||
|
||||
///
|
||||
static const SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST =
|
||||
const WebViewFeature._internal(
|
||||
"SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
|
||||
const WebViewFeature._internal("SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST");
|
||||
|
||||
///
|
||||
static const SHOULD_OVERRIDE_WITH_REDIRECTS =
|
||||
|
@ -216,8 +212,7 @@ class WebViewFeature {
|
|||
|
||||
///
|
||||
static const WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK =
|
||||
const WebViewFeature._internal(
|
||||
"WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
|
||||
const WebViewFeature._internal("WEB_MESSAGE_PORT_SET_MESSAGE_CALLBACK");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_ERROR_GET_CODE =
|
||||
|
@ -225,8 +220,7 @@ class WebViewFeature {
|
|||
|
||||
///
|
||||
static const WEB_RESOURCE_ERROR_GET_DESCRIPTION =
|
||||
const WebViewFeature._internal(
|
||||
"WEB_RESOURCE_ERROR_GET_DESCRIPTION");
|
||||
const WebViewFeature._internal("WEB_RESOURCE_ERROR_GET_DESCRIPTION");
|
||||
|
||||
///
|
||||
static const WEB_RESOURCE_REQUEST_IS_REDIRECT =
|
||||
|
@ -234,8 +228,7 @@ class WebViewFeature {
|
|||
|
||||
///
|
||||
static const WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE =
|
||||
const WebViewFeature._internal(
|
||||
"WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
|
||||
const WebViewFeature._internal("WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE");
|
||||
|
||||
///
|
||||
static const WEB_VIEW_RENDERER_TERMINATE =
|
||||
|
@ -258,7 +251,6 @@ class WebViewFeature {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device.
|
||||
///Use [WebViewFeature] instead.
|
||||
@Deprecated("Use WebViewFeature instead")
|
||||
|
|
|
@ -88,8 +88,9 @@ class ChromeSafariBrowser {
|
|||
///[settings]: Settings for the [ChromeSafariBrowser].
|
||||
Future<void> open(
|
||||
{required Uri url,
|
||||
@Deprecated('Use settings instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
@Deprecated('Use settings instead') ChromeSafariBrowserClassOptions? options,
|
||||
ChromeSafariBrowserClassOptions? options,
|
||||
ChromeSafariBrowserSettings? settings}) async {
|
||||
assert(url.toString().isNotEmpty);
|
||||
this.throwIsAlreadyOpened(message: 'Cannot open $url!');
|
||||
|
@ -99,7 +100,8 @@ class ChromeSafariBrowser {
|
|||
menuItemList.add({"id": value.id, "label": value.label});
|
||||
});
|
||||
|
||||
var initialSettings = settings?.toMap() ?? options?.toMap() ??
|
||||
var initialSettings = settings?.toMap() ??
|
||||
options?.toMap() ??
|
||||
ChromeSafariBrowserSettings().toMap();
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
|
|
|
@ -32,7 +32,6 @@ class ChromeSafariBrowserOptions {
|
|||
|
||||
///Class that represents the settings that can be used for an [ChromeSafariBrowser] window.
|
||||
class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
||||
|
||||
///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.
|
||||
|
@ -226,8 +225,7 @@ class ChromeSafariBrowserSettings implements ChromeSafariBrowserOptions {
|
|||
}
|
||||
|
||||
static ChromeSafariBrowserSettings fromMap(Map<String, dynamic> map) {
|
||||
ChromeSafariBrowserSettings options =
|
||||
new ChromeSafariBrowserSettings();
|
||||
ChromeSafariBrowserSettings options = new ChromeSafariBrowserSettings();
|
||||
options.shareState = map["shareState"];
|
||||
options.showTitle = map["showTitle"];
|
||||
options.toolbarBackgroundColor =
|
||||
|
|
|
@ -113,9 +113,16 @@ class InAppBrowser {
|
|||
this.throwIfAlreadyOpened(message: 'Cannot open $urlRequest!');
|
||||
assert(urlRequest.url != null && urlRequest.url.toString().isNotEmpty);
|
||||
|
||||
var initialSettings = settings?.toMap() ?? options?.toMap() ??
|
||||
var initialSettings = settings?.toMap() ??
|
||||
options?.toMap() ??
|
||||
InAppBrowserClassSettings().toMap();
|
||||
|
||||
Map<String, dynamic> pullToRefreshSettings =
|
||||
pullToRefreshController?.settings.toMap() ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshSettings(enabled: false).toMap();
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('id', () => id);
|
||||
args.putIfAbsent('urlRequest', () => urlRequest.toMap());
|
||||
|
@ -125,11 +132,7 @@ class InAppBrowser {
|
|||
args.putIfAbsent('implementation', () => implementation.toValue());
|
||||
args.putIfAbsent('initialUserScripts',
|
||||
() => initialUserScripts?.map((e) => e.toMap()).toList() ?? []);
|
||||
args.putIfAbsent(
|
||||
'pullToRefreshOptions',
|
||||
() =>
|
||||
pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshOptions(enabled: false).toMap());
|
||||
args.putIfAbsent('pullToRefreshSettings', () => pullToRefreshSettings);
|
||||
await _sharedChannel.invokeMethod('open', args);
|
||||
}
|
||||
|
||||
|
@ -178,9 +181,16 @@ class InAppBrowser {
|
|||
this.throwIfAlreadyOpened(message: 'Cannot open $assetFilePath!');
|
||||
assert(assetFilePath.isNotEmpty);
|
||||
|
||||
var initialSettings = settings?.toMap() ?? options?.toMap() ??
|
||||
var initialSettings = settings?.toMap() ??
|
||||
options?.toMap() ??
|
||||
InAppBrowserClassSettings().toMap();
|
||||
|
||||
Map<String, dynamic> pullToRefreshSettings =
|
||||
pullToRefreshController?.settings.toMap() ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshSettings(enabled: false).toMap();
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('id', () => id);
|
||||
args.putIfAbsent('assetFilePath', () => assetFilePath);
|
||||
|
@ -190,11 +200,7 @@ class InAppBrowser {
|
|||
args.putIfAbsent('implementation', () => implementation.toValue());
|
||||
args.putIfAbsent('initialUserScripts',
|
||||
() => initialUserScripts?.map((e) => e.toMap()).toList() ?? []);
|
||||
args.putIfAbsent(
|
||||
'pullToRefreshOptions',
|
||||
() =>
|
||||
pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshOptions(enabled: false).toMap());
|
||||
args.putIfAbsent('pullToRefreshSettings', () => pullToRefreshSettings);
|
||||
await _sharedChannel.invokeMethod('open', args);
|
||||
}
|
||||
|
||||
|
@ -221,9 +227,16 @@ class InAppBrowser {
|
|||
InAppBrowserClassSettings? settings}) async {
|
||||
this.throwIfAlreadyOpened(message: 'Cannot open data!');
|
||||
|
||||
var initialSettings = settings?.toMap() ?? options?.toMap() ??
|
||||
var initialSettings = settings?.toMap() ??
|
||||
options?.toMap() ??
|
||||
InAppBrowserClassSettings().toMap();
|
||||
|
||||
Map<String, dynamic> pullToRefreshSettings =
|
||||
pullToRefreshController?.settings.toMap() ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshSettings(enabled: false).toMap();
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('id', () => id);
|
||||
args.putIfAbsent('settings', () => initialSettings);
|
||||
|
@ -231,18 +244,14 @@ class InAppBrowser {
|
|||
args.putIfAbsent('mimeType', () => mimeType);
|
||||
args.putIfAbsent('encoding', () => encoding);
|
||||
args.putIfAbsent('baseUrl', () => baseUrl?.toString() ?? "about:blank");
|
||||
args.putIfAbsent(
|
||||
'historyUrl', () => (historyUrl ?? androidHistoryUrl)?.toString() ?? "about:blank");
|
||||
args.putIfAbsent('historyUrl',
|
||||
() => (historyUrl ?? androidHistoryUrl)?.toString() ?? "about:blank");
|
||||
args.putIfAbsent('contextMenu', () => contextMenu?.toMap() ?? {});
|
||||
args.putIfAbsent('windowId', () => windowId);
|
||||
args.putIfAbsent('implementation', () => implementation.toValue());
|
||||
args.putIfAbsent('initialUserScripts',
|
||||
() => initialUserScripts?.map((e) => e.toMap()).toList() ?? []);
|
||||
args.putIfAbsent(
|
||||
'pullToRefreshOptions',
|
||||
() =>
|
||||
pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshOptions(enabled: false).toMap());
|
||||
args.putIfAbsent('pullToRefreshSettings', () => pullToRefreshSettings);
|
||||
await _sharedChannel.invokeMethod('open', args);
|
||||
}
|
||||
|
||||
|
@ -309,7 +318,8 @@ class InAppBrowser {
|
|||
}
|
||||
|
||||
///Sets the [InAppBrowser] settings with the new [settings] and evaluates them.
|
||||
Future<void> setSettings({required InAppBrowserClassSettings settings}) async {
|
||||
Future<void> setSettings(
|
||||
{required InAppBrowserClassSettings settings}) async {
|
||||
this.throwIfNotOpened();
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
|
@ -326,7 +336,8 @@ class InAppBrowser {
|
|||
await _channel.invokeMethod('getSettings', args);
|
||||
if (settings != null) {
|
||||
settings = settings.cast<String, dynamic>();
|
||||
return InAppBrowserClassSettings.fromMap(settings as Map<String, dynamic>);
|
||||
return InAppBrowserClassSettings.fromMap(
|
||||
settings as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -863,8 +874,7 @@ class InAppBrowser {
|
|||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessUnresponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessUnresponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)))
|
||||
Future<WebViewRenderProcessAction?>? onRenderProcessUnresponsive(
|
||||
Uri? url) {}
|
||||
Future<WebViewRenderProcessAction?>? onRenderProcessUnresponsive(Uri? url) {}
|
||||
|
||||
///Use [onRenderProcessResponsive] instead.
|
||||
@Deprecated("Use onRenderProcessResponsive instead")
|
||||
|
@ -883,8 +893,7 @@ class InAppBrowser {
|
|||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- Android native WebView ([Official API - WebViewRenderProcessClient.onRenderProcessResponsive](https://developer.android.com/reference/android/webkit/WebViewRenderProcessClient#onRenderProcessResponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)))
|
||||
Future<WebViewRenderProcessAction?>? onRenderProcessResponsive(
|
||||
Uri? url) {}
|
||||
Future<WebViewRenderProcessAction?>? onRenderProcessResponsive(Uri? url) {}
|
||||
|
||||
///Use [onRenderProcessGone] instead.
|
||||
@Deprecated("Use onRenderProcessGone instead")
|
||||
|
@ -928,7 +937,6 @@ class InAppBrowser {
|
|||
///- Android native WebView ([Official API - WebChromeClient.onReceivedIcon](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedIcon(android.webkit.WebView,%20android.graphics.Bitmap)))
|
||||
void onReceivedIcon(Uint8List icon) {}
|
||||
|
||||
|
||||
///Use [onReceivedTouchIconUrl] instead.
|
||||
@Deprecated('Use onReceivedTouchIconUrl instead')
|
||||
void androidOnReceivedTouchIconUrl(Uri url, bool precomposed) {}
|
||||
|
@ -943,7 +951,6 @@ class InAppBrowser {
|
|||
///- Android native WebView ([Official API - WebChromeClient.onReceivedTouchIconUrl](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTouchIconUrl(android.webkit.WebView,%20java.lang.String,%20boolean)))
|
||||
void onReceivedTouchIconUrl(Uri url, bool precomposed) {}
|
||||
|
||||
|
||||
///Use [onJsBeforeUnload] instead.
|
||||
@Deprecated('Use onJsBeforeUnload instead')
|
||||
Future<JsBeforeUnloadResponse?>? androidOnJsBeforeUnload(
|
||||
|
|
|
@ -60,7 +60,8 @@ class InAppBrowserClassSettings {
|
|||
return options;
|
||||
}
|
||||
|
||||
static Map<String, dynamic> instanceToMap(InAppBrowserClassSettings settings) {
|
||||
static Map<String, dynamic> instanceToMap(
|
||||
InAppBrowserClassSettings settings) {
|
||||
return settings.toMap();
|
||||
}
|
||||
|
||||
|
@ -73,7 +74,8 @@ class InAppBrowserClassSettings {
|
|||
return toMap().toString();
|
||||
}
|
||||
|
||||
static InAppBrowserClassSettings fromMap(Map<String, dynamic> options, {InAppBrowserClassSettings? instance}) {
|
||||
static InAppBrowserClassSettings fromMap(Map<String, dynamic> options,
|
||||
{InAppBrowserClassSettings? instance}) {
|
||||
if (instance == null) {
|
||||
instance = InAppBrowserClassSettings();
|
||||
}
|
||||
|
@ -88,8 +90,8 @@ class InAppBrowserClassSettings {
|
|||
}
|
||||
|
||||
///This class represents all [InAppBrowser] settings available.
|
||||
class InAppBrowserSettings implements BrowserOptions, AndroidOptions, IosOptions {
|
||||
|
||||
class InAppBrowserSettings
|
||||
implements BrowserOptions, AndroidOptions, IosOptions {
|
||||
///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`.
|
||||
///
|
||||
|
@ -282,9 +284,11 @@ class InAppBrowserSettings implements BrowserOptions, AndroidOptions, IosOptions
|
|||
instance.toolbarTopFixedTitle = map["toolbarTopFixedTitle"];
|
||||
instance.closeOnCannotGoBack = map["closeOnCannotGoBack"];
|
||||
instance.allowGoBackWithBackButton = map["allowGoBackWithBackButton"];
|
||||
instance.shouldCloseOnBackButtonPressed = map["shouldCloseOnBackButtonPressed"];
|
||||
instance.shouldCloseOnBackButtonPressed =
|
||||
map["shouldCloseOnBackButtonPressed"];
|
||||
instance.toolbarTopTranslucent = map["toolbarTopTranslucent"];
|
||||
instance.toolbarTopTintColor = UtilColor.fromHex(map["toolbarTopTintColor"]);
|
||||
instance.toolbarTopTintColor =
|
||||
UtilColor.fromHex(map["toolbarTopTintColor"]);
|
||||
instance.hideToolbarBottom = map["hideToolbarBottom"];
|
||||
instance.toolbarBottomBackgroundColor =
|
||||
UtilColor.fromHex(map["toolbarBottomBackgroundColor"]);
|
||||
|
|
|
@ -76,7 +76,8 @@ class IOSInAppBrowserOptions implements BrowserOptions, IosOptions {
|
|||
static IOSInAppBrowserOptions fromMap(Map<String, dynamic> map) {
|
||||
var instance = IOSInAppBrowserOptions();
|
||||
instance.toolbarTopTranslucent = map["toolbarTopTranslucent"];
|
||||
instance.toolbarTopTintColor = UtilColor.fromHex(map["toolbarTopTintColor"]);
|
||||
instance.toolbarTopTintColor =
|
||||
UtilColor.fromHex(map["toolbarTopTintColor"]);
|
||||
instance.hideToolbarBottom = map["hideToolbarBottom"];
|
||||
instance.toolbarBottomBackgroundColor =
|
||||
UtilColor.fromHex(map["toolbarBottomBackgroundColor"]);
|
||||
|
|
|
@ -127,7 +127,8 @@ class AndroidInAppWebViewController with AndroidInAppWebViewControllerMixin {
|
|||
}
|
||||
|
||||
///Use [InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl] instead.
|
||||
@Deprecated("Use InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl instead")
|
||||
@Deprecated(
|
||||
"Use InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl instead")
|
||||
static Future<Uri?> getSafeBrowsingPrivacyPolicyUrl() async {
|
||||
return await InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl();
|
||||
}
|
||||
|
@ -142,15 +143,18 @@ class AndroidInAppWebViewController with AndroidInAppWebViewControllerMixin {
|
|||
///Use [InAppWebViewController.getCurrentWebViewPackage] instead.
|
||||
@Deprecated("Use InAppWebViewController.getCurrentWebViewPackage instead")
|
||||
static Future<AndroidWebViewPackageInfo?> getCurrentWebViewPackage() async {
|
||||
Map<String, dynamic>? packageInfo = (await InAppWebViewController.getCurrentWebViewPackage())?.toMap();
|
||||
Map<String, dynamic>? packageInfo =
|
||||
(await InAppWebViewController.getCurrentWebViewPackage())?.toMap();
|
||||
return AndroidWebViewPackageInfo.fromMap(packageInfo);
|
||||
}
|
||||
|
||||
///Use [InAppWebViewController.setWebContentsDebuggingEnabled] instead.
|
||||
@Deprecated("Use InAppWebViewController.setWebContentsDebuggingEnabled instead")
|
||||
@Deprecated(
|
||||
"Use InAppWebViewController.setWebContentsDebuggingEnabled instead")
|
||||
static Future<void> setWebContentsDebuggingEnabled(
|
||||
bool debuggingEnabled) async {
|
||||
return await InAppWebViewController.setWebContentsDebuggingEnabled(debuggingEnabled);
|
||||
return await InAppWebViewController.setWebContentsDebuggingEnabled(
|
||||
debuggingEnabled);
|
||||
}
|
||||
|
||||
///Use [InAppWebViewController.getOriginalUrl] instead.
|
||||
|
|
|
@ -11,7 +11,7 @@ import 'webview.dart';
|
|||
import 'in_app_webview_controller.dart';
|
||||
import 'in_app_webview_settings.dart';
|
||||
import '../pull_to_refresh/pull_to_refresh_controller.dart';
|
||||
import '../pull_to_refresh/pull_to_refresh_options.dart';
|
||||
import '../pull_to_refresh/pull_to_refresh_settings.dart';
|
||||
import '../util.dart';
|
||||
|
||||
///Class that represents a WebView in headless mode.
|
||||
|
@ -43,8 +43,8 @@ class HeadlessInAppWebView implements WebView {
|
|||
///**NOTE for Android**: `Size` width and height values will be converted to `int` values because they cannot have `double` values.
|
||||
final Size initialSize;
|
||||
|
||||
HeadlessInAppWebView(
|
||||
{this.initialSize = const Size(-1, -1),
|
||||
HeadlessInAppWebView({
|
||||
this.initialSize = const Size(-1, -1),
|
||||
this.windowId,
|
||||
this.initialUrlRequest,
|
||||
this.initialFile,
|
||||
|
@ -65,8 +65,7 @@ class HeadlessInAppWebView implements WebView {
|
|||
this.shouldOverrideUrlLoading,
|
||||
this.onLoadResource,
|
||||
this.onScrollChanged,
|
||||
@Deprecated('Use onDownloadStartRequest instead')
|
||||
this.onDownloadStart,
|
||||
@Deprecated('Use onDownloadStartRequest instead') this.onDownloadStart,
|
||||
this.onDownloadStartRequest,
|
||||
this.onLoadResourceCustomScheme,
|
||||
this.onCreateWindow,
|
||||
|
@ -94,39 +93,54 @@ class HeadlessInAppWebView implements WebView {
|
|||
this.onOverScrolled,
|
||||
@Deprecated('Use onSafeBrowsingHit instead') this.androidOnSafeBrowsingHit,
|
||||
this.onSafeBrowsingHit,
|
||||
@Deprecated('Use onPermissionRequest instead') this.androidOnPermissionRequest,
|
||||
@Deprecated('Use onPermissionRequest instead')
|
||||
this.androidOnPermissionRequest,
|
||||
this.onPermissionRequest,
|
||||
@Deprecated('Use onGeolocationPermissionsShowPrompt instead') this.androidOnGeolocationPermissionsShowPrompt,
|
||||
@Deprecated('Use onGeolocationPermissionsShowPrompt instead')
|
||||
this.androidOnGeolocationPermissionsShowPrompt,
|
||||
this.onGeolocationPermissionsShowPrompt,
|
||||
@Deprecated('Use onGeolocationPermissionsHidePrompt instead') this.androidOnGeolocationPermissionsHidePrompt,
|
||||
@Deprecated('Use onGeolocationPermissionsHidePrompt instead')
|
||||
this.androidOnGeolocationPermissionsHidePrompt,
|
||||
this.onGeolocationPermissionsHidePrompt,
|
||||
@Deprecated('Use shouldInterceptRequest instead') this.androidShouldInterceptRequest,
|
||||
@Deprecated('Use shouldInterceptRequest instead')
|
||||
this.androidShouldInterceptRequest,
|
||||
this.shouldInterceptRequest,
|
||||
@Deprecated('Use onRenderProcessGone instead') this.androidOnRenderProcessGone,
|
||||
@Deprecated('Use onRenderProcessGone instead')
|
||||
this.androidOnRenderProcessGone,
|
||||
this.onRenderProcessGone,
|
||||
@Deprecated('Use onRenderProcessResponsive instead') this.androidOnRenderProcessResponsive,
|
||||
@Deprecated('Use onRenderProcessResponsive instead')
|
||||
this.androidOnRenderProcessResponsive,
|
||||
this.onRenderProcessResponsive,
|
||||
@Deprecated('Use onRenderProcessUnresponsive instead') this.androidOnRenderProcessUnresponsive,
|
||||
@Deprecated('Use onRenderProcessUnresponsive instead')
|
||||
this.androidOnRenderProcessUnresponsive,
|
||||
this.onRenderProcessUnresponsive,
|
||||
@Deprecated('Use onFormResubmission instead') this.androidOnFormResubmission,
|
||||
@Deprecated('Use onFormResubmission instead')
|
||||
this.androidOnFormResubmission,
|
||||
this.onFormResubmission,
|
||||
@Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged,
|
||||
@Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon,
|
||||
this.onReceivedIcon,
|
||||
@Deprecated('Use onReceivedTouchIconUrl instead') this.androidOnReceivedTouchIconUrl,
|
||||
@Deprecated('Use onReceivedTouchIconUrl instead')
|
||||
this.androidOnReceivedTouchIconUrl,
|
||||
this.onReceivedTouchIconUrl,
|
||||
@Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload,
|
||||
this.onJsBeforeUnload,
|
||||
@Deprecated('Use onReceivedLoginRequest instead') this.androidOnReceivedLoginRequest,
|
||||
@Deprecated('Use onReceivedLoginRequest instead')
|
||||
this.androidOnReceivedLoginRequest,
|
||||
this.onReceivedLoginRequest,
|
||||
@Deprecated('Use onWebContentProcessDidTerminate instead') this.iosOnWebContentProcessDidTerminate,
|
||||
@Deprecated('Use onWebContentProcessDidTerminate instead')
|
||||
this.iosOnWebContentProcessDidTerminate,
|
||||
this.onWebContentProcessDidTerminate,
|
||||
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead') this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
|
||||
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead')
|
||||
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
|
||||
this.onDidReceiveServerRedirectForProvisionalNavigation,
|
||||
@Deprecated('Use onNavigationResponse instead') this.iosOnNavigationResponse,
|
||||
@Deprecated('Use onNavigationResponse instead')
|
||||
this.iosOnNavigationResponse,
|
||||
this.onNavigationResponse,
|
||||
@Deprecated('Use shouldAllowDeprecatedTLS instead') this.iosShouldAllowDeprecatedTLS,
|
||||
this.shouldAllowDeprecatedTLS,}) {
|
||||
@Deprecated('Use shouldAllowDeprecatedTLS instead')
|
||||
this.iosShouldAllowDeprecatedTLS,
|
||||
this.shouldAllowDeprecatedTLS,
|
||||
}) {
|
||||
id = IdGenerator.generate();
|
||||
webViewController = new InAppWebViewController(id, this);
|
||||
this._channel =
|
||||
|
@ -155,10 +169,16 @@ class HeadlessInAppWebView implements WebView {
|
|||
}
|
||||
_started = true;
|
||||
|
||||
Map<String, dynamic> initialSettings = (this.initialSettings != null ?
|
||||
this.initialSettings?.toMap() :
|
||||
Map<String, dynamic> initialSettings = this.initialSettings?.toMap() ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.initialOptions?.toMap()) ?? {};
|
||||
this.initialOptions?.toMap() ??
|
||||
{};
|
||||
|
||||
Map<String, dynamic> pullToRefreshSettings =
|
||||
this.pullToRefreshController?.settings.toMap() ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshSettings(enabled: false).toMap();
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('id', () => id);
|
||||
|
@ -174,9 +194,7 @@ class HeadlessInAppWebView implements WebView {
|
|||
'implementation': this.implementation.toValue(),
|
||||
'initialUserScripts':
|
||||
this.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
'pullToRefreshOptions':
|
||||
this.pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshOptions(enabled: false).toMap(),
|
||||
'pullToRefreshSettings': pullToRefreshSettings,
|
||||
'initialSize': this.initialSize.toMap()
|
||||
});
|
||||
await _sharedChannel.invokeMethod('run', args);
|
||||
|
@ -425,8 +443,7 @@ class HeadlessInAppWebView implements WebView {
|
|||
onScrollChanged;
|
||||
|
||||
@override
|
||||
void Function(
|
||||
InAppWebViewController controller, Uri? url, bool? isReload)?
|
||||
void Function(InAppWebViewController controller, Uri? url, bool? isReload)?
|
||||
onUpdateVisitedHistory;
|
||||
|
||||
@override
|
||||
|
@ -528,53 +545,74 @@ class HeadlessInAppWebView implements WebView {
|
|||
androidOnReceivedLoginRequest;
|
||||
|
||||
@override
|
||||
void Function(InAppWebViewController controller)? onDidReceiveServerRedirectForProvisionalNavigation;
|
||||
void Function(InAppWebViewController controller)?
|
||||
onDidReceiveServerRedirectForProvisionalNavigation;
|
||||
|
||||
@override
|
||||
Future<FormResubmissionAction?> Function(InAppWebViewController controller, Uri? url)? onFormResubmission;
|
||||
Future<FormResubmissionAction?> Function(
|
||||
InAppWebViewController controller, Uri? url)? onFormResubmission;
|
||||
|
||||
@override
|
||||
void Function(InAppWebViewController controller)? onGeolocationPermissionsHidePrompt;
|
||||
void Function(InAppWebViewController controller)?
|
||||
onGeolocationPermissionsHidePrompt;
|
||||
|
||||
@override
|
||||
Future<GeolocationPermissionShowPromptResponse?> Function(InAppWebViewController controller, String origin)? onGeolocationPermissionsShowPrompt;
|
||||
Future<GeolocationPermissionShowPromptResponse?> Function(
|
||||
InAppWebViewController controller, String origin)?
|
||||
onGeolocationPermissionsShowPrompt;
|
||||
|
||||
@override
|
||||
Future<JsBeforeUnloadResponse?> Function(InAppWebViewController controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
||||
Future<JsBeforeUnloadResponse?> Function(InAppWebViewController controller,
|
||||
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
||||
|
||||
@override
|
||||
Future<NavigationResponseAction?> Function(InAppWebViewController controller, NavigationResponse navigationResponse)? onNavigationResponse;
|
||||
Future<NavigationResponseAction?> Function(InAppWebViewController controller,
|
||||
NavigationResponse navigationResponse)? onNavigationResponse;
|
||||
|
||||
@override
|
||||
Future<PermissionRequestResponse?> Function(InAppWebViewController controller, String origin, List<String> resources)? onPermissionRequest;
|
||||
Future<PermissionRequestResponse?> Function(InAppWebViewController controller,
|
||||
String origin, List<String> resources)? onPermissionRequest;
|
||||
|
||||
@override
|
||||
void Function(InAppWebViewController controller, Uint8List icon)? onReceivedIcon;
|
||||
void Function(InAppWebViewController controller, Uint8List icon)?
|
||||
onReceivedIcon;
|
||||
|
||||
@override
|
||||
void Function(InAppWebViewController controller, LoginRequest loginRequest)? onReceivedLoginRequest;
|
||||
void Function(InAppWebViewController controller, LoginRequest loginRequest)?
|
||||
onReceivedLoginRequest;
|
||||
|
||||
@override
|
||||
void Function(InAppWebViewController controller, Uri url, bool precomposed)? onReceivedTouchIconUrl;
|
||||
void Function(InAppWebViewController controller, Uri url, bool precomposed)?
|
||||
onReceivedTouchIconUrl;
|
||||
|
||||
@override
|
||||
void Function(InAppWebViewController controller, RenderProcessGoneDetail detail)? onRenderProcessGone;
|
||||
void Function(
|
||||
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
||||
onRenderProcessGone;
|
||||
|
||||
@override
|
||||
Future<WebViewRenderProcessAction?> Function(InAppWebViewController controller, Uri? url)? onRenderProcessResponsive;
|
||||
Future<WebViewRenderProcessAction?> Function(
|
||||
InAppWebViewController controller, Uri? url)? onRenderProcessResponsive;
|
||||
|
||||
@override
|
||||
Future<WebViewRenderProcessAction?> Function(InAppWebViewController controller, Uri? url)? onRenderProcessUnresponsive;
|
||||
Future<WebViewRenderProcessAction?> Function(
|
||||
InAppWebViewController controller, Uri? url)? onRenderProcessUnresponsive;
|
||||
|
||||
@override
|
||||
Future<SafeBrowsingResponse?> Function(InAppWebViewController controller, Uri url, SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
|
||||
Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
|
||||
Uri url, SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
|
||||
|
||||
@override
|
||||
void Function(InAppWebViewController controller)? onWebContentProcessDidTerminate;
|
||||
void Function(InAppWebViewController controller)?
|
||||
onWebContentProcessDidTerminate;
|
||||
|
||||
@override
|
||||
Future<ShouldAllowDeprecatedTLSAction?> Function(InAppWebViewController controller, URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
||||
Future<ShouldAllowDeprecatedTLSAction?> Function(
|
||||
InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
||||
|
||||
@override
|
||||
Future<WebResourceResponse?> Function(InAppWebViewController controller, WebResourceRequest request)? shouldInterceptRequest;
|
||||
Future<WebResourceResponse?> Function(
|
||||
InAppWebViewController controller, WebResourceRequest request)?
|
||||
shouldInterceptRequest;
|
||||
}
|
||||
|
|
|
@ -82,38 +82,52 @@ class InAppWebView extends StatefulWidget implements WebView {
|
|||
this.onZoomScaleChanged,
|
||||
@Deprecated('Use onSafeBrowsingHit instead') this.androidOnSafeBrowsingHit,
|
||||
this.onSafeBrowsingHit,
|
||||
@Deprecated('Use onPermissionRequest instead') this.androidOnPermissionRequest,
|
||||
@Deprecated('Use onPermissionRequest instead')
|
||||
this.androidOnPermissionRequest,
|
||||
this.onPermissionRequest,
|
||||
@Deprecated('Use onGeolocationPermissionsShowPrompt instead') this.androidOnGeolocationPermissionsShowPrompt,
|
||||
@Deprecated('Use onGeolocationPermissionsShowPrompt instead')
|
||||
this.androidOnGeolocationPermissionsShowPrompt,
|
||||
this.onGeolocationPermissionsShowPrompt,
|
||||
@Deprecated('Use onGeolocationPermissionsHidePrompt instead') this.androidOnGeolocationPermissionsHidePrompt,
|
||||
@Deprecated('Use onGeolocationPermissionsHidePrompt instead')
|
||||
this.androidOnGeolocationPermissionsHidePrompt,
|
||||
this.onGeolocationPermissionsHidePrompt,
|
||||
@Deprecated('Use shouldInterceptRequest instead') this.androidShouldInterceptRequest,
|
||||
@Deprecated('Use shouldInterceptRequest instead')
|
||||
this.androidShouldInterceptRequest,
|
||||
this.shouldInterceptRequest,
|
||||
@Deprecated('Use onRenderProcessGone instead') this.androidOnRenderProcessGone,
|
||||
@Deprecated('Use onRenderProcessGone instead')
|
||||
this.androidOnRenderProcessGone,
|
||||
this.onRenderProcessGone,
|
||||
@Deprecated('Use onRenderProcessResponsive instead') this.androidOnRenderProcessResponsive,
|
||||
@Deprecated('Use onRenderProcessResponsive instead')
|
||||
this.androidOnRenderProcessResponsive,
|
||||
this.onRenderProcessResponsive,
|
||||
@Deprecated('Use onRenderProcessUnresponsive instead') this.androidOnRenderProcessUnresponsive,
|
||||
@Deprecated('Use onRenderProcessUnresponsive instead')
|
||||
this.androidOnRenderProcessUnresponsive,
|
||||
this.onRenderProcessUnresponsive,
|
||||
@Deprecated('Use onFormResubmission instead') this.androidOnFormResubmission,
|
||||
@Deprecated('Use onFormResubmission instead')
|
||||
this.androidOnFormResubmission,
|
||||
this.onFormResubmission,
|
||||
@Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged,
|
||||
@Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon,
|
||||
this.onReceivedIcon,
|
||||
@Deprecated('Use onReceivedTouchIconUrl instead') this.androidOnReceivedTouchIconUrl,
|
||||
@Deprecated('Use onReceivedTouchIconUrl instead')
|
||||
this.androidOnReceivedTouchIconUrl,
|
||||
this.onReceivedTouchIconUrl,
|
||||
@Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload,
|
||||
this.onJsBeforeUnload,
|
||||
@Deprecated('Use onReceivedLoginRequest instead') this.androidOnReceivedLoginRequest,
|
||||
@Deprecated('Use onReceivedLoginRequest instead')
|
||||
this.androidOnReceivedLoginRequest,
|
||||
this.onReceivedLoginRequest,
|
||||
@Deprecated('Use onWebContentProcessDidTerminate instead') this.iosOnWebContentProcessDidTerminate,
|
||||
@Deprecated('Use onWebContentProcessDidTerminate instead')
|
||||
this.iosOnWebContentProcessDidTerminate,
|
||||
this.onWebContentProcessDidTerminate,
|
||||
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead') this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
|
||||
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead')
|
||||
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
|
||||
this.onDidReceiveServerRedirectForProvisionalNavigation,
|
||||
@Deprecated('Use onNavigationResponse instead') this.iosOnNavigationResponse,
|
||||
@Deprecated('Use onNavigationResponse instead')
|
||||
this.iosOnNavigationResponse,
|
||||
this.onNavigationResponse,
|
||||
@Deprecated('Use shouldAllowDeprecatedTLS instead') this.iosShouldAllowDeprecatedTLS,
|
||||
@Deprecated('Use shouldAllowDeprecatedTLS instead')
|
||||
this.iosShouldAllowDeprecatedTLS,
|
||||
this.shouldAllowDeprecatedTLS,
|
||||
this.gestureRecognizers,
|
||||
}) : super(key: key);
|
||||
|
@ -428,55 +442,84 @@ class InAppWebView extends StatefulWidget implements WebView {
|
|||
androidOnReceivedLoginRequest;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller)? onDidReceiveServerRedirectForProvisionalNavigation;
|
||||
final void Function(InAppWebViewController controller)?
|
||||
onDidReceiveServerRedirectForProvisionalNavigation;
|
||||
|
||||
@override
|
||||
final Future<FormResubmissionAction?> Function(InAppWebViewController controller, Uri? url)? onFormResubmission;
|
||||
final Future<FormResubmissionAction?> Function(
|
||||
InAppWebViewController controller, Uri? url)? onFormResubmission;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller)? onGeolocationPermissionsHidePrompt;
|
||||
final void Function(InAppWebViewController controller)?
|
||||
onGeolocationPermissionsHidePrompt;
|
||||
|
||||
@override
|
||||
final Future<GeolocationPermissionShowPromptResponse?> Function(InAppWebViewController controller, String origin)? onGeolocationPermissionsShowPrompt;
|
||||
final Future<GeolocationPermissionShowPromptResponse?> Function(
|
||||
InAppWebViewController controller, String origin)?
|
||||
onGeolocationPermissionsShowPrompt;
|
||||
|
||||
@override
|
||||
final Future<JsBeforeUnloadResponse?> Function(InAppWebViewController controller, JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
||||
final Future<JsBeforeUnloadResponse?> Function(
|
||||
InAppWebViewController controller,
|
||||
JsBeforeUnloadRequest jsBeforeUnloadRequest)? onJsBeforeUnload;
|
||||
|
||||
@override
|
||||
final Future<NavigationResponseAction?> Function(InAppWebViewController controller, NavigationResponse navigationResponse)? onNavigationResponse;
|
||||
final Future<NavigationResponseAction?> Function(
|
||||
InAppWebViewController controller,
|
||||
NavigationResponse navigationResponse)? onNavigationResponse;
|
||||
|
||||
@override
|
||||
final Future<PermissionRequestResponse?> Function(InAppWebViewController controller, String origin, List<String> resources)? onPermissionRequest;
|
||||
final Future<PermissionRequestResponse?> Function(
|
||||
InAppWebViewController controller,
|
||||
String origin,
|
||||
List<String> resources)? onPermissionRequest;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, Uint8List icon)? onReceivedIcon;
|
||||
final void Function(InAppWebViewController controller, Uint8List icon)?
|
||||
onReceivedIcon;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, LoginRequest loginRequest)? onReceivedLoginRequest;
|
||||
final void Function(
|
||||
InAppWebViewController controller, LoginRequest loginRequest)?
|
||||
onReceivedLoginRequest;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, Uri url, bool precomposed)? onReceivedTouchIconUrl;
|
||||
final void Function(
|
||||
InAppWebViewController controller, Uri url, bool precomposed)?
|
||||
onReceivedTouchIconUrl;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller, RenderProcessGoneDetail detail)? onRenderProcessGone;
|
||||
final void Function(
|
||||
InAppWebViewController controller, RenderProcessGoneDetail detail)?
|
||||
onRenderProcessGone;
|
||||
|
||||
@override
|
||||
final Future<WebViewRenderProcessAction?> Function(InAppWebViewController controller, Uri? url)? onRenderProcessResponsive;
|
||||
final Future<WebViewRenderProcessAction?> Function(
|
||||
InAppWebViewController controller, Uri? url)? onRenderProcessResponsive;
|
||||
|
||||
@override
|
||||
final Future<WebViewRenderProcessAction?> Function(InAppWebViewController controller, Uri? url)? onRenderProcessUnresponsive;
|
||||
final Future<WebViewRenderProcessAction?> Function(
|
||||
InAppWebViewController controller, Uri? url)? onRenderProcessUnresponsive;
|
||||
|
||||
@override
|
||||
final Future<SafeBrowsingResponse?> Function(InAppWebViewController controller, Uri url, SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
|
||||
final Future<SafeBrowsingResponse?> Function(
|
||||
InAppWebViewController controller,
|
||||
Uri url,
|
||||
SafeBrowsingThreat? threatType)? onSafeBrowsingHit;
|
||||
|
||||
@override
|
||||
final void Function(InAppWebViewController controller)? onWebContentProcessDidTerminate;
|
||||
final void Function(InAppWebViewController controller)?
|
||||
onWebContentProcessDidTerminate;
|
||||
|
||||
@override
|
||||
final Future<ShouldAllowDeprecatedTLSAction?> Function(InAppWebViewController controller, URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
||||
final Future<ShouldAllowDeprecatedTLSAction?> Function(
|
||||
InAppWebViewController controller,
|
||||
URLAuthenticationChallenge challenge)? shouldAllowDeprecatedTLS;
|
||||
|
||||
@override
|
||||
final Future<WebResourceResponse?> Function(InAppWebViewController controller, WebResourceRequest request)? shouldInterceptRequest;
|
||||
final Future<WebResourceResponse?> Function(
|
||||
InAppWebViewController controller, WebResourceRequest request)?
|
||||
shouldInterceptRequest;
|
||||
}
|
||||
|
||||
class _InAppWebViewState extends State<InAppWebView> {
|
||||
|
@ -484,16 +527,24 @@ class _InAppWebViewState extends State<InAppWebView> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Map<String, dynamic> initialSettings = (widget.initialSettings != null ?
|
||||
widget.initialSettings?.toMap() :
|
||||
Map<String, dynamic> initialSettings = widget.initialSettings?.toMap() ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
widget.initialOptions?.toMap()) ?? {};
|
||||
widget.initialOptions?.toMap() ??
|
||||
{};
|
||||
|
||||
Map<String, dynamic> pullToRefreshSettings =
|
||||
widget.pullToRefreshController?.settings.toMap() ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
widget.pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshSettings(enabled: false).toMap();
|
||||
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
var useHybridComposition = (widget.initialSettings != null ?
|
||||
widget.initialSettings?.useHybridComposition :
|
||||
var useHybridComposition = (widget.initialSettings != null
|
||||
? widget.initialSettings?.useHybridComposition
|
||||
:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
widget.initialOptions?.android.useHybridComposition) ?? false;
|
||||
widget.initialOptions?.android.useHybridComposition) ??
|
||||
false;
|
||||
|
||||
if (!useHybridComposition && widget.pullToRefreshController != null) {
|
||||
throw new Exception(
|
||||
|
@ -530,9 +581,7 @@ class _InAppWebViewState extends State<InAppWebView> {
|
|||
'initialUserScripts':
|
||||
widget.initialUserScripts?.map((e) => e.toMap()).toList() ??
|
||||
[],
|
||||
'pullToRefreshOptions':
|
||||
widget.pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshOptions(enabled: false).toMap()
|
||||
'pullToRefreshSettings': pullToRefreshSettings
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
)
|
||||
|
@ -558,9 +607,7 @@ class _InAppWebViewState extends State<InAppWebView> {
|
|||
'implementation': widget.implementation.toValue(),
|
||||
'initialUserScripts':
|
||||
widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
'pullToRefreshOptions':
|
||||
widget.pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshOptions(enabled: false).toMap()
|
||||
'pullToRefreshSettings': pullToRefreshSettings
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
);
|
||||
|
@ -580,9 +627,7 @@ class _InAppWebViewState extends State<InAppWebView> {
|
|||
'implementation': widget.implementation.toValue(),
|
||||
'initialUserScripts':
|
||||
widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
|
||||
'pullToRefreshOptions':
|
||||
widget.pullToRefreshController?.options.toMap() ??
|
||||
PullToRefreshOptions(enabled: false).toMap()
|
||||
'pullToRefreshSettings': pullToRefreshSettings
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
);
|
||||
|
|
|
@ -46,7 +46,8 @@ final _JAVASCRIPT_HANDLER_FORBIDDEN_NAMES = UnmodifiableListView<String>([
|
|||
///
|
||||
///If you are using the [InAppWebView] widget, an [InAppWebViewController] instance can be obtained by setting the [InAppWebView.onWebViewCreated]
|
||||
///callback. Instead, if you are using an [InAppBrowser] instance, you can get it through the [InAppBrowser.webViewController] attribute.
|
||||
class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWebViewControllerMixin {
|
||||
class InAppWebViewController
|
||||
with AndroidInAppWebViewControllerMixin, IOSInAppWebViewControllerMixin {
|
||||
WebView? _webview;
|
||||
late MethodChannel _channel;
|
||||
static MethodChannel _staticChannel = IN_APP_WEBVIEW_STATIC_CHANNEL;
|
||||
|
@ -276,21 +277,29 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
if ((_webview != null &&
|
||||
(_webview!.onGeolocationPermissionsShowPrompt != null ||
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_webview!.androidOnGeolocationPermissionsShowPrompt != null)) ||
|
||||
_webview!.androidOnGeolocationPermissionsShowPrompt !=
|
||||
null)) ||
|
||||
_inAppBrowser != null) {
|
||||
String origin = call.arguments["origin"];
|
||||
|
||||
if (_webview != null) {
|
||||
if (_webview!.onGeolocationPermissionsShowPrompt != null)
|
||||
return (await _webview!.onGeolocationPermissionsShowPrompt!(this, origin))?.toMap();
|
||||
return (await _webview!.onGeolocationPermissionsShowPrompt!(
|
||||
this, origin))
|
||||
?.toMap();
|
||||
else {
|
||||
return (await _webview!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.androidOnGeolocationPermissionsShowPrompt!(this, origin))?.toMap();
|
||||
.androidOnGeolocationPermissionsShowPrompt!(this, origin))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return ((await _inAppBrowser!.onGeolocationPermissionsShowPrompt(origin)) ??
|
||||
return ((await _inAppBrowser!
|
||||
.onGeolocationPermissionsShowPrompt(origin)) ??
|
||||
(await _inAppBrowser!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.androidOnGeolocationPermissionsShowPrompt(origin)))?.toMap();
|
||||
.androidOnGeolocationPermissionsShowPrompt(origin)))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -305,8 +314,7 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
// ignore: deprecated_member_use_from_same_package
|
||||
_webview!.androidOnGeolocationPermissionsHidePrompt!(this);
|
||||
}
|
||||
}
|
||||
else if (_inAppBrowser != null) {
|
||||
} else if (_inAppBrowser != null) {
|
||||
_inAppBrowser!.onGeolocationPermissionsHidePrompt();
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_inAppBrowser!.androidOnGeolocationPermissionsHidePrompt();
|
||||
|
@ -324,15 +332,20 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
|
||||
if (_webview != null) {
|
||||
if (_webview!.shouldInterceptRequest != null)
|
||||
return (await _webview!.shouldInterceptRequest!(this, request))?.toMap();
|
||||
return (await _webview!.shouldInterceptRequest!(this, request))
|
||||
?.toMap();
|
||||
else {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.androidShouldInterceptRequest!(this, request))?.toMap();
|
||||
return (await _webview!.androidShouldInterceptRequest!(
|
||||
this, request))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return ((await _inAppBrowser!.shouldInterceptRequest(request)) ??
|
||||
(await _inAppBrowser!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.androidShouldInterceptRequest(request)))?.toMap();
|
||||
.androidShouldInterceptRequest(request)))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -347,15 +360,20 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
|
||||
if (_webview != null) {
|
||||
if (_webview!.onRenderProcessUnresponsive != null)
|
||||
return (await _webview!.onRenderProcessUnresponsive!(this, uri))?.toMap();
|
||||
return (await _webview!.onRenderProcessUnresponsive!(this, uri))
|
||||
?.toMap();
|
||||
else {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.androidOnRenderProcessUnresponsive!(this, uri))?.toMap();
|
||||
return (await _webview!.androidOnRenderProcessUnresponsive!(
|
||||
this, uri))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return ((await _inAppBrowser!.onRenderProcessUnresponsive(uri)) ??
|
||||
(await _inAppBrowser!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.androidOnRenderProcessUnresponsive(uri)))?.toMap();
|
||||
.androidOnRenderProcessUnresponsive(uri)))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -370,15 +388,20 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
|
||||
if (_webview != null) {
|
||||
if (_webview!.onRenderProcessResponsive != null)
|
||||
return (await _webview!.onRenderProcessResponsive!(this, uri))?.toMap();
|
||||
return (await _webview!.onRenderProcessResponsive!(this, uri))
|
||||
?.toMap();
|
||||
else {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.androidOnRenderProcessResponsive!(this, uri))?.toMap();
|
||||
return (await _webview!.androidOnRenderProcessResponsive!(
|
||||
this, uri))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return ((await _inAppBrowser!.onRenderProcessResponsive(uri)) ??
|
||||
(await _inAppBrowser!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.androidOnRenderProcessResponsive(uri)))?.toMap();
|
||||
.androidOnRenderProcessResponsive(uri)))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -400,8 +423,7 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
// ignore: deprecated_member_use_from_same_package
|
||||
_webview!.androidOnRenderProcessGone!(this, detail);
|
||||
}
|
||||
}
|
||||
else if (_inAppBrowser != null) {
|
||||
} else if (_inAppBrowser != null) {
|
||||
_inAppBrowser!.onRenderProcessGone(detail);
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_inAppBrowser!.androidOnRenderProcessGone(detail);
|
||||
|
@ -422,12 +444,14 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
return (await _webview!.onFormResubmission!(this, uri))?.toMap();
|
||||
else {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.androidOnFormResubmission!(this, uri))?.toMap();
|
||||
return (await _webview!.androidOnFormResubmission!(this, uri))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return ((await _inAppBrowser!.onFormResubmission(uri)) ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.androidOnFormResubmission(uri)))?.toMap();
|
||||
(await _inAppBrowser!.androidOnFormResubmission(uri)))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -455,8 +479,8 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
}
|
||||
break;
|
||||
case "onReceivedIcon":
|
||||
if ((_webview != null && (
|
||||
_webview!.onReceivedIcon != null ||
|
||||
if ((_webview != null &&
|
||||
(_webview!.onReceivedIcon != null ||
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_webview!.androidOnReceivedIcon != null)) ||
|
||||
_inAppBrowser != null) {
|
||||
|
@ -545,8 +569,8 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
}
|
||||
break;
|
||||
case "onJsBeforeUnload":
|
||||
if ((_webview != null && (
|
||||
_webview!.onJsBeforeUnload != null ||
|
||||
if ((_webview != null &&
|
||||
(_webview!.onJsBeforeUnload != null ||
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_webview!.androidOnJsBeforeUnload != null)) ||
|
||||
_inAppBrowser != null) {
|
||||
|
@ -557,21 +581,28 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
|
||||
if (_webview != null) {
|
||||
if (_webview!.onJsBeforeUnload != null)
|
||||
return (await _webview!.onJsBeforeUnload!(this, jsBeforeUnloadRequest))?.toMap();
|
||||
return (await _webview!.onJsBeforeUnload!(
|
||||
this, jsBeforeUnloadRequest))
|
||||
?.toMap();
|
||||
else {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.androidOnJsBeforeUnload!(this, jsBeforeUnloadRequest))?.toMap();
|
||||
return (await _webview!.androidOnJsBeforeUnload!(
|
||||
this, jsBeforeUnloadRequest))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return ((await _inAppBrowser!.onJsBeforeUnload(jsBeforeUnloadRequest)) ??
|
||||
return ((await _inAppBrowser!
|
||||
.onJsBeforeUnload(jsBeforeUnloadRequest)) ??
|
||||
(await _inAppBrowser!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.androidOnJsBeforeUnload(jsBeforeUnloadRequest)))?.toMap();
|
||||
.androidOnJsBeforeUnload(jsBeforeUnloadRequest)))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "onSafeBrowsingHit":
|
||||
if ((_webview != null && (
|
||||
_webview!.onSafeBrowsingHit != null ||
|
||||
if ((_webview != null &&
|
||||
(_webview!.onSafeBrowsingHit != null ||
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_webview!.androidOnSafeBrowsingHit != null)) ||
|
||||
_inAppBrowser != null) {
|
||||
|
@ -582,15 +613,20 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
|
||||
if (_webview != null) {
|
||||
if (_webview!.onSafeBrowsingHit != null)
|
||||
return (await _webview!.onSafeBrowsingHit!(this, uri, threatType))?.toMap();
|
||||
return (await _webview!.onSafeBrowsingHit!(this, uri, threatType))
|
||||
?.toMap();
|
||||
else {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.androidOnSafeBrowsingHit!(this, uri, threatType))?.toMap();
|
||||
return (await _webview!.androidOnSafeBrowsingHit!(
|
||||
this, uri, threatType))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return ((await _inAppBrowser!.onSafeBrowsingHit(uri, threatType)) ??
|
||||
(await _inAppBrowser!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.androidOnSafeBrowsingHit(uri, threatType)))?.toMap();
|
||||
.androidOnSafeBrowsingHit(uri, threatType)))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -697,15 +733,22 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
|
||||
if (_webview != null) {
|
||||
if (_webview!.onPermissionRequest != null)
|
||||
return (await _webview!.onPermissionRequest!(this, origin, resources))?.toMap();
|
||||
return (await _webview!.onPermissionRequest!(
|
||||
this, origin, resources))
|
||||
?.toMap();
|
||||
else {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.androidOnPermissionRequest!(this, origin, resources))?.toMap();
|
||||
return (await _webview!.androidOnPermissionRequest!(
|
||||
this, origin, resources))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return ((await _inAppBrowser!.onPermissionRequest(origin, resources)) ??
|
||||
return ((await _inAppBrowser!
|
||||
.onPermissionRequest(origin, resources)) ??
|
||||
(await _inAppBrowser!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.androidOnPermissionRequest(origin, resources)))?.toMap();
|
||||
.androidOnPermissionRequest(origin, resources)))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -751,24 +794,30 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
break;
|
||||
case "onDidReceiveServerRedirectForProvisionalNavigation":
|
||||
if (_webview != null &&
|
||||
(_webview!.onDidReceiveServerRedirectForProvisionalNavigation != null ||
|
||||
(_webview!.onDidReceiveServerRedirectForProvisionalNavigation !=
|
||||
null ||
|
||||
_webview!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_webview!.iosOnDidReceiveServerRedirectForProvisionalNavigation != null)) {
|
||||
if (_webview!.onDidReceiveServerRedirectForProvisionalNavigation != null)
|
||||
.iosOnDidReceiveServerRedirectForProvisionalNavigation !=
|
||||
null)) {
|
||||
if (_webview!.onDidReceiveServerRedirectForProvisionalNavigation !=
|
||||
null)
|
||||
_webview!.onDidReceiveServerRedirectForProvisionalNavigation!(this);
|
||||
else {
|
||||
_webview!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_webview!.iosOnDidReceiveServerRedirectForProvisionalNavigation!(this);
|
||||
.iosOnDidReceiveServerRedirectForProvisionalNavigation!(this);
|
||||
}
|
||||
} else if (_inAppBrowser != null) {
|
||||
_inAppBrowser!.onDidReceiveServerRedirectForProvisionalNavigation();
|
||||
_inAppBrowser!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_inAppBrowser!.iosOnDidReceiveServerRedirectForProvisionalNavigation();
|
||||
.iosOnDidReceiveServerRedirectForProvisionalNavigation();
|
||||
}
|
||||
break;
|
||||
case "onNavigationResponse":
|
||||
if ((_webview != null && (
|
||||
_webview!.onNavigationResponse != null ||
|
||||
if ((_webview != null &&
|
||||
(_webview!.onNavigationResponse != null ||
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
_webview!.iosOnNavigationResponse != null)) ||
|
||||
_inAppBrowser != null) {
|
||||
|
@ -779,19 +828,28 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKNavigationResponse.fromMap(arguments)!;
|
||||
|
||||
NavigationResponse navigationResponse = NavigationResponse.fromMap(arguments)!;
|
||||
NavigationResponse navigationResponse =
|
||||
NavigationResponse.fromMap(arguments)!;
|
||||
|
||||
if (_webview != null) {
|
||||
if (_webview!.onNavigationResponse != null)
|
||||
return (await _webview!.onNavigationResponse!(this, navigationResponse))?.toMap();
|
||||
return (await _webview!.onNavigationResponse!(
|
||||
this, navigationResponse))
|
||||
?.toMap();
|
||||
else {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.iosOnNavigationResponse!(this, iosOnNavigationResponse))?.toMap();
|
||||
return (await _webview!.iosOnNavigationResponse!(
|
||||
this, iosOnNavigationResponse))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return (await _inAppBrowser!.onNavigationResponse(navigationResponse))?.toMap() ??
|
||||
return (await _inAppBrowser!
|
||||
.onNavigationResponse(navigationResponse))
|
||||
?.toMap() ??
|
||||
(await _inAppBrowser!
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.iosOnNavigationResponse(iosOnNavigationResponse))?.toMap();
|
||||
.iosOnNavigationResponse(iosOnNavigationResponse))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -808,15 +866,21 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
|
||||
if (_webview != null) {
|
||||
if (_webview!.shouldAllowDeprecatedTLS != null)
|
||||
return (await _webview!.shouldAllowDeprecatedTLS!(this, challenge))?.toMap();
|
||||
return (await _webview!.shouldAllowDeprecatedTLS!(
|
||||
this, challenge))
|
||||
?.toMap();
|
||||
else {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
return (await _webview!.iosShouldAllowDeprecatedTLS!(this, challenge))?.toMap();
|
||||
return (await _webview!.iosShouldAllowDeprecatedTLS!(
|
||||
this, challenge))
|
||||
?.toMap();
|
||||
}
|
||||
} else {
|
||||
return (await _inAppBrowser!.shouldAllowDeprecatedTLS(challenge))?.toMap() ??
|
||||
return (await _inAppBrowser!.shouldAllowDeprecatedTLS(challenge))
|
||||
?.toMap() ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
(await _inAppBrowser!.iosShouldAllowDeprecatedTLS(challenge))?.toMap();
|
||||
(await _inAppBrowser!.iosShouldAllowDeprecatedTLS(challenge))
|
||||
?.toMap();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -1327,8 +1391,8 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
Uri? iosAllowingReadAccessTo,
|
||||
Uri? allowingReadAccessTo}) async {
|
||||
assert(urlRequest.url != null && urlRequest.url.toString().isNotEmpty);
|
||||
assert(allowingReadAccessTo == null ||
|
||||
allowingReadAccessTo.isScheme("file"));
|
||||
assert(
|
||||
allowingReadAccessTo == null || allowingReadAccessTo.isScheme("file"));
|
||||
assert(iosAllowingReadAccessTo == null ||
|
||||
iosAllowingReadAccessTo.isScheme("file"));
|
||||
|
||||
|
@ -1387,8 +1451,8 @@ class InAppWebViewController with AndroidInAppWebViewControllerMixin, IOSInAppWe
|
|||
@Deprecated('Use allowingReadAccessTo instead')
|
||||
Uri? iosAllowingReadAccessTo,
|
||||
Uri? allowingReadAccessTo}) async {
|
||||
assert(allowingReadAccessTo == null ||
|
||||
allowingReadAccessTo.isScheme("file"));
|
||||
assert(
|
||||
allowingReadAccessTo == null || allowingReadAccessTo.isScheme("file"));
|
||||
assert(iosAllowingReadAccessTo == null ||
|
||||
iosAllowingReadAccessTo.isScheme("file"));
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@ class WebViewOptions {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
///This class represents all the WebView settings available.
|
||||
class InAppWebViewSettings implements WebViewOptions, BrowserOptions, AndroidOptions, IosOptions {
|
||||
class InAppWebViewSettings
|
||||
implements WebViewOptions, BrowserOptions, AndroidOptions, IosOptions {
|
||||
///Set to `true` to be able to listen at the [WebView.shouldOverrideUrlLoading] event. The default value is `false`.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
|
@ -1076,7 +1076,8 @@ class InAppWebViewSettings implements WebViewOptions, BrowserOptions, AndroidOpt
|
|||
defaultTargetPlatform == TargetPlatform.android ? 8 : 0;
|
||||
assert(!this.resourceCustomSchemes.contains("http") &&
|
||||
!this.resourceCustomSchemes.contains("https"));
|
||||
assert(allowingReadAccessTo == null || allowingReadAccessTo!.isScheme("file"));
|
||||
assert(
|
||||
allowingReadAccessTo == null || allowingReadAccessTo!.isScheme("file"));
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -1225,8 +1226,7 @@ class InAppWebViewSettings implements WebViewOptions, BrowserOptions, AndroidOpt
|
|||
List<String> dataDetectorTypesList =
|
||||
List<String>.from(map["dataDetectorTypes"] ?? []);
|
||||
dataDetectorTypesList.forEach((dataDetectorTypeValue) {
|
||||
var dataDetectorType =
|
||||
DataDetectorTypes.fromValue(dataDetectorTypeValue);
|
||||
var dataDetectorType = DataDetectorTypes.fromValue(dataDetectorTypeValue);
|
||||
if (dataDetectorType != null) {
|
||||
dataDetectorTypes.add(dataDetectorType);
|
||||
}
|
||||
|
@ -1311,14 +1311,11 @@ class InAppWebViewSettings implements WebViewOptions, BrowserOptions, AndroidOpt
|
|||
instance.useHybridComposition = map["useHybridComposition"];
|
||||
instance.useShouldInterceptRequest = map["useShouldInterceptRequest"];
|
||||
instance.useOnRenderProcessGone = map["useOnRenderProcessGone"];
|
||||
instance.overScrollMode =
|
||||
OverScrollMode.fromValue(map["overScrollMode"]);
|
||||
instance.overScrollMode = OverScrollMode.fromValue(map["overScrollMode"]);
|
||||
instance.networkAvailable = map["networkAvailable"];
|
||||
instance.scrollBarStyle =
|
||||
ScrollBarStyle.fromValue(map["scrollBarStyle"]);
|
||||
instance.scrollBarStyle = ScrollBarStyle.fromValue(map["scrollBarStyle"]);
|
||||
instance.verticalScrollbarPosition =
|
||||
VerticalScrollbarPosition.fromValue(
|
||||
map["verticalScrollbarPosition"]);
|
||||
VerticalScrollbarPosition.fromValue(map["verticalScrollbarPosition"]);
|
||||
instance.scrollBarDefaultDelayBeforeFade =
|
||||
map["scrollBarDefaultDelayBeforeFade"];
|
||||
instance.scrollbarFadingEnabled = map["scrollbarFadingEnabled"];
|
||||
|
@ -1660,7 +1657,6 @@ class InAppWebViewOptions
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
var instance = InAppWebViewOptions();
|
||||
instance.useShouldOverrideUrlLoading = map["useShouldOverrideUrlLoading"];
|
||||
instance.useOnLoadResource = map["useOnLoadResource"];
|
||||
|
|
|
@ -29,12 +29,13 @@ abstract class IOSInAppWebViewControllerMixin {
|
|||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - WKWebView.createPdf](https://developer.apple.com/documentation/webkit/wkwebview/3650490-createpdf))
|
||||
Future<Uint8List?> createPdf(
|
||||
{@Deprecated("Use pdfConfiguration instead")
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
{@Deprecated("Use pdfConfiguration instead") IOSWKPDFConfiguration? iosWKPdfConfiguration,
|
||||
IOSWKPDFConfiguration? iosWKPdfConfiguration,
|
||||
PDFConfiguration? pdfConfiguration}) async {
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent(
|
||||
'pdfConfiguration', () => pdfConfiguration?.toMap() ?? iosWKPdfConfiguration?.toMap());
|
||||
args.putIfAbsent('pdfConfiguration',
|
||||
() => pdfConfiguration?.toMap() ?? iosWKPdfConfiguration?.toMap());
|
||||
return await _channel.invokeMethod('createPdf', args);
|
||||
}
|
||||
|
||||
|
|
|
@ -598,8 +598,7 @@ abstract class WebView {
|
|||
///**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)))
|
||||
final Future<WebViewRenderProcessAction?> Function(
|
||||
InAppWebViewController controller, Uri? url)?
|
||||
onRenderProcessUnresponsive;
|
||||
InAppWebViewController controller, Uri? url)? onRenderProcessUnresponsive;
|
||||
|
||||
///Use [onRenderProcessResponsive] instead.
|
||||
@Deprecated("Use onRenderProcessResponsive instead")
|
||||
|
@ -620,8 +619,7 @@ abstract class WebView {
|
|||
///**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)))
|
||||
final Future<WebViewRenderProcessAction?> Function(
|
||||
InAppWebViewController controller, Uri? url)?
|
||||
onRenderProcessResponsive;
|
||||
InAppWebViewController controller, Uri? url)? onRenderProcessResponsive;
|
||||
|
||||
///Use [onRenderProcessGone] instead.
|
||||
@Deprecated("Use onRenderProcessGone instead")
|
||||
|
@ -870,45 +868,64 @@ abstract class WebView {
|
|||
this.onWindowBlur,
|
||||
this.onOverScrolled,
|
||||
this.onZoomScaleChanged,
|
||||
@Deprecated('Use onSafeBrowsingHit instead') this.androidOnSafeBrowsingHit,
|
||||
@Deprecated('Use onSafeBrowsingHit instead')
|
||||
this.androidOnSafeBrowsingHit,
|
||||
this.onSafeBrowsingHit,
|
||||
@Deprecated('Use onPermissionRequest instead') this.androidOnPermissionRequest,
|
||||
@Deprecated('Use onPermissionRequest instead')
|
||||
this.androidOnPermissionRequest,
|
||||
this.onPermissionRequest,
|
||||
@Deprecated('Use onGeolocationPermissionsShowPrompt instead') this.androidOnGeolocationPermissionsShowPrompt,
|
||||
@Deprecated('Use onGeolocationPermissionsShowPrompt instead')
|
||||
this.androidOnGeolocationPermissionsShowPrompt,
|
||||
this.onGeolocationPermissionsShowPrompt,
|
||||
@Deprecated('Use onGeolocationPermissionsHidePrompt instead') this.androidOnGeolocationPermissionsHidePrompt,
|
||||
@Deprecated('Use onGeolocationPermissionsHidePrompt instead')
|
||||
this.androidOnGeolocationPermissionsHidePrompt,
|
||||
this.onGeolocationPermissionsHidePrompt,
|
||||
@Deprecated('Use shouldInterceptRequest instead') this.androidShouldInterceptRequest,
|
||||
@Deprecated('Use shouldInterceptRequest instead')
|
||||
this.androidShouldInterceptRequest,
|
||||
this.shouldInterceptRequest,
|
||||
@Deprecated('Use onRenderProcessGone instead') this.androidOnRenderProcessGone,
|
||||
@Deprecated('Use onRenderProcessGone instead')
|
||||
this.androidOnRenderProcessGone,
|
||||
this.onRenderProcessGone,
|
||||
@Deprecated('Use onRenderProcessResponsive instead') this.androidOnRenderProcessResponsive,
|
||||
@Deprecated('Use onRenderProcessResponsive instead')
|
||||
this.androidOnRenderProcessResponsive,
|
||||
this.onRenderProcessResponsive,
|
||||
@Deprecated('Use onRenderProcessUnresponsive instead') this.androidOnRenderProcessUnresponsive,
|
||||
@Deprecated('Use onRenderProcessUnresponsive instead')
|
||||
this.androidOnRenderProcessUnresponsive,
|
||||
this.onRenderProcessUnresponsive,
|
||||
@Deprecated('Use onFormResubmission instead') this.androidOnFormResubmission,
|
||||
@Deprecated('Use onFormResubmission instead')
|
||||
this.androidOnFormResubmission,
|
||||
this.onFormResubmission,
|
||||
@Deprecated('Use onZoomScaleChanged instead') this.androidOnScaleChanged,
|
||||
@Deprecated('Use onReceivedIcon instead') this.androidOnReceivedIcon,
|
||||
@Deprecated('Use onZoomScaleChanged instead')
|
||||
this.androidOnScaleChanged,
|
||||
@Deprecated('Use onReceivedIcon instead')
|
||||
this.androidOnReceivedIcon,
|
||||
this.onReceivedIcon,
|
||||
@Deprecated('Use onReceivedTouchIconUrl instead') this.androidOnReceivedTouchIconUrl,
|
||||
@Deprecated('Use onReceivedTouchIconUrl instead')
|
||||
this.androidOnReceivedTouchIconUrl,
|
||||
this.onReceivedTouchIconUrl,
|
||||
@Deprecated('Use onJsBeforeUnload instead') this.androidOnJsBeforeUnload,
|
||||
@Deprecated('Use onJsBeforeUnload instead')
|
||||
this.androidOnJsBeforeUnload,
|
||||
this.onJsBeforeUnload,
|
||||
@Deprecated('Use onReceivedLoginRequest instead') this.androidOnReceivedLoginRequest,
|
||||
@Deprecated('Use onReceivedLoginRequest instead')
|
||||
this.androidOnReceivedLoginRequest,
|
||||
this.onReceivedLoginRequest,
|
||||
@Deprecated('Use onWebContentProcessDidTerminate instead') this.iosOnWebContentProcessDidTerminate,
|
||||
@Deprecated('Use onWebContentProcessDidTerminate instead')
|
||||
this.iosOnWebContentProcessDidTerminate,
|
||||
this.onWebContentProcessDidTerminate,
|
||||
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead') this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
|
||||
@Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead')
|
||||
this.iosOnDidReceiveServerRedirectForProvisionalNavigation,
|
||||
this.onDidReceiveServerRedirectForProvisionalNavigation,
|
||||
@Deprecated('Use onNavigationResponse instead') this.iosOnNavigationResponse,
|
||||
@Deprecated('Use onNavigationResponse instead')
|
||||
this.iosOnNavigationResponse,
|
||||
this.onNavigationResponse,
|
||||
@Deprecated('Use shouldAllowDeprecatedTLS instead') this.iosShouldAllowDeprecatedTLS,
|
||||
@Deprecated('Use shouldAllowDeprecatedTLS instead')
|
||||
this.iosShouldAllowDeprecatedTLS,
|
||||
this.shouldAllowDeprecatedTLS,
|
||||
this.initialUrlRequest,
|
||||
this.initialFile,
|
||||
this.initialData,
|
||||
@Deprecated('Use initialSettings instead') this.initialOptions,
|
||||
@Deprecated('Use initialSettings instead')
|
||||
this.initialOptions,
|
||||
this.initialSettings,
|
||||
this.contextMenu,
|
||||
this.initialUserScripts,
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
export 'pull_to_refresh_controller.dart';
|
||||
export 'pull_to_refresh_options.dart';
|
||||
export 'pull_to_refresh_settings.dart';
|
||||
|
|
|
@ -6,7 +6,7 @@ import '../in_app_browser/in_app_browser.dart';
|
|||
import '../util.dart';
|
||||
import '../types.dart';
|
||||
import '../in_app_webview/in_app_webview_settings.dart';
|
||||
import 'pull_to_refresh_options.dart';
|
||||
import 'pull_to_refresh_settings.dart';
|
||||
|
||||
///A standard controller that can initiate the refreshing of a scroll view’s contents.
|
||||
///This should be used whenever the user can refresh the contents of a WebView via a vertical swipe gesture.
|
||||
|
@ -16,14 +16,24 @@ import 'pull_to_refresh_options.dart';
|
|||
///
|
||||
///**NOTE for Android**: to be able to use the "pull-to-refresh" feature, [InAppWebViewSettings.useHybridComposition] must be `true`.
|
||||
class PullToRefreshController {
|
||||
@Deprecated("Use settings instead")
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
late PullToRefreshOptions options;
|
||||
late PullToRefreshSettings settings;
|
||||
MethodChannel? _channel;
|
||||
|
||||
///Event called when a swipe gesture triggers a refresh.
|
||||
final void Function()? onRefresh;
|
||||
|
||||
PullToRefreshController({PullToRefreshOptions? options, this.onRefresh}) {
|
||||
PullToRefreshController(
|
||||
{
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
@Deprecated("Use settings instead") PullToRefreshOptions? options,
|
||||
PullToRefreshSettings? settings,
|
||||
this.onRefresh}) {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.options = options ?? PullToRefreshOptions();
|
||||
this.settings = settings ?? PullToRefreshSettings();
|
||||
}
|
||||
|
||||
Future<dynamic> handleMethod(MethodCall call) async {
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
import 'dart:ui';
|
||||
import '../util.dart';
|
||||
import '../types.dart';
|
||||
|
||||
class PullToRefreshOptions {
|
||||
///Sets whether the pull-to-refresh feature is enabled or not.
|
||||
bool enabled;
|
||||
|
||||
///The color of the refresh control.
|
||||
Color? color;
|
||||
|
||||
///The background color of the refresh control.
|
||||
Color? backgroundColor;
|
||||
|
||||
///The distance to trigger a sync in dips.
|
||||
///
|
||||
///**NOTE**: Available only on Android.
|
||||
int? distanceToTriggerSync;
|
||||
|
||||
///The distance in pixels that the refresh indicator can be pulled beyond its resting position.
|
||||
///
|
||||
///**NOTE**: Available only on Android.
|
||||
int? slingshotDistance;
|
||||
|
||||
///The size of the refresh indicator.
|
||||
///
|
||||
///**NOTE**: Available only on Android.
|
||||
AndroidPullToRefreshSize? size;
|
||||
|
||||
///The title text to display in the refresh control.
|
||||
///
|
||||
///**NOTE**: Available only on iOS.
|
||||
IOSNSAttributedString? attributedTitle;
|
||||
|
||||
PullToRefreshOptions(
|
||||
{this.enabled = true,
|
||||
this.color,
|
||||
this.backgroundColor,
|
||||
this.distanceToTriggerSync,
|
||||
this.slingshotDistance,
|
||||
this.size,
|
||||
this.attributedTitle});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"enabled": enabled,
|
||||
"color": color?.toHex(),
|
||||
"backgroundColor": backgroundColor?.toHex(),
|
||||
"distanceToTriggerSync": distanceToTriggerSync,
|
||||
"slingshotDistance": slingshotDistance,
|
||||
"size": size?.toValue(),
|
||||
"attributedTitle": attributedTitle?.toMap() ?? {}
|
||||
};
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
import 'dart:ui';
|
||||
import '../util.dart';
|
||||
import '../types.dart';
|
||||
|
||||
///Pull-To-Refresh Settings
|
||||
class PullToRefreshSettings {
|
||||
///Sets whether the pull-to-refresh feature is enabled or not.
|
||||
bool enabled;
|
||||
|
||||
///The color of the refresh control.
|
||||
Color? color;
|
||||
|
||||
///The background color of the refresh control.
|
||||
Color? backgroundColor;
|
||||
|
||||
///The distance to trigger a sync in dips.
|
||||
///
|
||||
///**NOTE**: Available only on Android.
|
||||
int? distanceToTriggerSync;
|
||||
|
||||
///The distance in pixels that the refresh indicator can be pulled beyond its resting position.
|
||||
///
|
||||
///**NOTE**: Available only on Android.
|
||||
int? slingshotDistance;
|
||||
|
||||
///The size of the refresh indicator.
|
||||
///
|
||||
///**NOTE**: Available only on Android.
|
||||
PullToRefreshSize? size;
|
||||
|
||||
///The title text to display in the refresh control.
|
||||
///
|
||||
///**NOTE**: Available only on iOS.
|
||||
AttributedString? attributedTitle;
|
||||
|
||||
PullToRefreshSettings(
|
||||
{this.enabled = true,
|
||||
this.color,
|
||||
this.backgroundColor,
|
||||
this.distanceToTriggerSync,
|
||||
this.slingshotDistance,
|
||||
this.size,
|
||||
this.attributedTitle});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"enabled": enabled,
|
||||
"color": color?.toHex(),
|
||||
"backgroundColor": backgroundColor?.toHex(),
|
||||
"distanceToTriggerSync": distanceToTriggerSync,
|
||||
"slingshotDistance": slingshotDistance,
|
||||
"size": size?.toValue(),
|
||||
"attributedTitle": attributedTitle?.toMap() ?? {}
|
||||
};
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
||||
|
||||
///Use [PullToRefreshSettings] instead.
|
||||
@Deprecated("Use PullToRefreshSettings instead")
|
||||
class PullToRefreshOptions {
|
||||
///Sets whether the pull-to-refresh feature is enabled or not.
|
||||
bool enabled;
|
||||
|
||||
///The color of the refresh control.
|
||||
Color? color;
|
||||
|
||||
///The background color of the refresh control.
|
||||
Color? backgroundColor;
|
||||
|
||||
///The distance to trigger a sync in dips.
|
||||
///
|
||||
///**NOTE**: Available only on Android.
|
||||
int? distanceToTriggerSync;
|
||||
|
||||
///The distance in pixels that the refresh indicator can be pulled beyond its resting position.
|
||||
///
|
||||
///**NOTE**: Available only on Android.
|
||||
int? slingshotDistance;
|
||||
|
||||
///The size of the refresh indicator.
|
||||
///
|
||||
///**NOTE**: Available only on Android.
|
||||
AndroidPullToRefreshSize? size;
|
||||
|
||||
///The title text to display in the refresh control.
|
||||
///
|
||||
///**NOTE**: Available only on iOS.
|
||||
IOSNSAttributedString? attributedTitle;
|
||||
|
||||
PullToRefreshOptions(
|
||||
{this.enabled = true,
|
||||
this.color,
|
||||
this.backgroundColor,
|
||||
this.distanceToTriggerSync,
|
||||
this.slingshotDistance,
|
||||
this.size,
|
||||
this.attributedTitle});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"enabled": enabled,
|
||||
"color": color?.toHex(),
|
||||
"backgroundColor": backgroundColor?.toHex(),
|
||||
"distanceToTriggerSync": distanceToTriggerSync,
|
||||
"slingshotDistance": slingshotDistance,
|
||||
"size": size?.toValue(),
|
||||
"attributedTitle": attributedTitle?.toMap() ?? {}
|
||||
};
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ import 'http_auth_credentials_database.dart';
|
|||
import 'cookie_manager.dart';
|
||||
import 'web_storage/web_storage.dart';
|
||||
import 'pull_to_refresh/pull_to_refresh_controller.dart';
|
||||
import 'pull_to_refresh/pull_to_refresh_options.dart';
|
||||
import 'pull_to_refresh/pull_to_refresh_settings.dart';
|
||||
import 'util.dart';
|
||||
import 'web_message/web_message_listener.dart';
|
||||
import 'web_message/web_message_channel.dart';
|
||||
|
@ -173,12 +173,13 @@ class InAppWebViewInitialData {
|
|||
this.mimeType = "text/html",
|
||||
this.encoding = "utf8",
|
||||
Uri? baseUrl,
|
||||
@Deprecated('Use historyUrl instead')
|
||||
Uri? androidHistoryUrl,
|
||||
@Deprecated('Use historyUrl instead') Uri? androidHistoryUrl,
|
||||
Uri? historyUrl}) {
|
||||
this.baseUrl = baseUrl == null ? Uri.parse("about:blank") : baseUrl;
|
||||
this.historyUrl = historyUrl == null
|
||||
? (androidHistoryUrl == null ? Uri.parse("about:blank") : androidHistoryUrl)
|
||||
? (androidHistoryUrl == null
|
||||
? Uri.parse("about:blank")
|
||||
: androidHistoryUrl)
|
||||
: historyUrl;
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.androidHistoryUrl = this.historyUrl;
|
||||
|
@ -552,8 +553,11 @@ class JsAlertRequest {
|
|||
///**NOTE**: available only on iOS.
|
||||
bool? isMainFrame;
|
||||
|
||||
JsAlertRequest({this.url, this.message,
|
||||
@Deprecated("Use isMainFrame instead") this.iosIsMainFrame, this.isMainFrame}) {
|
||||
JsAlertRequest(
|
||||
{this.url,
|
||||
this.message,
|
||||
@Deprecated("Use isMainFrame instead") this.iosIsMainFrame,
|
||||
this.isMainFrame}) {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.isMainFrame = this.isMainFrame ?? this.iosIsMainFrame;
|
||||
}
|
||||
|
@ -664,8 +668,11 @@ class JsConfirmRequest {
|
|||
///**NOTE**: available only on iOS.
|
||||
bool? isMainFrame;
|
||||
|
||||
JsConfirmRequest({this.url, this.message,
|
||||
@Deprecated("Use isMainFrame instead") this.iosIsMainFrame, this.isMainFrame}) {
|
||||
JsConfirmRequest(
|
||||
{this.url,
|
||||
this.message,
|
||||
@Deprecated("Use isMainFrame instead") this.iosIsMainFrame,
|
||||
this.isMainFrame}) {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.isMainFrame = this.isMainFrame ?? this.iosIsMainFrame;
|
||||
}
|
||||
|
@ -785,8 +792,11 @@ class JsPromptRequest {
|
|||
bool? isMainFrame;
|
||||
|
||||
JsPromptRequest(
|
||||
{this.url, this.message, this.defaultValue,
|
||||
@Deprecated("Use isMainFrame instead") this.iosIsMainFrame, this.isMainFrame}) {
|
||||
{this.url,
|
||||
this.message,
|
||||
this.defaultValue,
|
||||
@Deprecated("Use isMainFrame instead") this.iosIsMainFrame,
|
||||
this.isMainFrame}) {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.isMainFrame = this.isMainFrame ?? this.iosIsMainFrame;
|
||||
}
|
||||
|
@ -1327,7 +1337,9 @@ class URLCredential {
|
|||
@Deprecated("Use persistence instead") this.iosCertificates,
|
||||
this.certificates}) {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.persistence = this.persistence ?? URLCredentialPersistence.fromValue(this.iosPersistence?.toValue());
|
||||
this.persistence = this.persistence ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
URLCredentialPersistence.fromValue(this.iosPersistence?.toValue());
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.certificates = this.certificates ?? this.iosCertificates;
|
||||
}
|
||||
|
@ -1336,10 +1348,12 @@ class URLCredential {
|
|||
return {
|
||||
"username": username,
|
||||
"password": password,
|
||||
"iosCertificates":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosCertificates": (certificates ?? iosCertificates)?.map((e) => e.toMap()).toList(),
|
||||
(certificates ?? iosCertificates)?.map((e) => e.toMap()).toList(),
|
||||
"certificates":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"certificates": (certificates ?? iosCertificates)?.map((e) => e.toMap()).toList(),
|
||||
(certificates ?? iosCertificates)?.map((e) => e.toMap()).toList(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosPersistence": persistence?.toValue() ?? iosPersistence?.toValue(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
|
@ -1374,8 +1388,9 @@ class URLCredential {
|
|||
certificates: certificates,
|
||||
persistence: URLCredentialPersistence.fromValue(map["persistence"]),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosPersistence: IOSURLCredentialPersistence.fromValue(map["persistence"])
|
||||
);
|
||||
iosPersistence:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSURLCredentialPersistence.fromValue(map["persistence"]));
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
|
@ -1458,17 +1473,18 @@ class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
|
|||
///**NOTE**: available only on iOS.
|
||||
String? error;
|
||||
|
||||
HttpAuthenticationChallenge({
|
||||
required this.previousFailureCount,
|
||||
HttpAuthenticationChallenge(
|
||||
{required this.previousFailureCount,
|
||||
required URLProtectionSpace protectionSpace,
|
||||
@Deprecated("Use failureResponse instead") this.iosFailureResponse,
|
||||
this.failureResponse,
|
||||
this.proposedCredential,
|
||||
@Deprecated("Use error instead") this.iosError,
|
||||
this.error
|
||||
}) : super(protectionSpace: protectionSpace) {
|
||||
this.error})
|
||||
: super(protectionSpace: protectionSpace) {
|
||||
this.failureResponse = this.failureResponse ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.failureResponse = this.failureResponse ?? URLResponse.fromMap(this.iosFailureResponse?.toMap());
|
||||
URLResponse.fromMap(this.iosFailureResponse?.toMap());
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.error = this.error ?? this.iosError;
|
||||
}
|
||||
|
@ -1479,10 +1495,12 @@ class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
|
|||
"previousFailureCount": previousFailureCount,
|
||||
"protectionSpace": protectionSpace.toMap(),
|
||||
"proposedCredential": proposedCredential?.toMap(),
|
||||
"iosFailureResponse":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosFailureResponse": failureResponse?.toMap() ?? iosFailureResponse?.toMap(),
|
||||
failureResponse?.toMap() ?? iosFailureResponse?.toMap(),
|
||||
"failureResponse":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"failureResponse": failureResponse?.toMap() ?? iosFailureResponse?.toMap(),
|
||||
failureResponse?.toMap() ?? iosFailureResponse?.toMap(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosError": error ?? iosError,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
|
@ -1504,8 +1522,8 @@ class HttpAuthenticationChallenge extends URLAuthenticationChallenge {
|
|||
// ignore: deprecated_member_use_from_same_package
|
||||
iosFailureResponse: IOSURLResponse.fromMap(
|
||||
map["failureResponse"]?.cast<String, dynamic>()),
|
||||
failureResponse: URLResponse.fromMap(
|
||||
map["failureResponse"]?.cast<String, dynamic>()),
|
||||
failureResponse:
|
||||
URLResponse.fromMap(map["failureResponse"]?.cast<String, dynamic>()),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosError: map["error"],
|
||||
error: map["error"],
|
||||
|
@ -1705,8 +1723,7 @@ class URLProtectionSpaceAuthenticationMethod {
|
|||
.NSURL_AUTHENTICATION_METHOD_CLIENT_CERTIFICATE,
|
||||
URLProtectionSpaceAuthenticationMethod
|
||||
.NSURL_AUTHENTICATION_METHOD_NEGOTIATE,
|
||||
URLProtectionSpaceAuthenticationMethod
|
||||
.NSURL_AUTHENTICATION_METHOD_NTLM,
|
||||
URLProtectionSpaceAuthenticationMethod.NSURL_AUTHENTICATION_METHOD_NTLM,
|
||||
URLProtectionSpaceAuthenticationMethod
|
||||
.NSURL_AUTHENTICATION_METHOD_SERVER_TRUST,
|
||||
].toSet();
|
||||
|
@ -1833,11 +1850,14 @@ class SslError {
|
|||
///The message associated to the [code].
|
||||
String? message;
|
||||
|
||||
SslError({@Deprecated('Use code instead') this.androidError,
|
||||
SslError(
|
||||
{@Deprecated('Use code instead') this.androidError,
|
||||
@Deprecated('Use code instead') this.iosError,
|
||||
this.code, this.message}) {
|
||||
this.code,
|
||||
this.message}) {
|
||||
this.code = this.code ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.code = this.code ?? SslErrorType.fromValue(this.androidError?.toValue() ??
|
||||
SslErrorType.fromValue(this.androidError?.toValue() ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.iosError?.toValue());
|
||||
}
|
||||
|
@ -1956,26 +1976,36 @@ class URLProtectionSpace {
|
|||
this.port,
|
||||
this.sslCertificate,
|
||||
this.sslError,
|
||||
@Deprecated("Use authenticationMethod instead") this.iosAuthenticationMethod,
|
||||
@Deprecated("Use authenticationMethod instead")
|
||||
this.iosAuthenticationMethod,
|
||||
this.authenticationMethod,
|
||||
@Deprecated("Use distinguishedNames instead") this.iosDistinguishedNames,
|
||||
@Deprecated("Use distinguishedNames instead")
|
||||
this.iosDistinguishedNames,
|
||||
this.distinguishedNames,
|
||||
@Deprecated("Use receivesCredentialSecurely instead") this.iosReceivesCredentialSecurely,
|
||||
@Deprecated("Use receivesCredentialSecurely instead")
|
||||
this.iosReceivesCredentialSecurely,
|
||||
this.receivesCredentialSecurely,
|
||||
@Deprecated("Use isProxy instead") this.iosIsProxy,
|
||||
@Deprecated("Use isProxy instead")
|
||||
this.iosIsProxy,
|
||||
this.isProxy,
|
||||
@Deprecated("Use proxyType instead") this.iosProxyType,
|
||||
@Deprecated("Use proxyType instead")
|
||||
this.iosProxyType,
|
||||
this.proxyType}) {
|
||||
this.authenticationMethod = this.authenticationMethod ??
|
||||
URLProtectionSpaceAuthenticationMethod.fromValue(
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.authenticationMethod = this.authenticationMethod ?? URLProtectionSpaceAuthenticationMethod.fromValue(this.iosAuthenticationMethod?.toValue());
|
||||
this.iosAuthenticationMethod?.toValue());
|
||||
this.distinguishedNames =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.distinguishedNames = this.distinguishedNames ?? this.iosDistinguishedNames;
|
||||
this.distinguishedNames ?? this.iosDistinguishedNames;
|
||||
this.receivesCredentialSecurely =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.receivesCredentialSecurely = this.receivesCredentialSecurely ?? this.iosReceivesCredentialSecurely;
|
||||
this.receivesCredentialSecurely ?? this.iosReceivesCredentialSecurely;
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.isProxy = this.isProxy ?? this.iosIsProxy;
|
||||
this.proxyType = this.proxyType ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.proxyType = this.proxyType ?? URLProtectionSpaceProxyType.fromValue(this.iosProxyType?.toValue());
|
||||
URLProtectionSpaceProxyType.fromValue(this.iosProxyType?.toValue());
|
||||
}
|
||||
|
||||
static URLProtectionSpace? fromMap(Map<String, dynamic>? map) {
|
||||
|
@ -2036,18 +2066,25 @@ class URLProtectionSpace {
|
|||
"port": port,
|
||||
"sslCertificate": sslCertificate?.toMap(),
|
||||
"sslError": sslError?.toMap(),
|
||||
"iosAuthenticationMethod":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosAuthenticationMethod": authenticationMethod ?? iosAuthenticationMethod,
|
||||
authenticationMethod ?? iosAuthenticationMethod,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"authenticationMethod": authenticationMethod ?? iosAuthenticationMethod,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosDistinguishedNames": (distinguishedNames ?? iosDistinguishedNames)?.map((e) => e.toMap()).toList(),
|
||||
"iosDistinguishedNames": (distinguishedNames ?? iosDistinguishedNames)
|
||||
?.map((e) => e.toMap())
|
||||
.toList(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"distinguishedNames": (distinguishedNames ?? iosDistinguishedNames)?.map((e) => e.toMap()).toList(),
|
||||
"distinguishedNames": (distinguishedNames ?? iosDistinguishedNames)
|
||||
?.map((e) => e.toMap())
|
||||
.toList(),
|
||||
"iosReceivesCredentialSecurely":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosReceivesCredentialSecurely": receivesCredentialSecurely ?? iosReceivesCredentialSecurely,
|
||||
receivesCredentialSecurely ?? iosReceivesCredentialSecurely,
|
||||
"receivesCredentialSecurely":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"receivesCredentialSecurely": receivesCredentialSecurely ?? iosReceivesCredentialSecurely,
|
||||
receivesCredentialSecurely ?? iosReceivesCredentialSecurely,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosIsProxy": isProxy ?? iosIsProxy,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
|
@ -2213,7 +2250,8 @@ class ClientCertResponse {
|
|||
ClientCertResponse(
|
||||
{required this.certificatePath,
|
||||
this.certificatePassword = "",
|
||||
@Deprecated('Use keyStoreType instead') this.androidKeyStoreType = "PKCS12",
|
||||
@Deprecated('Use keyStoreType instead')
|
||||
this.androidKeyStoreType = "PKCS12",
|
||||
this.keyStoreType = "PKCS12",
|
||||
this.action = ClientCertResponseAction.CANCEL}) {
|
||||
if (this.action == ClientCertResponseAction.PROCEED)
|
||||
|
@ -2454,12 +2492,10 @@ class ActionModeMenuItem {
|
|||
static const MENU_ITEM_SHARE = const ActionModeMenuItem._internal(1);
|
||||
|
||||
///Disable menu item "Web Search".
|
||||
static const MENU_ITEM_WEB_SEARCH =
|
||||
const ActionModeMenuItem._internal(2);
|
||||
static const MENU_ITEM_WEB_SEARCH = const ActionModeMenuItem._internal(2);
|
||||
|
||||
///Disable all the action mode menu items for text processing.
|
||||
static const MENU_ITEM_PROCESS_TEXT =
|
||||
const ActionModeMenuItem._internal(4);
|
||||
static const MENU_ITEM_PROCESS_TEXT = const ActionModeMenuItem._internal(4);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
|
@ -2794,13 +2830,11 @@ class MixedContentMode {
|
|||
|
||||
///In this mode, the WebView will allow a secure origin to load content from any other origin, even if that origin is insecure.
|
||||
///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 =
|
||||
const MixedContentMode._internal(0);
|
||||
static const MIXED_CONTENT_ALWAYS_ALLOW = const MixedContentMode._internal(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 =
|
||||
const MixedContentMode._internal(1);
|
||||
static const MIXED_CONTENT_NEVER_ALLOW = const MixedContentMode._internal(1);
|
||||
|
||||
///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.
|
||||
|
@ -3024,8 +3058,7 @@ class DataDetectorTypes {
|
|||
static const NONE = const DataDetectorTypes._internal("NONE");
|
||||
|
||||
///Phone numbers are detected and turned into links.
|
||||
static const PHONE_NUMBER =
|
||||
const DataDetectorTypes._internal("PHONE_NUMBER");
|
||||
static const PHONE_NUMBER = const DataDetectorTypes._internal("PHONE_NUMBER");
|
||||
|
||||
///URLs in text are detected and turned into links.
|
||||
static const LINK = const DataDetectorTypes._internal("LINK");
|
||||
|
@ -3174,8 +3207,7 @@ class ScrollViewDecelerationRate {
|
|||
String toString() => _value;
|
||||
|
||||
///The default deceleration rate for a scroll view: `0.998`.
|
||||
static const NORMAL =
|
||||
const ScrollViewDecelerationRate._internal("NORMAL");
|
||||
static const NORMAL = const ScrollViewDecelerationRate._internal("NORMAL");
|
||||
|
||||
///A fast deceleration rate for a scroll view: `0.99`.
|
||||
static const FAST = const ScrollViewDecelerationRate._internal("FAST");
|
||||
|
@ -3359,12 +3391,10 @@ class ModalPresentationStyle {
|
|||
static const CUSTOM = const ModalPresentationStyle._internal(4);
|
||||
|
||||
///A view presentation style in which the presented view covers the screen.
|
||||
static const OVER_FULL_SCREEN =
|
||||
const ModalPresentationStyle._internal(5);
|
||||
static const OVER_FULL_SCREEN = const ModalPresentationStyle._internal(5);
|
||||
|
||||
///A presentation style where the content is displayed over another view controller’s content.
|
||||
static const OVER_CURRENT_CONTEXT =
|
||||
const ModalPresentationStyle._internal(6);
|
||||
static const OVER_CURRENT_CONTEXT = const ModalPresentationStyle._internal(6);
|
||||
|
||||
///A presentation style where the content is displayed in a popover view.
|
||||
static const POPOVER = const ModalPresentationStyle._internal(7);
|
||||
|
@ -5150,12 +5180,10 @@ class URLRequestNetworkServiceType {
|
|||
const URLRequestNetworkServiceType._internal(6);
|
||||
|
||||
///A service type for streaming audio/video data.
|
||||
static const AV_STREAMING =
|
||||
const URLRequestNetworkServiceType._internal(8);
|
||||
static const AV_STREAMING = const URLRequestNetworkServiceType._internal(8);
|
||||
|
||||
///A service type for responsive (time-sensitive) audio/video data.
|
||||
static const RESPONSIVE_AV =
|
||||
const URLRequestNetworkServiceType._internal(9);
|
||||
static const RESPONSIVE_AV = const URLRequestNetworkServiceType._internal(9);
|
||||
|
||||
///A service type for call signaling.
|
||||
///
|
||||
|
@ -5521,12 +5549,15 @@ class NavigationAction {
|
|||
this.hasGesture = this.hasGesture ?? this.androidHasGesture;
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.isRedirect = this.isRedirect ?? this.androidIsRedirect;
|
||||
this.navigationType = this.navigationType ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.navigationType = this.navigationType ?? NavigationType.fromValue(this.iosWKNavigationType?.toValue());
|
||||
NavigationType.fromValue(this.iosWKNavigationType?.toValue());
|
||||
this.sourceFrame =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.sourceFrame = this.sourceFrame ?? FrameInfo.fromMap(this.iosSourceFrame?.toMap());
|
||||
this.sourceFrame ?? FrameInfo.fromMap(this.iosSourceFrame?.toMap());
|
||||
this.targetFrame =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.targetFrame = this.targetFrame ?? FrameInfo.fromMap(this.iosTargetFrame?.toMap());
|
||||
this.targetFrame ?? FrameInfo.fromMap(this.iosTargetFrame?.toMap());
|
||||
}
|
||||
|
||||
static NavigationAction? fromMap(Map<String, dynamic>? map) {
|
||||
|
@ -5543,14 +5574,22 @@ class NavigationAction {
|
|||
androidIsRedirect: map["isRedirect"] ?? map["androidIsRedirect"],
|
||||
isRedirect: map["isRedirect"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosWKNavigationType: IOSWKNavigationType.fromValue(map["navigationType"]),
|
||||
iosWKNavigationType:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKNavigationType.fromValue(map["navigationType"]),
|
||||
navigationType: NavigationType.fromValue(map["navigationType"]),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosSourceFrame: IOSWKFrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
sourceFrame: FrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
iosSourceFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTargetFrame: IOSWKFrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()),
|
||||
targetFrame: FrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()));
|
||||
IOSWKFrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
sourceFrame:
|
||||
FrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTargetFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()),
|
||||
targetFrame:
|
||||
FrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()));
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
|
@ -5565,10 +5604,12 @@ class NavigationAction {
|
|||
"isRedirect": isRedirect ?? androidIsRedirect,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"androidIsRedirect": isRedirect ?? androidIsRedirect,
|
||||
"iosWKNavigationType":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosWKNavigationType": navigationType?.toValue() ?? iosWKNavigationType?.toValue(),
|
||||
navigationType?.toValue() ?? iosWKNavigationType?.toValue(),
|
||||
"navigationType":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"navigationType": navigationType?.toValue() ?? iosWKNavigationType?.toValue(),
|
||||
navigationType?.toValue() ?? iosWKNavigationType?.toValue(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosSourceFrame": sourceFrame?.toMap() ?? iosSourceFrame?.toMap(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
|
@ -5615,24 +5656,31 @@ class CreateWindowAction extends NavigationAction {
|
|||
|
||||
CreateWindowAction(
|
||||
{required this.windowId,
|
||||
@Deprecated('Use isDialog instead') this.androidIsDialog,
|
||||
@Deprecated('Use isDialog instead')
|
||||
this.androidIsDialog,
|
||||
this.isDialog,
|
||||
@Deprecated('Use windowFeatures instead') this.iosWindowFeatures,
|
||||
@Deprecated('Use windowFeatures instead')
|
||||
this.iosWindowFeatures,
|
||||
this.windowFeatures,
|
||||
required URLRequest request,
|
||||
required bool isForMainFrame,
|
||||
@Deprecated('Use hasGesture instead') bool? androidHasGesture,
|
||||
@Deprecated('Use isRedirect instead') bool? androidIsRedirect,
|
||||
@Deprecated('Use hasGesture instead')
|
||||
bool? androidHasGesture,
|
||||
@Deprecated('Use isRedirect instead')
|
||||
bool? androidIsRedirect,
|
||||
bool? hasGesture,
|
||||
bool? isRedirect,
|
||||
@Deprecated('Use navigationType instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
@Deprecated('Use navigationType instead') IOSWKNavigationType? iosWKNavigationType,
|
||||
IOSWKNavigationType? iosWKNavigationType,
|
||||
NavigationType? navigationType,
|
||||
@Deprecated('Use sourceFrame instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
@Deprecated('Use sourceFrame instead') IOSWKFrameInfo? iosSourceFrame,
|
||||
IOSWKFrameInfo? iosSourceFrame,
|
||||
FrameInfo? sourceFrame,
|
||||
@Deprecated('Use targetFrame instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
@Deprecated('Use targetFrame instead') IOSWKFrameInfo? iosTargetFrame,
|
||||
IOSWKFrameInfo? iosTargetFrame,
|
||||
FrameInfo? targetFrame})
|
||||
: super(
|
||||
request: request,
|
||||
|
@ -5644,18 +5692,29 @@ class CreateWindowAction extends NavigationAction {
|
|||
androidIsRedirect: isRedirect ?? androidIsRedirect,
|
||||
isRedirect: isRedirect ?? androidIsRedirect,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosWKNavigationType: IOSWKNavigationType.fromValue(navigationType?.toValue()) ?? iosWKNavigationType,
|
||||
navigationType: navigationType ?? NavigationType.fromValue(iosWKNavigationType?.toValue()),
|
||||
iosWKNavigationType:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosSourceFrame: IOSWKFrameInfo.fromMap(sourceFrame?.toMap()) ?? iosSourceFrame,
|
||||
sourceFrame: sourceFrame ?? FrameInfo.fromMap(iosSourceFrame?.toMap()),
|
||||
IOSWKNavigationType.fromValue(navigationType?.toValue()) ??
|
||||
iosWKNavigationType,
|
||||
navigationType: navigationType ??
|
||||
NavigationType.fromValue(iosWKNavigationType?.toValue()),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTargetFrame: IOSWKFrameInfo.fromMap(targetFrame?.toMap()) ?? iosTargetFrame,
|
||||
targetFrame: targetFrame ?? FrameInfo.fromMap(iosTargetFrame?.toMap())) {
|
||||
iosSourceFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(sourceFrame?.toMap()) ?? iosSourceFrame,
|
||||
sourceFrame:
|
||||
sourceFrame ?? FrameInfo.fromMap(iosSourceFrame?.toMap()),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTargetFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(targetFrame?.toMap()) ?? iosTargetFrame,
|
||||
targetFrame:
|
||||
targetFrame ?? FrameInfo.fromMap(iosTargetFrame?.toMap())) {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.isDialog = this.isDialog ?? this.androidIsDialog;
|
||||
this.windowFeatures = this.windowFeatures ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.windowFeatures = this.windowFeatures ?? WindowFeatures.fromMap(this.iosWindowFeatures?.toMap());
|
||||
WindowFeatures.fromMap(this.iosWindowFeatures?.toMap());
|
||||
}
|
||||
|
||||
static CreateWindowAction? fromMap(Map<String, dynamic>? map) {
|
||||
|
@ -5684,18 +5743,19 @@ class CreateWindowAction extends NavigationAction {
|
|||
iosWKNavigationType:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKNavigationType.fromValue(map["navigationType"]),
|
||||
navigationType:
|
||||
NavigationType.fromValue(map["navigationType"]),
|
||||
navigationType: NavigationType.fromValue(map["navigationType"]),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosSourceFrame: IOSWKFrameInfo.fromMap(
|
||||
map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
sourceFrame: FrameInfo.fromMap(
|
||||
map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
iosSourceFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTargetFrame: IOSWKFrameInfo.fromMap(
|
||||
map["targetFrame"]?.cast<String, dynamic>()),
|
||||
targetFrame: FrameInfo.fromMap(
|
||||
map["targetFrame"]?.cast<String, dynamic>()));
|
||||
IOSWKFrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
sourceFrame:
|
||||
FrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTargetFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()),
|
||||
targetFrame:
|
||||
FrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()));
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -5707,8 +5767,9 @@ class CreateWindowAction extends NavigationAction {
|
|||
"androidIsDialog": isDialog ?? androidIsDialog,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"isDialog": isDialog ?? androidIsDialog,
|
||||
"iosWindowFeatures":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosWindowFeatures": windowFeatures?.toMap() ?? iosWindowFeatures?.toMap(),
|
||||
windowFeatures?.toMap() ?? iosWindowFeatures?.toMap(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"windowFeatures": windowFeatures?.toMap() ?? iosWindowFeatures?.toMap(),
|
||||
});
|
||||
|
@ -5854,8 +5915,7 @@ class WebsiteDataType {
|
|||
|
||||
///IndexedDB databases.
|
||||
static const WKWebsiteDataTypeIndexedDBDatabases =
|
||||
const WebsiteDataType._internal(
|
||||
"WKWebsiteDataTypeIndexedDBDatabases");
|
||||
const WebsiteDataType._internal("WKWebsiteDataTypeIndexedDBDatabases");
|
||||
|
||||
///Service worker registrations.
|
||||
///
|
||||
|
@ -6545,8 +6605,7 @@ class ScrollBarStyle {
|
|||
|
||||
///The scrollbar style to display the scrollbars inside the content area, without increasing the padding.
|
||||
///The scrollbars will be overlaid with translucency on the view's content.
|
||||
static const SCROLLBARS_INSIDE_OVERLAY =
|
||||
const ScrollBarStyle._internal(0);
|
||||
static const SCROLLBARS_INSIDE_OVERLAY = const ScrollBarStyle._internal(0);
|
||||
|
||||
///The scrollbar style to display the scrollbars inside the padded area, increasing the padding of the view.
|
||||
///The scrollbars will not overlap the content area of the view.
|
||||
|
@ -7736,7 +7795,10 @@ class UserScript {
|
|||
ContentWorld? contentWorld}) {
|
||||
this.contentWorld = contentWorld ?? ContentWorld.PAGE;
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.forMainFrameOnly = this.iosForMainFrameOnly != null ? this.iosForMainFrameOnly! : this.forMainFrameOnly;
|
||||
this.forMainFrameOnly = this.iosForMainFrameOnly != null
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
? this.iosForMainFrameOnly!
|
||||
: this.forMainFrameOnly;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
|
@ -7989,7 +8051,10 @@ class ScreenshotConfiguration {
|
|||
this.afterScreenUpdates = true}) {
|
||||
assert(this.quality >= 0);
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.afterScreenUpdates = this.iosAfterScreenUpdates != null ? this.iosAfterScreenUpdates! : this.afterScreenUpdates;
|
||||
this.afterScreenUpdates = this.iosAfterScreenUpdates != null
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
? this.iosAfterScreenUpdates!
|
||||
: this.afterScreenUpdates;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
|
@ -8548,8 +8613,7 @@ class NavigationResponse {
|
|||
return null;
|
||||
}
|
||||
return NavigationResponse(
|
||||
response:
|
||||
URLResponse.fromMap(map["response"]?.cast<String, dynamic>()),
|
||||
response: URLResponse.fromMap(map["response"]?.cast<String, dynamic>()),
|
||||
isForMainFrame: map["isForMainFrame"],
|
||||
canShowMIMEType: map["canShowMIMEType"],
|
||||
);
|
||||
|
@ -8831,43 +8895,57 @@ class URLRequest {
|
|||
///**NOTE**: available only on iOS.
|
||||
Uri? mainDocumentURL;
|
||||
|
||||
URLRequest(
|
||||
{required this.url,
|
||||
URLRequest({
|
||||
required this.url,
|
||||
this.method,
|
||||
this.headers,
|
||||
this.body,
|
||||
@Deprecated("Use allowsCellularAccess instead") this.iosAllowsCellularAccess,
|
||||
@Deprecated("Use allowsCellularAccess instead")
|
||||
this.iosAllowsCellularAccess,
|
||||
this.allowsCellularAccess,
|
||||
@Deprecated("Use allowsConstrainedNetworkAccess instead") this.iosAllowsConstrainedNetworkAccess,
|
||||
@Deprecated("Use allowsConstrainedNetworkAccess instead")
|
||||
this.iosAllowsConstrainedNetworkAccess,
|
||||
this.allowsConstrainedNetworkAccess,
|
||||
@Deprecated("Use allowsExpensiveNetworkAccess instead") this.iosAllowsExpensiveNetworkAccess,
|
||||
@Deprecated("Use allowsExpensiveNetworkAccess instead")
|
||||
this.iosAllowsExpensiveNetworkAccess,
|
||||
this.allowsExpensiveNetworkAccess,
|
||||
@Deprecated("Use cachePolicy instead") this.iosCachePolicy,
|
||||
this.cachePolicy,
|
||||
@Deprecated("Use httpShouldHandleCookies instead") this.iosHttpShouldHandleCookies,
|
||||
@Deprecated("Use httpShouldHandleCookies instead")
|
||||
this.iosHttpShouldHandleCookies,
|
||||
this.httpShouldHandleCookies,
|
||||
@Deprecated("Use httpShouldUsePipelining instead") this.iosHttpShouldUsePipelining,
|
||||
@Deprecated("Use httpShouldUsePipelining instead")
|
||||
this.iosHttpShouldUsePipelining,
|
||||
this.httpShouldUsePipelining,
|
||||
@Deprecated("Use networkServiceType instead") this.iosNetworkServiceType,
|
||||
this.networkServiceType,
|
||||
@Deprecated("Use timeoutInterval instead") this.iosTimeoutInterval,
|
||||
this.timeoutInterval,
|
||||
@Deprecated("Use mainDocumentURL instead") this.iosMainDocumentURL,
|
||||
this.mainDocumentURL,}) {
|
||||
this.mainDocumentURL,
|
||||
}) {
|
||||
this.allowsCellularAccess =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.allowsCellularAccess = this.allowsCellularAccess ?? this.iosAllowsCellularAccess;
|
||||
this.allowsCellularAccess ?? this.iosAllowsCellularAccess;
|
||||
this.allowsConstrainedNetworkAccess = this.allowsConstrainedNetworkAccess ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.allowsConstrainedNetworkAccess = this.allowsConstrainedNetworkAccess ?? this.iosAllowsConstrainedNetworkAccess;
|
||||
this.iosAllowsConstrainedNetworkAccess;
|
||||
this.allowsExpensiveNetworkAccess = this.allowsExpensiveNetworkAccess ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.allowsExpensiveNetworkAccess = this.allowsExpensiveNetworkAccess ?? this.iosAllowsExpensiveNetworkAccess;
|
||||
this.iosAllowsExpensiveNetworkAccess;
|
||||
this.cachePolicy = this.cachePolicy ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.cachePolicy = this.cachePolicy ?? URLRequestCachePolicy.fromValue(this.iosCachePolicy?.toValue());
|
||||
URLRequestCachePolicy.fromValue(this.iosCachePolicy?.toValue());
|
||||
this.httpShouldHandleCookies =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.httpShouldHandleCookies = this.httpShouldHandleCookies ?? this.iosHttpShouldHandleCookies;
|
||||
this.httpShouldHandleCookies ?? this.iosHttpShouldHandleCookies;
|
||||
this.httpShouldUsePipelining =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.httpShouldUsePipelining = this.httpShouldUsePipelining ?? this.iosHttpShouldUsePipelining;
|
||||
this.httpShouldUsePipelining ?? this.iosHttpShouldUsePipelining;
|
||||
this.networkServiceType =
|
||||
this.networkServiceType ?? URLRequestNetworkServiceType.fromValue(
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.networkServiceType = this.networkServiceType ?? URLRequestNetworkServiceType.fromValue(this.iosNetworkServiceType?.toValue());
|
||||
this.iosNetworkServiceType?.toValue());
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.timeoutInterval = this.timeoutInterval ?? this.iosTimeoutInterval;
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
|
@ -8902,8 +8980,11 @@ class URLRequest {
|
|||
iosHttpShouldUsePipelining: map["httpShouldUsePipelining"],
|
||||
httpShouldUsePipelining: map["httpShouldUsePipelining"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosNetworkServiceType: IOSURLRequestNetworkServiceType.fromValue(map["networkServiceType"]),
|
||||
networkServiceType: URLRequestNetworkServiceType.fromValue(map["networkServiceType"]),
|
||||
iosNetworkServiceType:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSURLRequestNetworkServiceType.fromValue(map["networkServiceType"]),
|
||||
networkServiceType:
|
||||
URLRequestNetworkServiceType.fromValue(map["networkServiceType"]),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTimeoutInterval: map["timeoutInterval"],
|
||||
timeoutInterval: map["timeoutInterval"],
|
||||
|
@ -8923,34 +9004,45 @@ class URLRequest {
|
|||
"headers": headers,
|
||||
"method": method,
|
||||
"body": body,
|
||||
"iosAllowsCellularAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosAllowsCellularAccess": allowsCellularAccess ?? iosAllowsCellularAccess,
|
||||
allowsCellularAccess ?? iosAllowsCellularAccess,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"allowsCellularAccess": allowsCellularAccess ?? iosAllowsCellularAccess,
|
||||
"iosAllowsConstrainedNetworkAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosAllowsConstrainedNetworkAccess": allowsConstrainedNetworkAccess ?? iosAllowsConstrainedNetworkAccess,
|
||||
allowsConstrainedNetworkAccess ?? iosAllowsConstrainedNetworkAccess,
|
||||
"allowsConstrainedNetworkAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"allowsConstrainedNetworkAccess": allowsConstrainedNetworkAccess ?? iosAllowsConstrainedNetworkAccess,
|
||||
allowsConstrainedNetworkAccess ?? iosAllowsConstrainedNetworkAccess,
|
||||
"iosAllowsExpensiveNetworkAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosAllowsExpensiveNetworkAccess": allowsExpensiveNetworkAccess ?? iosAllowsExpensiveNetworkAccess,
|
||||
allowsExpensiveNetworkAccess ?? iosAllowsExpensiveNetworkAccess,
|
||||
"allowsExpensiveNetworkAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"allowsExpensiveNetworkAccess": allowsExpensiveNetworkAccess ?? iosAllowsExpensiveNetworkAccess,
|
||||
allowsExpensiveNetworkAccess ?? iosAllowsExpensiveNetworkAccess,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosCachePolicy": cachePolicy?.toValue() ?? iosCachePolicy?.toValue(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"cachePolicy": cachePolicy?.toValue() ?? iosCachePolicy?.toValue(),
|
||||
"iosHttpShouldHandleCookies":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosHttpShouldHandleCookies": httpShouldHandleCookies ?? iosHttpShouldHandleCookies,
|
||||
httpShouldHandleCookies ?? iosHttpShouldHandleCookies,
|
||||
"httpShouldHandleCookies":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"httpShouldHandleCookies": httpShouldHandleCookies ?? iosHttpShouldHandleCookies,
|
||||
httpShouldHandleCookies ?? iosHttpShouldHandleCookies,
|
||||
"iosHttpShouldUsePipelining":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosHttpShouldUsePipelining": httpShouldUsePipelining ?? iosHttpShouldUsePipelining,
|
||||
httpShouldUsePipelining ?? iosHttpShouldUsePipelining,
|
||||
"httpShouldUsePipelining":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"httpShouldUsePipelining": httpShouldUsePipelining ?? iosHttpShouldUsePipelining,
|
||||
httpShouldUsePipelining ?? iosHttpShouldUsePipelining,
|
||||
"iosNetworkServiceType":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosNetworkServiceType": networkServiceType?.toValue() ?? iosNetworkServiceType?.toValue(),
|
||||
networkServiceType?.toValue() ?? iosNetworkServiceType?.toValue(),
|
||||
"networkServiceType":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"networkServiceType": networkServiceType?.toValue() ?? iosNetworkServiceType?.toValue(),
|
||||
networkServiceType?.toValue() ?? iosNetworkServiceType?.toValue(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosTimeoutInterval": timeoutInterval ?? iosTimeoutInterval,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
|
@ -9123,7 +9215,7 @@ class IOSWKWindowFeatures {
|
|||
}
|
||||
|
||||
///Class that represents a string with associated attributes
|
||||
///used by the [PullToRefreshController] and [PullToRefreshOptions] classes.
|
||||
///used by the [PullToRefreshController] and [PullToRefreshSettings] classes.
|
||||
class AttributedString {
|
||||
///The characters for the new object.
|
||||
String string;
|
||||
|
@ -9999,10 +10091,11 @@ class TrustedWebActivityImmersiveDisplayMode
|
|||
this.displayCutoutMode = LayoutInDisplayCutoutMode.DEFAULT,
|
||||
this.layoutInDisplayCutoutMode}) {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.displayCutoutMode = this.layoutInDisplayCutoutMode != null ?
|
||||
this.displayCutoutMode = this.layoutInDisplayCutoutMode != null
|
||||
? LayoutInDisplayCutoutMode.fromValue(
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
LayoutInDisplayCutoutMode.fromValue(this.layoutInDisplayCutoutMode!.toValue())! :
|
||||
this.displayCutoutMode;
|
||||
this.layoutInDisplayCutoutMode!.toValue())!
|
||||
: this.displayCutoutMode;
|
||||
}
|
||||
|
||||
static TrustedWebActivityImmersiveDisplayMode? fromMap(
|
||||
|
@ -10088,8 +10181,7 @@ class LayoutInDisplayCutoutMode {
|
|||
///Content renders into the cutout area in both portrait and landscape modes.
|
||||
///
|
||||
///**NOTE**: available on Android 28+.
|
||||
static const SHORT_EDGES =
|
||||
const LayoutInDisplayCutoutMode._internal(1);
|
||||
static const SHORT_EDGES = const LayoutInDisplayCutoutMode._internal(1);
|
||||
|
||||
///Content never renders into the cutout area.
|
||||
///
|
||||
|
|
|
@ -6,7 +6,6 @@ import '_static_channel.dart';
|
|||
import 'android/web_storage_manager.dart';
|
||||
import 'ios/web_storage_manager.dart';
|
||||
|
||||
|
||||
import '../types.dart';
|
||||
|
||||
///Class that implements a singleton object (shared instance) which manages the web storage used by WebView instances.
|
||||
|
@ -174,8 +173,7 @@ class WebStorageManager {
|
|||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - WKWebsiteDataStore.removeData](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532938-removedata))
|
||||
Future<void> removeDataModifiedSince(
|
||||
{required Set<WebsiteDataType> dataTypes,
|
||||
required DateTime date}) async {
|
||||
{required Set<WebsiteDataType> dataTypes, required DateTime date}) async {
|
||||
List<String> dataTypesList = [];
|
||||
for (var dataType in dataTypes) {
|
||||
dataTypesList.add(dataType.toValue());
|
||||
|
|
Loading…
Reference in New Issue