Removed unnamed constructors for all Singleton classes to avoid incorrect usage
This commit is contained in:
parent
652ee52c75
commit
486b3207a0
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -44,6 +44,16 @@
|
||||||
- Removed `URLProtectionSpace.iosIsProxy` property
|
- Removed `URLProtectionSpace.iosIsProxy` property
|
||||||
- `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null`
|
- `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null`
|
||||||
|
|
||||||
|
## 5.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
|
## 5.5.0+2
|
||||||
|
|
||||||
- Fixed README
|
- Fixed README
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class InAppBrowserSettings: ISettings<InAppBrowserWebViewController> {
|
||||||
if let inAppBrowserWebViewController = obj {
|
if let inAppBrowserWebViewController = obj {
|
||||||
realOptions["hidden"] = inAppBrowserWebViewController.isHidden
|
realOptions["hidden"] = inAppBrowserWebViewController.isHidden
|
||||||
realOptions["hideUrlBar"] = inAppBrowserWebViewController.searchBar.isHidden
|
realOptions["hideUrlBar"] = inAppBrowserWebViewController.searchBar.isHidden
|
||||||
realOptions["progressBar"] = inAppBrowserWebViewController.progressBar.isHidden
|
realOptions["hideProgressBar"] = inAppBrowserWebViewController.progressBar.isHidden
|
||||||
realOptions["closeButtonCaption"] = inAppBrowserWebViewController.closeButton.title
|
realOptions["closeButtonCaption"] = inAppBrowserWebViewController.closeButton.title
|
||||||
realOptions["closeButtonColor"] = inAppBrowserWebViewController.closeButton.tintColor?.hexString
|
realOptions["closeButtonColor"] = inAppBrowserWebViewController.closeButton.tintColor?.hexString
|
||||||
if let navController = inAppBrowserWebViewController.navigationController {
|
if let navController = inAppBrowserWebViewController.navigationController {
|
||||||
|
|
|
@ -19,6 +19,8 @@ class ProxyController {
|
||||||
static const MethodChannel _channel = const MethodChannel(
|
static const MethodChannel _channel = const MethodChannel(
|
||||||
'com.pichillilorenzo/flutter_inappwebview_proxycontroller');
|
'com.pichillilorenzo/flutter_inappwebview_proxycontroller');
|
||||||
|
|
||||||
|
ProxyController._();
|
||||||
|
|
||||||
///Gets the [ProxyController] shared instance.
|
///Gets the [ProxyController] shared instance.
|
||||||
///
|
///
|
||||||
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.PROXY_OVERRIDE].
|
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.PROXY_OVERRIDE].
|
||||||
|
@ -35,7 +37,7 @@ class ProxyController {
|
||||||
print(e.stackTrace);
|
print(e.stackTrace);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_instance = ProxyController();
|
_instance = ProxyController._();
|
||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ class ServiceWorkerController {
|
||||||
static const MethodChannel _channel = const MethodChannel(
|
static const MethodChannel _channel = const MethodChannel(
|
||||||
'com.pichillilorenzo/flutter_inappwebview_serviceworkercontroller');
|
'com.pichillilorenzo/flutter_inappwebview_serviceworkercontroller');
|
||||||
|
|
||||||
|
ServiceWorkerController._();
|
||||||
|
|
||||||
///Gets the [ServiceWorkerController] shared instance.
|
///Gets the [ServiceWorkerController] shared instance.
|
||||||
///
|
///
|
||||||
///This method should only be called if [WebViewFeature.isFeatureSupported] returns `true` for [WebViewFeature.SERVICE_WORKER_BASIC_USAGE].
|
///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);
|
print(e.stackTrace);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_instance = ServiceWorkerController();
|
_instance = ServiceWorkerController._();
|
||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ class CookieManager {
|
||||||
static const MethodChannel _channel = const MethodChannel(
|
static const MethodChannel _channel = const MethodChannel(
|
||||||
'com.pichillilorenzo/flutter_inappwebview_cookiemanager');
|
'com.pichillilorenzo/flutter_inappwebview_cookiemanager');
|
||||||
|
|
||||||
|
CookieManager._();
|
||||||
|
|
||||||
///Use [CookieManager] instead.
|
///Use [CookieManager] instead.
|
||||||
@Deprecated("Use CookieManager instead")
|
@Deprecated("Use CookieManager instead")
|
||||||
late IOSCookieManager ios;
|
late IOSCookieManager ios;
|
||||||
|
@ -45,7 +47,7 @@ class CookieManager {
|
||||||
print(e.stackTrace);
|
print(e.stackTrace);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_instance = CookieManager();
|
_instance = CookieManager._();
|
||||||
// ignore: deprecated_member_use_from_same_package
|
// ignore: deprecated_member_use_from_same_package
|
||||||
_instance!.ios = IOSCookieManager.instance();
|
_instance!.ios = IOSCookieManager.instance();
|
||||||
return _instance!;
|
return _instance!;
|
||||||
|
@ -542,8 +544,10 @@ class IOSCookieManager {
|
||||||
return (_instance != null) ? _instance! : _init();
|
return (_instance != null) ? _instance! : _init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IOSCookieManager._();
|
||||||
|
|
||||||
static IOSCookieManager _init() {
|
static IOSCookieManager _init() {
|
||||||
_instance = IOSCookieManager();
|
_instance = IOSCookieManager._();
|
||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@ class HttpAuthCredentialDatabase {
|
||||||
static const MethodChannel _channel = const MethodChannel(
|
static const MethodChannel _channel = const MethodChannel(
|
||||||
'com.pichillilorenzo/flutter_inappwebview_credential_database');
|
'com.pichillilorenzo/flutter_inappwebview_credential_database');
|
||||||
|
|
||||||
|
HttpAuthCredentialDatabase._();
|
||||||
|
|
||||||
///Gets the database shared instance.
|
///Gets the database shared instance.
|
||||||
static HttpAuthCredentialDatabase instance() {
|
static HttpAuthCredentialDatabase instance() {
|
||||||
return (_instance != null) ? _instance! : _init();
|
return (_instance != null) ? _instance! : _init();
|
||||||
|
@ -32,7 +34,7 @@ class HttpAuthCredentialDatabase {
|
||||||
print(e.stackTrace);
|
print(e.stackTrace);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_instance = HttpAuthCredentialDatabase();
|
_instance = HttpAuthCredentialDatabase._();
|
||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ class PlatformUtil {
|
||||||
static const MethodChannel _channel = const MethodChannel(
|
static const MethodChannel _channel = const MethodChannel(
|
||||||
'com.pichillilorenzo/flutter_inappwebview_platformutil');
|
'com.pichillilorenzo/flutter_inappwebview_platformutil');
|
||||||
|
|
||||||
|
PlatformUtil._();
|
||||||
|
|
||||||
///Get [PlatformUtil] instance.
|
///Get [PlatformUtil] instance.
|
||||||
static PlatformUtil instance() {
|
static PlatformUtil instance() {
|
||||||
return (_instance != null) ? _instance! : _init();
|
return (_instance != null) ? _instance! : _init();
|
||||||
|
@ -20,7 +22,7 @@ class PlatformUtil {
|
||||||
print(e.stackTrace);
|
print(e.stackTrace);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_instance = PlatformUtil();
|
_instance = PlatformUtil._();
|
||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@ class WebStorageManager {
|
||||||
static WebStorageManager? _instance;
|
static WebStorageManager? _instance;
|
||||||
static const MethodChannel _staticChannel = WEB_STORAGE_STATIC_CHANNEL;
|
static const MethodChannel _staticChannel = WEB_STORAGE_STATIC_CHANNEL;
|
||||||
|
|
||||||
|
WebStorageManager._();
|
||||||
|
|
||||||
///Use [WebStorageManager] instead.
|
///Use [WebStorageManager] instead.
|
||||||
@Deprecated("Use WebStorageManager instead")
|
@Deprecated("Use WebStorageManager instead")
|
||||||
AndroidWebStorageManager android = AndroidWebStorageManager();
|
AndroidWebStorageManager android = AndroidWebStorageManager();
|
||||||
|
@ -44,7 +46,7 @@ class WebStorageManager {
|
||||||
print(e.stackTrace);
|
print(e.stackTrace);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_instance = new WebStorageManager();
|
_instance = new WebStorageManager._();
|
||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class InAppBrowserSettings: ISettings<InAppBrowserWebViewController> {
|
||||||
if let inAppBrowserWebViewController = obj {
|
if let inAppBrowserWebViewController = obj {
|
||||||
realOptions["hidden"] = inAppBrowserWebViewController.isHidden
|
realOptions["hidden"] = inAppBrowserWebViewController.isHidden
|
||||||
realOptions["hideUrlBar"] = inAppBrowserWebViewController.window?.searchBar?.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["hideToolbarTop"] = !(inAppBrowserWebViewController.window?.toolbar?.isVisible ?? true)
|
||||||
realOptions["toolbarTopBackgroundColor"] = inAppBrowserWebViewController.window?.backgroundColor.hexString
|
realOptions["toolbarTopBackgroundColor"] = inAppBrowserWebViewController.window?.backgroundColor.hexString
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue