diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a245ce8..dbbeea73 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,16 @@ - Removed `URLProtectionSpace.iosIsProxy` property - `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null` +## 5.5.0+3 + +- Fixed iOS `toolbarTopTintColor` InAppBrowser option +- Fixed iOS `InAppBrowserOptions.hideProgressBar` when getting options +- Fixed missing implementation `InAppBrowser.isHidden` method on Android and iOS +- Fixed "Attempt to invoke virtual method 'java.lang.String android.webkit.WebView.getUrl()' on a null object reference" [#1324](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1324) +- Fixed "(Crash) NullPointerException at in_app_browser.InAppBrowserActivity.close' on a null object reference" [#1278](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1278) +- Fixed "ios system version parser error" [#1355](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1355) +- Removed unnamed constructors for all Singleton classes to avoid incorrect usage + ## 5.5.0+2 - Fixed README diff --git a/ios/Classes/InAppBrowser/InAppBrowserSettings.swift b/ios/Classes/InAppBrowser/InAppBrowserSettings.swift index 1449b312..384acb4f 100755 --- a/ios/Classes/InAppBrowser/InAppBrowserSettings.swift +++ b/ios/Classes/InAppBrowser/InAppBrowserSettings.swift @@ -37,7 +37,7 @@ public class InAppBrowserSettings: ISettings { if let inAppBrowserWebViewController = obj { realOptions["hidden"] = inAppBrowserWebViewController.isHidden realOptions["hideUrlBar"] = inAppBrowserWebViewController.searchBar.isHidden - realOptions["progressBar"] = inAppBrowserWebViewController.progressBar.isHidden + realOptions["hideProgressBar"] = inAppBrowserWebViewController.progressBar.isHidden realOptions["closeButtonCaption"] = inAppBrowserWebViewController.closeButton.title realOptions["closeButtonColor"] = inAppBrowserWebViewController.closeButton.tintColor?.hexString if let navController = inAppBrowserWebViewController.navigationController { diff --git a/lib/src/android/proxy_controller.dart b/lib/src/android/proxy_controller.dart index ce0f438a..50d3210a 100644 --- a/lib/src/android/proxy_controller.dart +++ b/lib/src/android/proxy_controller.dart @@ -19,6 +19,8 @@ class ProxyController { static const MethodChannel _channel = const MethodChannel( 'com.pichillilorenzo/flutter_inappwebview_proxycontroller'); + ProxyController._(); + ///Gets the [ProxyController] shared instance. /// ///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.PROXY_OVERRIDE]. @@ -35,7 +37,7 @@ class ProxyController { print(e.stackTrace); } }); - _instance = ProxyController(); + _instance = ProxyController._(); return _instance!; } diff --git a/lib/src/android/service_worker_controller.dart b/lib/src/android/service_worker_controller.dart index 7b8cb042..8f180332 100644 --- a/lib/src/android/service_worker_controller.dart +++ b/lib/src/android/service_worker_controller.dart @@ -15,6 +15,8 @@ class ServiceWorkerController { static const MethodChannel _channel = const MethodChannel( 'com.pichillilorenzo/flutter_inappwebview_serviceworkercontroller'); + ServiceWorkerController._(); + ///Gets the [ServiceWorkerController] shared instance. /// ///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_BASIC_USAGE]. @@ -47,7 +49,7 @@ class ServiceWorkerController { print(e.stackTrace); } }); - _instance = ServiceWorkerController(); + _instance = ServiceWorkerController._(); return _instance!; } diff --git a/lib/src/cookie_manager.dart b/lib/src/cookie_manager.dart index a97b017f..5d85d608 100755 --- a/lib/src/cookie_manager.dart +++ b/lib/src/cookie_manager.dart @@ -27,6 +27,8 @@ class CookieManager { static const MethodChannel _channel = const MethodChannel( 'com.pichillilorenzo/flutter_inappwebview_cookiemanager'); + CookieManager._(); + ///Use [CookieManager] instead. @Deprecated("Use CookieManager instead") late IOSCookieManager ios; @@ -45,7 +47,7 @@ class CookieManager { print(e.stackTrace); } }); - _instance = CookieManager(); + _instance = CookieManager._(); // ignore: deprecated_member_use_from_same_package _instance!.ios = IOSCookieManager.instance(); return _instance!; @@ -542,8 +544,10 @@ class IOSCookieManager { return (_instance != null) ? _instance! : _init(); } + IOSCookieManager._(); + static IOSCookieManager _init() { - _instance = IOSCookieManager(); + _instance = IOSCookieManager._(); return _instance!; } diff --git a/lib/src/http_auth_credentials_database.dart b/lib/src/http_auth_credentials_database.dart index 53027398..8baa1368 100755 --- a/lib/src/http_auth_credentials_database.dart +++ b/lib/src/http_auth_credentials_database.dart @@ -18,6 +18,8 @@ class HttpAuthCredentialDatabase { static const MethodChannel _channel = const MethodChannel( 'com.pichillilorenzo/flutter_inappwebview_credential_database'); + HttpAuthCredentialDatabase._(); + ///Gets the database shared instance. static HttpAuthCredentialDatabase instance() { return (_instance != null) ? _instance! : _init(); @@ -32,7 +34,7 @@ class HttpAuthCredentialDatabase { print(e.stackTrace); } }); - _instance = HttpAuthCredentialDatabase(); + _instance = HttpAuthCredentialDatabase._(); return _instance!; } diff --git a/lib/src/platform_util.dart b/lib/src/platform_util.dart index c93d9761..71250cb8 100644 --- a/lib/src/platform_util.dart +++ b/lib/src/platform_util.dart @@ -6,6 +6,8 @@ class PlatformUtil { static const MethodChannel _channel = const MethodChannel( 'com.pichillilorenzo/flutter_inappwebview_platformutil'); + PlatformUtil._(); + ///Get [PlatformUtil] instance. static PlatformUtil instance() { return (_instance != null) ? _instance! : _init(); @@ -20,7 +22,7 @@ class PlatformUtil { print(e.stackTrace); } }); - _instance = PlatformUtil(); + _instance = PlatformUtil._(); return _instance!; } diff --git a/lib/src/web_storage/web_storage_manager.dart b/lib/src/web_storage/web_storage_manager.dart index b6b2acfa..3174676a 100755 --- a/lib/src/web_storage/web_storage_manager.dart +++ b/lib/src/web_storage/web_storage_manager.dart @@ -22,6 +22,8 @@ class WebStorageManager { static WebStorageManager? _instance; static const MethodChannel _staticChannel = WEB_STORAGE_STATIC_CHANNEL; + WebStorageManager._(); + ///Use [WebStorageManager] instead. @Deprecated("Use WebStorageManager instead") AndroidWebStorageManager android = AndroidWebStorageManager(); @@ -44,7 +46,7 @@ class WebStorageManager { print(e.stackTrace); } }); - _instance = new WebStorageManager(); + _instance = new WebStorageManager._(); return _instance!; } diff --git a/macos/Classes/InAppBrowser/InAppBrowserSettings.swift b/macos/Classes/InAppBrowser/InAppBrowserSettings.swift index 6b18dee8..91acead9 100755 --- a/macos/Classes/InAppBrowser/InAppBrowserSettings.swift +++ b/macos/Classes/InAppBrowser/InAppBrowserSettings.swift @@ -26,7 +26,7 @@ public class InAppBrowserSettings: ISettings { if let inAppBrowserWebViewController = obj { realOptions["hidden"] = inAppBrowserWebViewController.isHidden realOptions["hideUrlBar"] = inAppBrowserWebViewController.window?.searchBar?.isHidden - realOptions["progressBar"] = inAppBrowserWebViewController.progressBar.isHidden + realOptions["hideProgressBar"] = inAppBrowserWebViewController.progressBar.isHidden realOptions["hideToolbarTop"] = !(inAppBrowserWebViewController.window?.toolbar?.isVisible ?? true) realOptions["toolbarTopBackgroundColor"] = inAppBrowserWebViewController.window?.backgroundColor.hexString }