From ab27a5575f0b40ae22774cd51fb2c581feb29fe5 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 26 May 2022 09:51:24 -0700 Subject: [PATCH 1/2] raise minimum dart version --- .../webview_flutter_wkwebview/CHANGELOG.md | 4 ++ .../src/foundation/foundation_api_impls.dart | 5 +-- .../lib/src/ui_kit/ui_kit_api_impls.dart | 11 ++--- .../lib/src/web_kit/web_kit.dart | 18 +++----- .../lib/src/web_kit/web_kit_api_impls.dart | 45 ++++++++----------- .../lib/src/web_kit_webview_widget.dart | 4 +- .../webview_flutter_wkwebview/pubspec.yaml | 4 +- 7 files changed, 37 insertions(+), 54 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index 00aa7293c9ad..5385113811b3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.8.0 + +* Raises minimum Dart version to 2.17. + ## 2.7.5 * Minor fixes for new analysis options. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart index e8f1c6723d8f..5e5e577a4f41 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart @@ -89,10 +89,9 @@ class FoundationFlutterApis { class NSObjectHostApiImpl extends NSObjectHostApi { /// Constructs an [NSObjectHostApiImpl]. NSObjectHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart index 328965295d56..1d962ee788db 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'dart:math'; import 'package:flutter/painting.dart' show Color; -import 'package:flutter/services.dart'; import '../common/instance_manager.dart'; import '../common/web_kit.pigeon.dart'; @@ -17,10 +16,9 @@ import 'ui_kit.dart'; class UIScrollViewHostApiImpl extends UIScrollViewHostApi { /// Constructs a [UIScrollViewHostApiImpl]. UIScrollViewHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; @@ -75,10 +73,9 @@ class UIScrollViewHostApiImpl extends UIScrollViewHostApi { class UIViewHostApiImpl extends UIViewHostApi { /// Constructs a [UIViewHostApiImpl]. UIViewHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart index 88f763fe6ba3..16490a24d474 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart @@ -600,13 +600,9 @@ class WKUIDelegate { class WKNavigationDelegate extends NSObject { /// Constructs a [WKNavigationDelegate]. WKNavigationDelegate({ - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) : _navigationDelegateApi = WKNavigationDelegateHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super( + super.binaryMessenger, + super.instanceManager, + }) : _navigationDelegateApi = WKNavigationDelegateHostApiImpl( binaryMessenger: binaryMessenger, instanceManager: instanceManager, ) { @@ -682,17 +678,13 @@ class WKWebView extends UIView { /// configuration object. WKWebView( WKWebViewConfiguration configuration, { - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, + super.binaryMessenger, + super.instanceManager, }) : _binaryMessenger = binaryMessenger, _instanceManager = instanceManager, _webViewApi = WKWebViewHostApiImpl( binaryMessenger: binaryMessenger, instanceManager: instanceManager, - ), - super( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, ) { _webViewApi.createForInstances(this, configuration); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart index f908256fd6ed..fe4d7d85d2d2 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart @@ -224,10 +224,9 @@ class WebKitFlutterApis { class WKWebsiteDataStoreHostApiImpl extends WKWebsiteDataStoreHostApi { /// Constructs a [WebsiteDataStoreHostApiImpl]. WKWebsiteDataStoreHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; @@ -269,10 +268,9 @@ class WKWebsiteDataStoreHostApiImpl extends WKWebsiteDataStoreHostApi { class WKScriptMessageHandlerHostApiImpl extends WKScriptMessageHandlerHostApi { /// Constructs a [WKScriptMessageHandlerHostApiImpl]. WKScriptMessageHandlerHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; @@ -287,10 +285,9 @@ class WKScriptMessageHandlerHostApiImpl extends WKScriptMessageHandlerHostApi { class WKPreferencesHostApiImpl extends WKPreferencesHostApi { /// Constructs a [WKPreferencesHostApiImpl]. WKPreferencesHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; @@ -322,10 +319,9 @@ class WKPreferencesHostApiImpl extends WKPreferencesHostApi { class WKHttpCookieStoreHostApiImpl extends WKHttpCookieStoreHostApi { /// Constructs a [WKHttpCookieStoreHostApiImpl]. WKHttpCookieStoreHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; @@ -358,10 +354,9 @@ class WKUserContentControllerHostApiImpl extends WKUserContentControllerHostApi { /// Constructs a [WKUserContentControllerHostApiImpl]. WKUserContentControllerHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; @@ -433,10 +428,9 @@ class WKUserContentControllerHostApiImpl class WKWebViewConfigurationHostApiImpl extends WKWebViewConfigurationHostApi { /// Constructs a [WKWebViewConfigurationHostApiImpl]. WKWebViewConfigurationHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; @@ -484,10 +478,9 @@ class WKWebViewConfigurationHostApiImpl extends WKWebViewConfigurationHostApi { class WKUIDelegateHostApiImpl extends WKUIDelegateHostApi { /// Constructs a [WKUIDelegateHostApiImpl]. WKUIDelegateHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; @@ -502,10 +495,9 @@ class WKUIDelegateHostApiImpl extends WKUIDelegateHostApi { class WKNavigationDelegateHostApiImpl extends WKNavigationDelegateHostApi { /// Constructs a [WKNavigationDelegateHostApiImpl]. WKNavigationDelegateHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; @@ -561,10 +553,9 @@ class WKNavigationDelegateFlutterApiImpl class WKWebViewHostApiImpl extends WKWebViewHostApi { /// Constructs a [WKWebViewHostApiImpl]. WKWebViewHostApiImpl({ - BinaryMessenger? binaryMessenger, + super.binaryMessenger, InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? InstanceManager.instance, - super(binaryMessenger: binaryMessenger); + }) : instanceManager = instanceManager ?? InstanceManager.instance; /// Maintains instances stored to communicate with Objective-C objects. final InstanceManager instanceManager; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit_webview_widget.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit_webview_widget.dart index 19051af6ae1a..7001c3131147 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit_webview_widget.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit_webview_widget.dart @@ -18,14 +18,14 @@ import 'web_kit/web_kit.dart'; class WebKitWebViewWidget extends StatefulWidget { /// Constructs a [WebKitWebViewWidget]. const WebKitWebViewWidget({ - Key? key, + super.key, required this.creationParams, required this.callbacksHandler, required this.javascriptChannelRegistry, required this.onBuildWidget, this.configuration, @visibleForTesting this.webViewProxy = const WebViewWidgetProxy(), - }) : super(key: key); + }); /// The initial parameters used to setup the WebView. final CreationParams creationParams; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 9ce70bc7fdca..9c62aef10e6d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -2,10 +2,10 @@ name: webview_flutter_wkwebview description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control. repository: https://github.com/flutter/plugins/tree/main/packages/webview_flutter/webview_flutter_wkwebview issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 2.7.5 +version: 2.8.0 environment: - sdk: ">=2.14.0 <3.0.0" + sdk: ">=2.17.0 <3.0.0" flutter: ">=2.8.0" flutter: From 1179182074f52f61fcbbad037a4be7d6a741149f Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 26 May 2022 09:54:32 -0700 Subject: [PATCH 2/2] flutter version bump --- packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md | 2 +- packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index 5385113811b3..64a2b0974faf 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.8.0 -* Raises minimum Dart version to 2.17. +* Raises minimum Dart version to 2.17 and Flutter version to 3.0.0. ## 2.7.5 diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 9c62aef10e6d..5a8be07cbb91 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -6,7 +6,7 @@ version: 2.8.0 environment: sdk: ">=2.17.0 <3.0.0" - flutter: ">=2.8.0" + flutter: ">=3.0.0" flutter: plugin: