fix #507
This commit is contained in:
parent
5b5620282d
commit
5476d142f4
|
@ -5,6 +5,7 @@
|
|||
- Merge "Added missing field 'headers' which returned by WebResourceResponse.toMap()" [#490](https://github.com/pichillilorenzo/flutter_inappwebview/pull/490) (thanks to [Doflatango](https://github.com/Doflatango))
|
||||
- Merge "Fix: added iOS fallback module import" [#466](https://github.com/pichillilorenzo/flutter_inappwebview/pull/466) (thanks to [Eddayy](https://github.com/Eddayy))
|
||||
- Merge "Fix NullPointerException after taking a photo by a camera app on Android" [#492](https://github.com/pichillilorenzo/flutter_inappwebview/pull/492) (thanks to [AAkira](https://github.com/AAkira))
|
||||
- Fixed "Issue in Flutter web: 'Unsupported operation: Platform._operatingSystem'" [#507](https://github.com/pichillilorenzo/flutter_inappwebview/issues/507)
|
||||
- Fixed "window.flutter_inappwebview.callHandler is not a function" [#218](https://github.com/pichillilorenzo/flutter_inappwebview/issues/218)
|
||||
|
||||
## 4.0.0+4
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"e2e","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/e2e-0.2.4+4/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.10/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.11/","dependencies":[]}],"android":[{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"e2e","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/e2e-0.2.4+4/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.10/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.11/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+1/","dependencies":[]}],"windows":[],"web":[{"name":"url_launcher_web","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.2/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_inappwebview","dependencies":[]},{"name":"e2e","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-08-27 17:01:18.942482","version":"1.20.2"}
|
||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"e2e","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/e2e-0.2.4+4/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.10/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.11/","dependencies":[]}],"android":[{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"e2e","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/e2e-0.2.4+4/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.10/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1/","dependencies":[]},{"name":"url_launcher","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.11/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+1/","dependencies":[]}],"windows":[],"web":[{"name":"url_launcher_web","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.2/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_inappwebview","dependencies":[]},{"name":"e2e","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-09-07 10:28:45.900709","version":"1.20.3"}
|
|
@ -325,7 +325,6 @@
|
|||
/* Begin XCBuildConfiguration section */
|
||||
97C147031CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
|
@ -383,7 +382,6 @@
|
|||
};
|
||||
97C147041CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
|
|
|
@ -471,7 +471,7 @@ class InAppWebViewController {
|
|||
|
||||
SslCertificate sslCertificate;
|
||||
if (sslCertificateMap != null) {
|
||||
if (Platform.isIOS) {
|
||||
if (defaultTargetPlatform == TargetPlatform.iOS) {
|
||||
try {
|
||||
X509Certificate x509certificate = X509Certificate.fromData(
|
||||
data: sslCertificateMap["x509Certificate"]);
|
||||
|
@ -670,8 +670,8 @@ class InAppWebViewController {
|
|||
androidId: androidId, iosId: iosId, title: title, action: null);
|
||||
|
||||
for (var menuItem in contextMenu.menuItems) {
|
||||
if ((Platform.isAndroid && menuItem.androidId == androidId) ||
|
||||
(Platform.isIOS && menuItem.iosId == iosId)) {
|
||||
if ((defaultTargetPlatform == TargetPlatform.android && menuItem.androidId == androidId) ||
|
||||
(defaultTargetPlatform == TargetPlatform.iOS && menuItem.iosId == iosId)) {
|
||||
menuItemClicked = menuItem;
|
||||
menuItem?.action();
|
||||
break;
|
||||
|
@ -1348,7 +1348,7 @@ class InAppWebViewController {
|
|||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('source', () => source);
|
||||
var data = await _channel.invokeMethod('evaluateJavascript', args);
|
||||
if (data != null && Platform.isAndroid) data = json.decode(data);
|
||||
if (data != null && defaultTargetPlatform == TargetPlatform.android) data = json.decode(data);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -1693,8 +1693,8 @@ class InAppWebViewController {
|
|||
///
|
||||
///**Official iOS API**: https://developer.apple.com/documentation/uikit/uiscrollview/1619412-setzoomscale
|
||||
Future<void> zoomBy(double zoomFactor) async {
|
||||
assert(!Platform.isAndroid ||
|
||||
(Platform.isAndroid && zoomFactor > 0.01 && zoomFactor <= 100.0));
|
||||
assert(defaultTargetPlatform != TargetPlatform.android ||
|
||||
(defaultTargetPlatform == TargetPlatform.android && zoomFactor > 0.01 && zoomFactor <= 100.0));
|
||||
|
||||
Map<String, dynamic> args = <String, dynamic>{};
|
||||
args.putIfAbsent('zoomFactor', () => zoomFactor);
|
||||
|
@ -1907,7 +1907,7 @@ class InAppWebViewController {
|
|||
?.cast<String, dynamic>();
|
||||
|
||||
if (sslCertificateMap != null) {
|
||||
if (Platform.isIOS) {
|
||||
if (defaultTargetPlatform == TargetPlatform.iOS) {
|
||||
try {
|
||||
X509Certificate x509certificate = X509Certificate.fromData(
|
||||
data: sslCertificateMap["x509Certificate"]);
|
||||
|
|
|
@ -2014,9 +2014,9 @@ class InAppWebViewGroupOptions {
|
|||
Map<String, dynamic> toMap() {
|
||||
Map<String, dynamic> options = {};
|
||||
options.addAll(this.crossPlatform?.toMap() ?? {});
|
||||
if (Platform.isAndroid)
|
||||
if (defaultTargetPlatform == TargetPlatform.android)
|
||||
options.addAll(this.android?.toMap() ?? {});
|
||||
else if (Platform.isIOS) options.addAll(this.ios?.toMap() ?? {});
|
||||
else if (defaultTargetPlatform == TargetPlatform.iOS) options.addAll(this.ios?.toMap() ?? {});
|
||||
|
||||
return options;
|
||||
}
|
||||
|
@ -2027,10 +2027,10 @@ class InAppWebViewGroupOptions {
|
|||
|
||||
inAppWebViewGroupOptions.crossPlatform =
|
||||
InAppWebViewOptions.fromMap(options);
|
||||
if (Platform.isAndroid)
|
||||
if (defaultTargetPlatform == TargetPlatform.android)
|
||||
inAppWebViewGroupOptions.android =
|
||||
AndroidInAppWebViewOptions.fromMap(options);
|
||||
else if (Platform.isIOS)
|
||||
else if (defaultTargetPlatform == TargetPlatform.iOS)
|
||||
inAppWebViewGroupOptions.ios = IOSInAppWebViewOptions.fromMap(options);
|
||||
|
||||
return inAppWebViewGroupOptions;
|
||||
|
@ -2081,10 +2081,10 @@ class InAppBrowserClassOptions {
|
|||
|
||||
options.addAll(this.crossPlatform?.toMap() ?? {});
|
||||
options.addAll(this.inAppWebViewGroupOptions?.crossPlatform?.toMap() ?? {});
|
||||
if (Platform.isAndroid) {
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
options.addAll(this.android?.toMap() ?? {});
|
||||
options.addAll(this.inAppWebViewGroupOptions?.android?.toMap() ?? {});
|
||||
} else if (Platform.isIOS) {
|
||||
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
|
||||
options.addAll(this.ios?.toMap() ?? {});
|
||||
options.addAll(this.inAppWebViewGroupOptions?.ios?.toMap() ?? {});
|
||||
}
|
||||
|
@ -2111,12 +2111,12 @@ class InAppBrowserClassOptions {
|
|||
InAppWebViewGroupOptions();
|
||||
inAppBrowserClassOptions.inAppWebViewGroupOptions.crossPlatform =
|
||||
InAppWebViewOptions.fromMap(options);
|
||||
if (Platform.isAndroid) {
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
inAppBrowserClassOptions.android =
|
||||
AndroidInAppBrowserOptions.fromMap(options);
|
||||
inAppBrowserClassOptions.inAppWebViewGroupOptions.android =
|
||||
AndroidInAppWebViewOptions.fromMap(options);
|
||||
} else if (Platform.isIOS) {
|
||||
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
|
||||
inAppBrowserClassOptions.ios = IOSInAppBrowserOptions.fromMap(options);
|
||||
inAppBrowserClassOptions.inAppWebViewGroupOptions.ios =
|
||||
IOSInAppWebViewOptions.fromMap(options);
|
||||
|
@ -2145,9 +2145,9 @@ class ChromeSafariBrowserClassOptions {
|
|||
|
||||
Map<String, dynamic> toMap() {
|
||||
Map<String, dynamic> options = {};
|
||||
if (Platform.isAndroid)
|
||||
if (defaultTargetPlatform == TargetPlatform.android)
|
||||
options.addAll(this.android?.toMap() ?? {});
|
||||
else if (Platform.isIOS) options.addAll(this.ios?.toMap() ?? {});
|
||||
else if (defaultTargetPlatform == TargetPlatform.iOS) options.addAll(this.ios?.toMap() ?? {});
|
||||
|
||||
return options;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'content_blocker.dart';
|
||||
import 'types.dart';
|
||||
|
@ -201,7 +201,7 @@ class InAppWebViewOptions
|
|||
this.disableContextMenu = false,
|
||||
this.supportZoom = true}) {
|
||||
if (this.minimumFontSize == null)
|
||||
this.minimumFontSize = Platform.isAndroid ? 8 : 0;
|
||||
this.minimumFontSize = defaultTargetPlatform == TargetPlatform.android ? 8 : 0;
|
||||
assert(!this.resourceCustomSchemes.contains("http") &&
|
||||
!this.resourceCustomSchemes.contains("https"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue