From beb75396ff5b5cc5a97c46384c6bd4dea4503cf8 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 4 Feb 2025 13:39:09 -0500 Subject: [PATCH 01/10] fix maybe --- .../webview_flutter_wkwebview/CHANGELOG.md | 5 + .../WebKitLibrary.g.swift | 50 +---- .../lib/src/common/web_kit.g.dart | 128 +++---------- .../src/legacy/web_kit_webview_widget.dart | 10 +- .../lib/src/webkit_proxy.dart | 20 +- .../pigeons/web_kit.dart | 20 +- .../webview_flutter_wkwebview/pubspec.yaml | 2 +- .../test/webkit_navigation_delegate_test.dart | 171 ++++++++++++++++-- .../test/webkit_webview_controller_test.dart | 57 ++++-- 9 files changed, 265 insertions(+), 198 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index e0cba649e15..bfc6b9667ee 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.18.1 + +* Updates internal API wrapper to make all Flutter methods with a non-null return value be required + to implement. + ## 3.18.0 * Updates internal API wrapper to use ProxyApis. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift index c2f66df0a4b..c25a4685e75 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift @@ -4025,28 +4025,9 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate completion(.success(Void())) return } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) - } - } + print( + "Error: Attempting to create a new Dart instance of WKNavigationDelegate, but the class has a nonnull callback method." + ) } /// Tells the delegate that navigation is complete. func didFinishNavigation( @@ -5978,28 +5959,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { completion(.success(Void())) return } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) - } - } + print( + "Error: Attempting to create a new Dart instance of WKUIDelegate, but the class has a nonnull callback method." + ) } /// Creates a new web view. func onCreateWebView( diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart index 78a7a5d9300..a24ce02197c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart @@ -3963,12 +3963,12 @@ class WKNavigationDelegate extends NSObject { super.observeValue, this.didFinishNavigation, this.didStartProvisionalNavigation, - this.decidePolicyForNavigationAction, - this.decidePolicyForNavigationResponse, + required this.decidePolicyForNavigationAction, + required this.decidePolicyForNavigationResponse, this.didFailNavigation, this.didFailProvisionalNavigation, this.webViewWebContentProcessDidTerminate, - this.didReceiveAuthenticationChallenge, + required this.didReceiveAuthenticationChallenge, }) : super.pigeon_detached() { final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); @@ -4011,12 +4011,12 @@ class WKNavigationDelegate extends NSObject { super.observeValue, this.didFinishNavigation, this.didStartProvisionalNavigation, - this.decidePolicyForNavigationAction, - this.decidePolicyForNavigationResponse, + required this.decidePolicyForNavigationAction, + required this.decidePolicyForNavigationResponse, this.didFailNavigation, this.didFailProvisionalNavigation, this.webViewWebContentProcessDidTerminate, - this.didReceiveAuthenticationChallenge, + required this.didReceiveAuthenticationChallenge, }) : super.pigeon_detached(); late final _PigeonInternalProxyApiBaseCodec @@ -4097,7 +4097,7 @@ class WKNavigationDelegate extends NSObject { WKNavigationDelegate pigeon_instance, WKWebView webView, WKNavigationAction navigationAction, - )? decidePolicyForNavigationAction; + ) decidePolicyForNavigationAction; /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. @@ -4123,7 +4123,7 @@ class WKNavigationDelegate extends NSObject { WKNavigationDelegate pigeon_instance, WKWebView webView, WKNavigationResponse navigationResponse, - )? decidePolicyForNavigationResponse; + ) decidePolicyForNavigationResponse; /// Tells the delegate that an error occurred during navigation. /// @@ -4223,13 +4223,12 @@ class WKNavigationDelegate extends NSObject { WKNavigationDelegate pigeon_instance, WKWebView webView, URLAuthenticationChallenge challenge, - )? didReceiveAuthenticationChallenge; + ) didReceiveAuthenticationChallenge; static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, PigeonInstanceManager? pigeon_instanceManager, - WKNavigationDelegate Function()? pigeon_newInstance, void Function( WKNavigationDelegate pigeon_instance, WKWebView webView, @@ -4274,44 +4273,6 @@ class WKNavigationDelegate extends NSObject { _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; - { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_newInstance', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (pigeon_clearHandlers) { - pigeonVar_channel.setMessageHandler(null); - } else { - pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_newInstance was null.'); - final List args = (message as List?)!; - final int? arg_pigeon_instanceIdentifier = (args[0] as int?); - assert(arg_pigeon_instanceIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_newInstance was null, expected non-null int.'); - try { - (pigeon_instanceManager ?? PigeonInstanceManager.instance) - .addHostCreatedInstance( - pigeon_newInstance?.call() ?? - WKNavigationDelegate.pigeon_detached( - pigeon_binaryMessenger: pigeon_binaryMessenger, - pigeon_instanceManager: pigeon_instanceManager, - ), - arg_pigeon_instanceIdentifier!, - ); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< @@ -4411,10 +4372,10 @@ class WKNavigationDelegate extends NSObject { assert(arg_navigationAction != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction was null, expected non-null WKNavigationAction.'); try { - final NavigationActionPolicy? output = + final NavigationActionPolicy output = await (decidePolicyForNavigationAction ?? arg_pigeon_instance!.decidePolicyForNavigationAction) - ?.call(arg_pigeon_instance!, arg_webView!, + .call(arg_pigeon_instance!, arg_webView!, arg_navigationAction!); return wrapResponse(result: output); } on PlatformException catch (e) { @@ -4453,10 +4414,10 @@ class WKNavigationDelegate extends NSObject { assert(arg_navigationResponse != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse was null, expected non-null WKNavigationResponse.'); try { - final NavigationResponsePolicy? output = + final NavigationResponsePolicy output = await (decidePolicyForNavigationResponse ?? arg_pigeon_instance!.decidePolicyForNavigationResponse) - ?.call(arg_pigeon_instance!, arg_webView!, + .call(arg_pigeon_instance!, arg_webView!, arg_navigationResponse!); return wrapResponse(result: output); } on PlatformException catch (e) { @@ -4608,10 +4569,10 @@ class WKNavigationDelegate extends NSObject { assert(arg_challenge != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge was null, expected non-null URLAuthenticationChallenge.'); try { - final AuthenticationChallengeResponse? output = + final AuthenticationChallengeResponse output = await (didReceiveAuthenticationChallenge ?? arg_pigeon_instance!.didReceiveAuthenticationChallenge) - ?.call(arg_pigeon_instance!, arg_webView!, arg_challenge!); + .call(arg_pigeon_instance!, arg_webView!, arg_challenge!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -6447,9 +6408,9 @@ class WKUIDelegate extends NSObject { super.pigeon_instanceManager, super.observeValue, this.onCreateWebView, - this.requestMediaCapturePermission, + required this.requestMediaCapturePermission, this.runJavaScriptAlertPanel, - this.runJavaScriptConfirmPanel, + required this.runJavaScriptConfirmPanel, this.runJavaScriptTextInputPanel, }) : super.pigeon_detached() { final int pigeonVar_instanceIdentifier = @@ -6492,9 +6453,9 @@ class WKUIDelegate extends NSObject { super.pigeon_instanceManager, super.observeValue, this.onCreateWebView, - this.requestMediaCapturePermission, + required this.requestMediaCapturePermission, this.runJavaScriptAlertPanel, - this.runJavaScriptConfirmPanel, + required this.runJavaScriptConfirmPanel, this.runJavaScriptTextInputPanel, }) : super.pigeon_detached(); @@ -6553,7 +6514,7 @@ class WKUIDelegate extends NSObject { WKSecurityOrigin origin, WKFrameInfo frame, MediaCaptureType type, - )? requestMediaCapturePermission; + ) requestMediaCapturePermission; /// Displays a JavaScript alert panel. /// @@ -6605,7 +6566,7 @@ class WKUIDelegate extends NSObject { WKWebView webView, String message, WKFrameInfo frame, - )? runJavaScriptConfirmPanel; + ) runJavaScriptConfirmPanel; /// Displays a JavaScript text input panel. /// @@ -6638,7 +6599,6 @@ class WKUIDelegate extends NSObject { bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, PigeonInstanceManager? pigeon_instanceManager, - WKUIDelegate Function()? pigeon_newInstance, void Function( WKUIDelegate pigeon_instance, WKWebView webView, @@ -6676,44 +6636,6 @@ class WKUIDelegate extends NSObject { _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; - { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_newInstance', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (pigeon_clearHandlers) { - pigeonVar_channel.setMessageHandler(null); - } else { - pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_newInstance was null.'); - final List args = (message as List?)!; - final int? arg_pigeon_instanceIdentifier = (args[0] as int?); - assert(arg_pigeon_instanceIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_newInstance was null, expected non-null int.'); - try { - (pigeon_instanceManager ?? PigeonInstanceManager.instance) - .addHostCreatedInstance( - pigeon_newInstance?.call() ?? - WKUIDelegate.pigeon_detached( - pigeon_binaryMessenger: pigeon_binaryMessenger, - pigeon_instanceManager: pigeon_instanceManager, - ), - arg_pigeon_instanceIdentifier!, - ); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< @@ -6789,10 +6711,10 @@ class WKUIDelegate extends NSObject { assert(arg_type != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission was null, expected non-null MediaCaptureType.'); try { - final PermissionDecision? output = + final PermissionDecision output = await (requestMediaCapturePermission ?? arg_pigeon_instance!.requestMediaCapturePermission) - ?.call(arg_pigeon_instance!, arg_webView!, arg_origin!, + .call(arg_pigeon_instance!, arg_webView!, arg_origin!, arg_frame!, arg_type!); return wrapResponse(result: output); } on PlatformException catch (e) { @@ -6874,9 +6796,9 @@ class WKUIDelegate extends NSObject { assert(arg_frame != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel was null, expected non-null WKFrameInfo.'); try { - final bool? output = await (runJavaScriptConfirmPanel ?? + final bool output = await (runJavaScriptConfirmPanel ?? arg_pigeon_instance!.runJavaScriptConfirmPanel) - ?.call(arg_pigeon_instance!, arg_webView!, arg_message!, + .call(arg_pigeon_instance!, arg_webView!, arg_message!, arg_frame!); return wrapResponse(result: output); } on PlatformException catch (e) { diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart index d347ce077bc..50d6063ef0b 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart @@ -699,7 +699,15 @@ class WebViewWidgetProxy { WKNavigationAction navigationAction, )? onCreateWebView, }) { - return WKUIDelegate(onCreateWebView: onCreateWebView); + return WKUIDelegate( + onCreateWebView: onCreateWebView, + requestMediaCapturePermission: (_, __, ___, ____, _____) async { + return PermissionDecision.deny; + }, + runJavaScriptConfirmPanel: (_, __, ___, ____) async { + return false; + }, + ); } /// Constructs a [WKNavigationDelegate]. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart index 5c3638bd04c..d60dedf3aa0 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart @@ -78,16 +78,16 @@ class WebKitProxy { WKWebView, String?, )? didStartProvisionalNavigation, - Future Function( + required Future Function( WKNavigationDelegate, WKWebView, WKNavigationAction, - )? decidePolicyForNavigationAction, - Future Function( + ) decidePolicyForNavigationAction, + required Future Function( WKNavigationDelegate, WKWebView, WKNavigationResponse, - )? decidePolicyForNavigationResponse, + ) decidePolicyForNavigationResponse, void Function( WKNavigationDelegate, WKWebView, @@ -102,11 +102,11 @@ class WebKitProxy { WKNavigationDelegate, WKWebView, )? webViewWebContentProcessDidTerminate, - Future Function( + required Future Function( WKNavigationDelegate, WKWebView, URLAuthenticationChallenge, - )? didReceiveAuthenticationChallenge, + ) didReceiveAuthenticationChallenge, }) newWKNavigationDelegate; /// Constructs [NSObject]. @@ -137,25 +137,25 @@ class WebKitProxy { WKWebViewConfiguration, WKNavigationAction, )? onCreateWebView, - Future Function( + required Future Function( WKUIDelegate, WKWebView, WKSecurityOrigin, WKFrameInfo, MediaCaptureType, - )? requestMediaCapturePermission, + ) requestMediaCapturePermission, Future Function( WKUIDelegate, WKWebView, String, WKFrameInfo, )? runJavaScriptAlertPanel, - Future Function( + required Future Function( WKUIDelegate, WKWebView, String, WKFrameInfo, - )? runJavaScriptConfirmPanel, + ) runJavaScriptConfirmPanel, Future Function( WKUIDelegate, WKWebView, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart index b1240625837..af42f99de00 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart @@ -719,18 +719,18 @@ abstract class WKNavigationDelegate extends NSObject { /// Asks the delegate for permission to navigate to new content based on the /// specified action information. @async - NavigationActionPolicy Function( + late NavigationActionPolicy Function( WKWebView webView, WKNavigationAction navigationAction, - )? decidePolicyForNavigationAction; + ) decidePolicyForNavigationAction; /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. @async - NavigationResponsePolicy Function( + late NavigationResponsePolicy Function( WKWebView webView, WKNavigationResponse navigationResponse, - )? decidePolicyForNavigationResponse; + ) decidePolicyForNavigationResponse; /// Tells the delegate that an error occurred during navigation. void Function(WKWebView webView, NSError error)? didFailNavigation; @@ -744,10 +744,10 @@ abstract class WKNavigationDelegate extends NSObject { /// Asks the delegate to respond to an authentication challenge. @async - AuthenticationChallengeResponse Function( + late AuthenticationChallengeResponse Function( WKWebView webView, URLAuthenticationChallenge challenge, - )? didReceiveAuthenticationChallenge; + ) didReceiveAuthenticationChallenge; } /// The root class of most Objective-C class hierarchies, from which subclasses @@ -981,12 +981,12 @@ abstract class WKUIDelegate extends NSObject { /// Determines whether a web resource, which the security origin object /// describes, can access to the device’s microphone audio and camera video. @async - PermissionDecision Function( + late PermissionDecision Function( WKWebView webView, WKSecurityOrigin origin, WKFrameInfo frame, MediaCaptureType type, - )? requestMediaCapturePermission; + ) requestMediaCapturePermission; /// Displays a JavaScript alert panel. @async @@ -998,11 +998,11 @@ abstract class WKUIDelegate extends NSObject { /// Displays a JavaScript confirm panel. @async - bool Function( + late bool Function( WKWebView webView, String message, WKFrameInfo frame, - )? runJavaScriptConfirmPanel; + ) runJavaScriptConfirmPanel; /// Displays a JavaScript text input panel. @async diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index efb1fb149d8..b952f921532 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_wkwebview description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control. repository: https://github.com/flutter/packages/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: 3.18.0 +version: 3.18.1 environment: sdk: ^3.5.0 diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart index 05cf5dd7883..f19e2d23f2f 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart @@ -47,6 +47,19 @@ void main() { CapturingNavigationDelegate.lastCreatedDelegate.didFinishNavigation!( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -73,6 +86,19 @@ void main() { .lastCreatedDelegate.didStartProvisionalNavigation!( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -99,10 +125,23 @@ void main() { await webKitDelegate.setOnHttpError(onHttpError); - await CapturingNavigationDelegate - .lastCreatedDelegate.decidePolicyForNavigationResponse!( + await CapturingNavigationDelegate.lastCreatedDelegate + .decidePolicyForNavigationResponse( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -136,10 +175,23 @@ void main() { await webKitDelegate.setOnHttpError(onHttpError); - await CapturingNavigationDelegate - .lastCreatedDelegate.decidePolicyForNavigationResponse!( + await CapturingNavigationDelegate.lastCreatedDelegate + .decidePolicyForNavigationResponse( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -176,6 +228,19 @@ void main() { CapturingNavigationDelegate.lastCreatedDelegate.didFailNavigation!( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -219,6 +284,19 @@ void main() { .lastCreatedDelegate.didFailProvisionalNavigation!( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -263,6 +341,19 @@ void main() { .lastCreatedDelegate.webViewWebContentProcessDidTerminate!( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -304,10 +395,23 @@ void main() { ); expect( - await CapturingNavigationDelegate - .lastCreatedDelegate.decidePolicyForNavigationAction!( + await CapturingNavigationDelegate.lastCreatedDelegate + .decidePolicyForNavigationAction( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -381,10 +485,23 @@ void main() { }, ); - await CapturingNavigationDelegate - .lastCreatedDelegate.didReceiveAuthenticationChallenge!( + await CapturingNavigationDelegate.lastCreatedDelegate + .didReceiveAuthenticationChallenge( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -446,10 +563,23 @@ void main() { }, ); - await CapturingNavigationDelegate - .lastCreatedDelegate.didReceiveAuthenticationChallenge!( + await CapturingNavigationDelegate.lastCreatedDelegate + .didReceiveAuthenticationChallenge( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), WKWebView.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), @@ -468,17 +598,30 @@ class CapturingNavigationDelegate extends WKNavigationDelegate { CapturingNavigationDelegate({ super.didFinishNavigation, super.didStartProvisionalNavigation, - super.decidePolicyForNavigationResponse, + required super.decidePolicyForNavigationResponse, super.didFailNavigation, super.didFailProvisionalNavigation, - super.decidePolicyForNavigationAction, + required super.decidePolicyForNavigationAction, super.webViewWebContentProcessDidTerminate, - super.didReceiveAuthenticationChallenge, + required super.didReceiveAuthenticationChallenge, }) : super.pigeon_detached(pigeon_instanceManager: TestInstanceManager()) { lastCreatedDelegate = this; } static CapturingNavigationDelegate lastCreatedDelegate = - CapturingNavigationDelegate(); + CapturingNavigationDelegate( + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, + ); } // Test InstanceManager that sets `onWeakReferenceRemoved` as a noop. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart index c488d7e8b56..647454d1aa3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart @@ -92,25 +92,25 @@ void main() { WKWebViewConfiguration, WKNavigationAction, )? onCreateWebView, - Future Function( + required Future Function( WKUIDelegate, WKWebView, WKSecurityOrigin, WKFrameInfo, MediaCaptureType, - )? requestMediaCapturePermission, + ) requestMediaCapturePermission, Future Function( WKUIDelegate, WKWebView, String, WKFrameInfo, )? runJavaScriptAlertPanel, - Future Function( + required Future Function( WKUIDelegate, WKWebView, String, WKFrameInfo, - )? runJavaScriptConfirmPanel, + ) runJavaScriptConfirmPanel, Future Function( WKUIDelegate, WKWebView, @@ -1146,7 +1146,14 @@ void main() { test('Requests to open a new window loads request in same window', () { // Reset last created delegate. - CapturingUIDelegate.lastCreatedDelegate = CapturingUIDelegate(); + CapturingUIDelegate.lastCreatedDelegate = CapturingUIDelegate( + requestMediaCapturePermission: (_, __, ___, ____, _____) async { + return PermissionDecision.deny; + }, + runJavaScriptConfirmPanel: (_, __, ___, ____) async { + return false; + }, + ); // Create a new WebKitWebViewController that sets // CapturingUIDelegate.lastCreatedDelegate. @@ -1383,8 +1390,8 @@ void main() { WKSecurityOrigin origin, WKFrameInfo frame, MediaCaptureType type, - ) onPermissionRequestCallback = CapturingUIDelegate - .lastCreatedDelegate.requestMediaCapturePermission!; + ) onPermissionRequestCallback = + CapturingUIDelegate.lastCreatedDelegate.requestMediaCapturePermission; final PermissionDecision decision = await onPermissionRequestCallback( CapturingUIDelegate.lastCreatedDelegate, @@ -1464,7 +1471,7 @@ void main() { String message, WKFrameInfo frame, ) onJavaScriptConfirmPanel = - CapturingUIDelegate.lastCreatedDelegate.runJavaScriptConfirmPanel!; + CapturingUIDelegate.lastCreatedDelegate.runJavaScriptConfirmPanel; final MockURLRequest mockRequest = MockURLRequest(); when(mockRequest.getUrl()).thenAnswer( @@ -1835,31 +1842,51 @@ class CapturingNavigationDelegate extends WKNavigationDelegate { CapturingNavigationDelegate({ super.didFinishNavigation, super.didStartProvisionalNavigation, - super.decidePolicyForNavigationResponse, + required super.decidePolicyForNavigationResponse, super.didFailNavigation, super.didFailProvisionalNavigation, - super.decidePolicyForNavigationAction, + required super.decidePolicyForNavigationAction, super.webViewWebContentProcessDidTerminate, - super.didReceiveAuthenticationChallenge, + required super.didReceiveAuthenticationChallenge, }) : super.pigeon_detached(pigeon_instanceManager: TestInstanceManager()) { lastCreatedDelegate = this; } static CapturingNavigationDelegate lastCreatedDelegate = - CapturingNavigationDelegate(); + CapturingNavigationDelegate( + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, + ); } // Records the last created instance of itself. class CapturingUIDelegate extends WKUIDelegate { CapturingUIDelegate({ super.onCreateWebView, - super.requestMediaCapturePermission, + required super.requestMediaCapturePermission, super.runJavaScriptAlertPanel, - super.runJavaScriptConfirmPanel, + required super.runJavaScriptConfirmPanel, super.runJavaScriptTextInputPanel, }) : super.pigeon_detached(pigeon_instanceManager: TestInstanceManager()) { lastCreatedDelegate = this; } - static CapturingUIDelegate lastCreatedDelegate = CapturingUIDelegate(); + static CapturingUIDelegate lastCreatedDelegate = CapturingUIDelegate( + requestMediaCapturePermission: (_, __, ___, ____, _____) async { + return PermissionDecision.deny; + }, + runJavaScriptConfirmPanel: (_, __, ___, ____) async { + return false; + }, + ); } class CapturingUIScrollViewDelegate extends UIScrollViewDelegate { From cf27f9d54849135f6e4e153e62f1acdc4b062b2a Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 4 Feb 2025 13:40:42 -0500 Subject: [PATCH 02/10] bump pigeon --- .../Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift | 6 +++--- .../webview_flutter_wkwebview/lib/src/common/web_kit.g.dart | 2 +- .../webview_flutter/webview_flutter_wkwebview/pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift index c25a4685e75..b079f77ea4e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v22.7.2), do not edit directly. +// Autogenerated from Pigeon (v24.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -23,9 +23,9 @@ import WebKit final class PigeonError: Error { let code: String let message: String? - let details: Any? + let details: Sendable? - init(code: String, message: String?, details: Any?) { + init(code: String, message: String?, details: Sendable?) { self.code = code self.message = message self.details = details diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart index a24ce02197c..a48b032b6e6 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v22.7.2), do not edit directly. +// Autogenerated from Pigeon (v24.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index b952f921532..6241b8ad90d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -32,7 +32,7 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^22.7.2 + pigeon: ^24.0.0 topics: - html From 9442ba777c8108d6caa3fcae636577e055571ed0 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:16:52 -0500 Subject: [PATCH 03/10] update pigeon --- .../WebKitLibrary.g.swift | 1604 ++++++++--------- .../lib/src/common/web_kit.g.dart | 2 +- .../webview_flutter_wkwebview/pubspec.yaml | 2 +- 3 files changed, 782 insertions(+), 826 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift index b079f77ea4e..eba69cf768c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v24.0.0), do not edit directly. +// Autogenerated from Pigeon (v24.1.1), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -365,7 +365,7 @@ private class WebKitLibraryPigeonInstanceManagerApi { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -632,6 +632,9 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand let identifier = self.readValue() let instance: AnyObject? = pigeonRegistrar.instanceManager.instance( forIdentifier: identifier is Int64 ? identifier as! Int64 : Int64(identifier as! Int32)) + if instance == nil { + print("Failed to find instance with identifier: \(identifier!)") + } return instance default: return super.readValue(ofType: type) @@ -1683,32 +1686,30 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -1747,34 +1748,32 @@ final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let statusCodeArg = try! pigeonDelegate.statusCode( - pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPURLResponse.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg, statusCodeArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let statusCodeArg = try! pigeonDelegate.statusCode( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPURLResponse.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg, statusCodeArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -1809,32 +1808,30 @@ final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.URLResponse.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.URLResponse.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -1919,39 +1916,37 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let sourceArg = try! pigeonDelegate.source(pigeonApi: self, pigeonInstance: pigeonInstance) - let injectionTimeArg = try! pigeonDelegate.injectionTime( - pigeonApi: self, pigeonInstance: pigeonInstance) - let isForMainFrameOnlyArg = try! pigeonDelegate.isForMainFrameOnly( - pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage( - [pigeonIdentifierArg, sourceArg, injectionTimeArg, isForMainFrameOnlyArg] as [Any?] - ) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let sourceArg = try! pigeonDelegate.source(pigeonApi: self, pigeonInstance: pigeonInstance) + let injectionTimeArg = try! pigeonDelegate.injectionTime( + pigeonApi: self, pigeonInstance: pigeonInstance) + let isForMainFrameOnlyArg = try! pigeonDelegate.isForMainFrameOnly( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonIdentifierArg, sourceArg, injectionTimeArg, isForMainFrameOnlyArg] as [Any?] + ) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -1998,39 +1993,37 @@ final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let requestArg = try! pigeonDelegate.request(pigeonApi: self, pigeonInstance: pigeonInstance) - let targetFrameArg = try! pigeonDelegate.targetFrame( - pigeonApi: self, pigeonInstance: pigeonInstance) - let navigationTypeArg = try! pigeonDelegate.navigationType( - pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationAction.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage( - [pigeonIdentifierArg, requestArg, targetFrameArg, navigationTypeArg] as [Any?] - ) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let requestArg = try! pigeonDelegate.request(pigeonApi: self, pigeonInstance: pigeonInstance) + let targetFrameArg = try! pigeonDelegate.targetFrame( + pigeonApi: self, pigeonInstance: pigeonInstance) + let navigationTypeArg = try! pigeonDelegate.navigationType( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationAction.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonIdentifierArg, requestArg, targetFrameArg, navigationTypeArg] as [Any?] + ) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -2074,36 +2067,35 @@ final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let responseArg = try! pigeonDelegate.response(pigeonApi: self, pigeonInstance: pigeonInstance) - let isForMainFrameArg = try! pigeonDelegate.isForMainFrame( - pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationResponse.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg, responseArg, isForMainFrameArg] as [Any?]) { - response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let responseArg = try! pigeonDelegate.response( + pigeonApi: self, pigeonInstance: pigeonInstance) + let isForMainFrameArg = try! pigeonDelegate.isForMainFrame( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationResponse.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg, responseArg, isForMainFrameArg] as [Any?]) { + response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -2144,36 +2136,34 @@ final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let isMainFrameArg = try! pigeonDelegate.isMainFrame( - pigeonApi: self, pigeonInstance: pigeonInstance) - let requestArg = try! pigeonDelegate.request(pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKFrameInfo.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg, isMainFrameArg, requestArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) - } + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let isMainFrameArg = try! pigeonDelegate.isMainFrame( + pigeonApi: self, pigeonInstance: pigeonInstance) + let requestArg = try! pigeonDelegate.request(pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKFrameInfo.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg, isMainFrameArg, requestArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } } } } @@ -2211,36 +2201,35 @@ final class PigeonApiNSError: PigeonApiProtocolNSError { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let codeArg = try! pigeonDelegate.code(pigeonApi: self, pigeonInstance: pigeonInstance) - let domainArg = try! pigeonDelegate.domain(pigeonApi: self, pigeonInstance: pigeonInstance) - let userInfoArg = try! pigeonDelegate.userInfo(pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.NSError.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg, codeArg, domainArg, userInfoArg] as [Any?]) { - response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let codeArg = try! pigeonDelegate.code(pigeonApi: self, pigeonInstance: pigeonInstance) + let domainArg = try! pigeonDelegate.domain(pigeonApi: self, pigeonInstance: pigeonInstance) + let userInfoArg = try! pigeonDelegate.userInfo( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.NSError.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg, codeArg, domainArg, userInfoArg] as [Any?]) { + response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -2280,34 +2269,32 @@ final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let nameArg = try! pigeonDelegate.name(pigeonApi: self, pigeonInstance: pigeonInstance) - let bodyArg = try! pigeonDelegate.body(pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessage.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg, nameArg, bodyArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let nameArg = try! pigeonDelegate.name(pigeonApi: self, pigeonInstance: pigeonInstance) + let bodyArg = try! pigeonDelegate.body(pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessage.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg, nameArg, bodyArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -2350,37 +2337,35 @@ final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let hostArg = try! pigeonDelegate.host(pigeonApi: self, pigeonInstance: pigeonInstance) - let portArg = try! pigeonDelegate.port(pigeonApi: self, pigeonInstance: pigeonInstance) - let securityProtocolArg = try! pigeonDelegate.securityProtocol( - pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKSecurityOrigin.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg, hostArg, portArg, securityProtocolArg] as [Any?]) { - response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let hostArg = try! pigeonDelegate.host(pigeonApi: self, pigeonInstance: pigeonInstance) + let portArg = try! pigeonDelegate.port(pigeonApi: self, pigeonInstance: pigeonInstance) + let securityProtocolArg = try! pigeonDelegate.securityProtocol( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKSecurityOrigin.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg, hostArg, portArg, securityProtocolArg] as [Any?]) { + response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -2470,32 +2455,30 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -2578,37 +2561,35 @@ final class PigeonApiAuthenticationChallengeResponse: PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let dispositionArg = try! pigeonDelegate.disposition( - pigeonApi: self, pigeonInstance: pigeonInstance) - let credentialArg = try! pigeonDelegate.credential( - pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg, dispositionArg, credentialArg] as [Any?]) { - response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let dispositionArg = try! pigeonDelegate.disposition( + pigeonApi: self, pigeonInstance: pigeonInstance) + let credentialArg = try! pigeonDelegate.credential( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg, dispositionArg, credentialArg] as [Any?]) { + response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -2729,32 +2710,30 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -2848,32 +2827,30 @@ final class PigeonApiUIView: PigeonApiProtocolUIView { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -3168,37 +3145,35 @@ final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { pigeonInstance: UIScrollView, completion: @escaping (Result) -> Void ) { if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - PigeonError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -3486,32 +3461,30 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -3677,32 +3650,30 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -3770,32 +3741,30 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -3870,15 +3839,17 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + completion( + .failure( + PigeonError( + code: "new-instance-error", + message: + "Error: Attempting to create a new Dart instance of WKScriptMessageHandler, but the class has a nonnull callback method.", + details: ""))) } - print( - "Error: Attempting to create a new Dart instance of WKScriptMessageHandler, but the class has a nonnull callback method." - ) } /// Tells the handler that a webpage sent a script message. func didReceiveScriptMessage( @@ -3911,7 +3882,7 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -4019,15 +3990,17 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + completion( + .failure( + PigeonError( + code: "new-instance-error", + message: + "Error: Attempting to create a new Dart instance of WKNavigationDelegate, but the class has a nonnull callback method.", + details: ""))) } - print( - "Error: Attempting to create a new Dart instance of WKNavigationDelegate, but the class has a nonnull callback method." - ) } /// Tells the delegate that navigation is complete. func didFinishNavigation( @@ -4059,7 +4032,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -4094,7 +4067,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -4219,7 +4192,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -4255,7 +4228,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -4290,7 +4263,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -4452,32 +4425,30 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -4513,7 +4484,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -5145,32 +5116,30 @@ final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -5775,32 +5744,30 @@ final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -5826,41 +5793,39 @@ final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { self.pigeonDelegate = delegate } ///Creates a Dart instance of WKWebView and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKWebView, completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - PigeonError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebView.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + func pigeonNewInstance( + pigeonInstance: WKWebView, completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebView.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -5953,15 +5918,17 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + completion( + .failure( + PigeonError( + code: "new-instance-error", + message: + "Error: Attempting to create a new Dart instance of WKUIDelegate, but the class has a nonnull callback method.", + details: ""))) } - print( - "Error: Attempting to create a new Dart instance of WKUIDelegate, but the class has a nonnull callback method." - ) } /// Creates a new web view. func onCreateWebView( @@ -5997,7 +5964,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -6079,7 +6046,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -6237,32 +6204,30 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -6349,32 +6314,30 @@ final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -6415,7 +6378,7 @@ final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - completion(.success(Void())) + completion(.success(())) } } } @@ -6492,32 +6455,30 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -6566,39 +6527,37 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let hostArg = try! pigeonDelegate.host(pigeonApi: self, pigeonInstance: pigeonInstance) - let portArg = try! pigeonDelegate.port(pigeonApi: self, pigeonInstance: pigeonInstance) - let realmArg = try! pigeonDelegate.realm(pigeonApi: self, pigeonInstance: pigeonInstance) - let authenticationMethodArg = try! pigeonDelegate.authenticationMethod( - pigeonApi: self, pigeonInstance: pigeonInstance) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage( - [pigeonIdentifierArg, hostArg, portArg, realmArg, authenticationMethodArg] as [Any?] - ) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let hostArg = try! pigeonDelegate.host(pigeonApi: self, pigeonInstance: pigeonInstance) + let portArg = try! pigeonDelegate.port(pigeonApi: self, pigeonInstance: pigeonInstance) + let realmArg = try! pigeonDelegate.realm(pigeonApi: self, pigeonInstance: pigeonInstance) + let authenticationMethodArg = try! pigeonDelegate.authenticationMethod( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonIdentifierArg, hostArg, portArg, realmArg, authenticationMethodArg] as [Any?] + ) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -6669,32 +6628,30 @@ final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticat PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } @@ -6756,31 +6713,30 @@ final class PigeonApiURL: PigeonApiProtocolURL { PigeonError( code: "ignore-calls-error", message: "Calls to Dart are being ignored.", details: ""))) - return - } - if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(Void())) - return - } - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.URL.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(Void())) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.URL.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } } } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart index a48b032b6e6..18531d40a95 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v24.0.0), do not edit directly. +// Autogenerated from Pigeon (v24.1.1), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 6241b8ad90d..00e0feb057d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -32,7 +32,7 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^24.0.0 + pigeon: ^24.1.1 topics: - html From 5353741ee7daeef549eeb4f26dc67ee70bf56bb5 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 11 Feb 2025 17:54:52 -0500 Subject: [PATCH 04/10] add other method --- .../Tests/PreferencesProxyAPITests.swift | 6 +- .../WebViewConfigurationProxyAPITests.swift | 12 ++ .../WebpagePreferencesProxyAPITests.swift | 23 +++ .../PreferencesProxyAPIDelegate.swift | 9 +- .../ProxyAPIRegistrar.swift | 7 + .../WebKitLibrary.g.swift | 182 ++++++++++++++++++ ...WebViewConfigurationProxyAPIDelegate.swift | 7 + .../WebpagePreferencesProxyAPIDelegate.swift | 25 +++ .../ios/Runner.xcodeproj/project.pbxproj | 10 +- .../WebpagePreferencesProxyAPITests.swift | 23 +++ .../macos/Runner.xcodeproj/project.pbxproj | 4 + .../WebpagePreferencesProxyAPITests.swift | 23 +++ .../lib/src/common/web_kit.g.dart | 145 +++++++++++++- .../lib/src/webkit_webview_controller.dart | 19 ++ .../pigeons/web_kit.dart | 22 ++- 15 files changed, 510 insertions(+), 7 deletions(-) create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebpagePreferencesProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebpagePreferencesProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/WebpagePreferencesProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/example/macos/RunnerTests/WebpagePreferencesProxyAPITests.swift diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift index 787ff4de54a..fe0535e80b3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift @@ -8,7 +8,11 @@ import XCTest @testable import webview_flutter_wkwebview class PreferencesProxyAPITests: XCTestCase { - @MainActor func testSetJavaScriptEnabled() { + @MainActor func testSetJavaScriptEnabled() throws { + guard #unavailable(iOS 14.0, macOS 11.0) else { + throw XCTSkip("Required API is not available for this test.") + } + let registrar = TestProxyApiRegistrar() let api = registrar.apiDelegate.pigeonApiWKPreferences(registrar) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewConfigurationProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewConfigurationProxyAPITests.swift index b1b9f2f5615..431b3915f97 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewConfigurationProxyAPITests.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewConfigurationProxyAPITests.swift @@ -123,4 +123,16 @@ class WebViewConfigurationProxyAPITests: XCTestCase { XCTAssertEqual(instance.mediaTypesRequiringUserActionForPlayback, []) } + + @available(iOS 13.0, macOS 10.15, *) + @MainActor func testGetDefaultWebpagePreferences() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let value = try? api.pigeonDelegate.getDefaultWebpagePreferences( + pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.defaultWebpagePreferences) + } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebpagePreferencesProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebpagePreferencesProxyAPITests.swift new file mode 100644 index 00000000000..aa11b48ad1e --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebpagePreferencesProxyAPITests.swift @@ -0,0 +1,23 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import WebKit +import XCTest + +@testable import webview_flutter_wkwebview + +class WebpagePreferencesProxyAPITests: XCTestCase { + @available(iOS 14.0, macOS 11.0, *) + @MainActor func testSetAllowsContentJavaScript() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebpagePreferences(registrar) + + let instance = WKWebpagePreferences() + let allow = true + try? api.pigeonDelegate.setAllowsContentJavaScript( + pigeonApi: api, pigeonInstance: instance, allow: allow) + + XCTAssertEqual(instance.allowsContentJavaScript, allow) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift index 805f78a4e13..c577a26319e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift @@ -12,6 +12,13 @@ class PreferencesProxyAPIDelegate: PigeonApiDelegateWKPreferences { func setJavaScriptEnabled( pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool ) throws { - pigeonInstance.javaScriptEnabled = enabled + if #unavailable(iOS 14.0, macOS 11.0) { + pigeonInstance.javaScriptEnabled = enabled + } else { + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + .createUnsupportedVersionError( + method: "WKPreferences.javaScriptEnabled", + versionRequirements: "< iOS 14.0, macOS 11.0") + } } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ProxyAPIRegistrar.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ProxyAPIRegistrar.swift index 11064da2c3d..607001b2bc5 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ProxyAPIRegistrar.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ProxyAPIRegistrar.swift @@ -273,4 +273,11 @@ class ProxyAPIDelegate: WebKitLibraryPigeonProxyApiDelegate { func pigeonApiURL(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURL { return PigeonApiURL(pigeonRegistrar: registrar, delegate: URLProxyAPIDelegate()) } + + func pigeonApiWKWebpagePreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebpagePreferences + { + return PigeonApiWKWebpagePreferences( + pigeonRegistrar: registrar, delegate: WebpagePreferencesProxyAPIDelegate()) + } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift index eba69cf768c..81c25c9fa63 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift @@ -488,6 +488,10 @@ protocol WebKitLibraryPigeonProxyApiDelegate { /// An implementation of [PigeonApiURL] used to add a new Dart instance of /// `URL` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiURL(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURL + /// An implementation of [PigeonApiWKWebpagePreferences] used to add a new Dart instance of + /// `WKWebpagePreferences` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKWebpagePreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebpagePreferences } extension WebKitLibraryPigeonProxyApiDelegate { @@ -585,6 +589,8 @@ open class WebKitLibraryPigeonProxyApiRegistrar { binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLAuthenticationChallenge(self)) PigeonApiURL.setUpMessageHandlers( binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURL(self)) + PigeonApiWKWebpagePreferences.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebpagePreferences(self)) } func tearDown() { WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( @@ -613,6 +619,7 @@ open class WebKitLibraryPigeonProxyApiRegistrar { PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( binaryMessenger: binaryMessenger, api: nil) PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKWebpagePreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) } } private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStandardReaderWriter { @@ -1011,6 +1018,18 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand return } + if #available(iOS 13.0.0, macOS 10.15.0, *), let instance = value as? WKWebpagePreferences { + pigeonRegistrar.apiDelegate.pigeonApiWKWebpagePreferences(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + if let instance = value as? NSObject { pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance @@ -3224,6 +3243,11 @@ protocol PigeonApiDelegateWKWebViewConfiguration { func setMediaTypesRequiringUserActionForPlayback( pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, type: AudiovisualMediaType) throws + /// The default preferences to use when loading and rendering content. + @available(iOS 13.0.0, macOS 10.15.0, *) + func getDefaultWebpagePreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKWebpagePreferences } protocol PigeonApiProtocolWKWebViewConfiguration { @@ -3448,6 +3472,46 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setMediaTypesRequiringUserActionForPlaybackChannel.setMessageHandler(nil) } + if #available(iOS 13.0.0, macOS 10.15.0, *) { + let getDefaultWebpagePreferencesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getDefaultWebpagePreferences", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getDefaultWebpagePreferencesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + do { + let result = try api.pigeonDelegate.getDefaultWebpagePreferences( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getDefaultWebpagePreferencesChannel.setMessageHandler(nil) + } + } else { + let getDefaultWebpagePreferencesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getDefaultWebpagePreferences", + binaryMessenger: binaryMessenger, codec: codec) + if api != nil { + getDefaultWebpagePreferencesChannel.setMessageHandler { message, reply in + reply( + wrapError( + FlutterError( + code: "PigeonUnsupportedOperationError", + message: + "Call to getDefaultWebpagePreferences requires @available(iOS 13.0.0, macOS 10.15.0, *).", + details: nil + ))) + } + } else { + getDefaultWebpagePreferencesChannel.setMessageHandler(nil) + } + } } ///Creates a Dart instance of WKWebViewConfiguration and attaches it to [pigeonInstance]. @@ -6741,3 +6805,121 @@ final class PigeonApiURL: PigeonApiProtocolURL { } } } +protocol PigeonApiDelegateWKWebpagePreferences { + /// A Boolean value that indicates whether JavaScript from web content is + /// allowed to run. + @available(iOS 13.0.0, macOS 10.15.0, *) + func setAllowsContentJavaScript( + pigeonApi: PigeonApiWKWebpagePreferences, pigeonInstance: WKWebpagePreferences, allow: Bool) + throws +} + +protocol PigeonApiProtocolWKWebpagePreferences { +} + +final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKWebpagePreferences + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKWebpagePreferences + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebpagePreferences? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + if #available(iOS 13.0.0, macOS 10.15.0, *) { + let setAllowsContentJavaScriptChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.setAllowsContentJavaScript", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsContentJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebpagePreferences + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsContentJavaScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setAllowsContentJavaScriptChannel.setMessageHandler(nil) + } + } else { + let setAllowsContentJavaScriptChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.setAllowsContentJavaScript", + binaryMessenger: binaryMessenger, codec: codec) + if api != nil { + setAllowsContentJavaScriptChannel.setMessageHandler { message, reply in + reply( + wrapError( + FlutterError( + code: "PigeonUnsupportedOperationError", + message: + "Call to setAllowsContentJavaScript requires @available(iOS 13.0.0, macOS 10.15.0, *).", + details: nil + ))) + } + } else { + setAllowsContentJavaScriptChannel.setMessageHandler(nil) + } + } + } + + ///Creates a Dart instance of WKWebpagePreferences and attaches it to [pigeonInstance]. + @available(iOS 13.0.0, macOS 10.15.0, *) + func pigeonNewInstance( + pigeonInstance: WKWebpagePreferences, completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(())) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewConfigurationProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewConfigurationProxyAPIDelegate.swift index ec509742fae..e6c6e85952a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewConfigurationProxyAPIDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewConfigurationProxyAPIDelegate.swift @@ -92,4 +92,11 @@ class WebViewConfigurationProxyAPIDelegate: PigeonApiDelegateWKWebViewConfigurat pigeonInstance.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypes.all } } + + @available(iOS 13.0, macOS 10.15, *) + func getDefaultWebpagePreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKWebpagePreferences { + return pigeonInstance.defaultWebpagePreferences + } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebpagePreferencesProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebpagePreferencesProxyAPIDelegate.swift new file mode 100644 index 00000000000..5c0721523c6 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebpagePreferencesProxyAPIDelegate.swift @@ -0,0 +1,25 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import WebKit + +/// ProxyApi implementation for `WKWebpagePreferences`. +/// +/// This class may handle instantiating native object instances that are attached to a Dart instance +/// or handle method calls on the associated native class or an instance of that class. +class WebpagePreferencesProxyAPIDelegate: PigeonApiDelegateWKWebpagePreferences { + @available(iOS 13.0, macOS 10.15, *) + func setAllowsContentJavaScript( + pigeonApi: PigeonApiWKWebpagePreferences, pigeonInstance: WKWebpagePreferences, allow: Bool + ) throws { + if #available(iOS 14.0, macOS 11.0, *) { + pigeonInstance.allowsContentJavaScript = allow + } else { + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + .createUnsupportedVersionError( + method: "WKWebpagePreferences.allowsContentJavaScript", + versionRequirements: "iOS 14.0, macOS 11.0") + } + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/project.pbxproj b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/project.pbxproj index 86c69e10969..8d55bed2605 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -40,6 +40,7 @@ 8F1488FE2D2DE27000191744 /* HTTPCookieProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488C82D2DE27000191744 /* HTTPCookieProxyAPITests.swift */; }; 8F1488FF2D2DE27000191744 /* NavigationActionProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488CB2D2DE27000191744 /* NavigationActionProxyAPITests.swift */; }; 8F1489012D2DE91C00191744 /* AuthenticationChallengeResponseProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1489002D2DE91C00191744 /* AuthenticationChallengeResponseProxyAPITests.swift */; }; + 8FC45F712D5C0C1E004E03E8 /* WebpagePreferencesProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FC45F702D5C0C1E004E03E8 /* WebpagePreferencesProxyAPITests.swift */; }; 904EA421B6925EC8D52ABE1B /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 573E8F1472CA1578A7CBDB63 /* libPods-RunnerTests.a */; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; @@ -125,6 +126,7 @@ 8F1488E12D2DE27000191744 /* WebViewProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebViewProxyAPITests.swift; path = ../../darwin/Tests/WebViewProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; 8F1489002D2DE91C00191744 /* AuthenticationChallengeResponseProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AuthenticationChallengeResponseProxyAPITests.swift; path = ../../darwin/Tests/AuthenticationChallengeResponseProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; 8F66D9D72D1362BE000835F9 /* RunnerTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RunnerTests-Bridging-Header.h"; sourceTree = ""; }; + 8FC45F702D5C0C1E004E03E8 /* WebpagePreferencesProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebpagePreferencesProxyAPITests.swift; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -170,6 +172,7 @@ 68BDCAEA23C3F7CB00D9C032 /* RunnerTests */ = { isa = PBXGroup; children = ( + 8FC45F702D5C0C1E004E03E8 /* WebpagePreferencesProxyAPITests.swift */, 8F1489002D2DE91C00191744 /* AuthenticationChallengeResponseProxyAPITests.swift */, 8F1488C52D2DE27000191744 /* ErrorProxyAPITests.swift */, 8F1488C62D2DE27000191744 /* FrameInfoProxyAPITests.swift */, @@ -395,7 +398,7 @@ ); mainGroup = 97C146E51CF9000F007C117D; packageReferences = ( - 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; @@ -539,6 +542,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8FC45F712D5C0C1E004E03E8 /* WebpagePreferencesProxyAPITests.swift in Sources */, 8F1488E22D2DE27000191744 /* ScriptMessageHandlerProxyAPITests.swift in Sources */, 8F1488E32D2DE27000191744 /* TestProxyApiRegistrar.swift in Sources */, 8F1488E42D2DE27000191744 /* URLRequestProxyAPITests.swift in Sources */, @@ -918,7 +922,7 @@ /* End XCConfigurationList section */ /* Begin XCLocalSwiftPackageReference section */ - 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { isa = XCLocalSwiftPackageReference; relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; }; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/WebpagePreferencesProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/WebpagePreferencesProxyAPITests.swift new file mode 100644 index 00000000000..aa11b48ad1e --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/WebpagePreferencesProxyAPITests.swift @@ -0,0 +1,23 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import WebKit +import XCTest + +@testable import webview_flutter_wkwebview + +class WebpagePreferencesProxyAPITests: XCTestCase { + @available(iOS 14.0, macOS 11.0, *) + @MainActor func testSetAllowsContentJavaScript() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebpagePreferences(registrar) + + let instance = WKWebpagePreferences() + let allow = true + try? api.pigeonDelegate.setAllowsContentJavaScript( + pigeonApi: api, pigeonInstance: instance, allow: allow) + + XCTAssertEqual(instance.allowsContentJavaScript, allow) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.pbxproj b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.pbxproj index d8799f08111..4fb9e94bb55 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.pbxproj +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; 6FBECA2F94D9B352000B75D7 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 418FB4EA49104BADE288A967 /* Pods_RunnerTests.framework */; }; 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; + 8FC45F732D5C0C37004E03E8 /* WebpagePreferencesProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FC45F722D5C0C37004E03E8 /* WebpagePreferencesProxyAPITests.swift */; }; 8FF1FEA22D37201300A5E400 /* NSObjectProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE8E2D37201300A5E400 /* NSObjectProxyAPITests.swift */; }; 8FF1FEA32D37201300A5E400 /* ScrollViewProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE932D37201300A5E400 /* ScrollViewProxyAPITests.swift */; }; 8FF1FEA42D37201300A5E400 /* URLAuthenticationChallengeProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE992D37201300A5E400 /* URLAuthenticationChallengeProxyAPITests.swift */; }; @@ -112,6 +113,7 @@ 69E635CFAEEB8242654D4BBC /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 7D83F970E1160B09690C7723 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 8FC45F722D5C0C37004E03E8 /* WebpagePreferencesProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebpagePreferencesProxyAPITests.swift; sourceTree = ""; }; 8FF1FE842D37201300A5E400 /* AuthenticationChallengeResponseProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AuthenticationChallengeResponseProxyAPITests.swift; path = ../../darwin/Tests/AuthenticationChallengeResponseProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; 8FF1FE852D37201300A5E400 /* ErrorProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ErrorProxyAPITests.swift; path = ../../darwin/Tests/ErrorProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; 8FF1FE862D37201300A5E400 /* FrameInfoProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FrameInfoProxyAPITests.swift; path = ../../darwin/Tests/FrameInfoProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; @@ -174,6 +176,7 @@ 331C80D6294CF71000263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( + 8FC45F722D5C0C37004E03E8 /* WebpagePreferencesProxyAPITests.swift */, 8FF1FE842D37201300A5E400 /* AuthenticationChallengeResponseProxyAPITests.swift */, 8FF1FE852D37201300A5E400 /* ErrorProxyAPITests.swift */, 8FF1FE862D37201300A5E400 /* FrameInfoProxyAPITests.swift */, @@ -525,6 +528,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8FC45F732D5C0C37004E03E8 /* WebpagePreferencesProxyAPITests.swift in Sources */, 8FF1FEA22D37201300A5E400 /* NSObjectProxyAPITests.swift in Sources */, 8FF1FEA32D37201300A5E400 /* ScrollViewProxyAPITests.swift in Sources */, 8FF1FEA42D37201300A5E400 /* URLAuthenticationChallengeProxyAPITests.swift in Sources */, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/RunnerTests/WebpagePreferencesProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/RunnerTests/WebpagePreferencesProxyAPITests.swift new file mode 100644 index 00000000000..aa11b48ad1e --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/RunnerTests/WebpagePreferencesProxyAPITests.swift @@ -0,0 +1,23 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import WebKit +import XCTest + +@testable import webview_flutter_wkwebview + +class WebpagePreferencesProxyAPITests: XCTestCase { + @available(iOS 14.0, macOS 11.0, *) + @MainActor func testSetAllowsContentJavaScript() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebpagePreferences(registrar) + + let instance = WKWebpagePreferences() + let allow = true + try? api.pigeonDelegate.setAllowsContentJavaScript( + pigeonApi: api, pigeonInstance: instance, allow: allow) + + XCTAssertEqual(instance.allowsContentJavaScript, allow) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart index 18531d40a95..888b6393467 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart @@ -197,6 +197,8 @@ class PigeonInstanceManager { URLAuthenticationChallenge.pigeon_setUpMessageHandlers( pigeon_instanceManager: instanceManager); URL.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebpagePreferences.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -3466,6 +3468,39 @@ class WKWebViewConfiguration extends NSObject { } } + /// The default preferences to use when loading and rendering content. + Future getDefaultWebpagePreferences() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getDefaultWebpagePreferences'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as WKWebpagePreferences?)!; + } + } + @override WKWebViewConfiguration pigeon_copy() { return WKWebViewConfiguration.pigeon_detached( @@ -7519,7 +7554,7 @@ class URLAuthenticationChallenge extends NSObject { } /// A value that identifies the location of a resource, such as an item on a -/// remote server or the path to a local file.. +/// remote server or the path to a local file. /// /// See https://developer.apple.com/documentation/foundation/url. class URL extends NSObject { @@ -7628,3 +7663,111 @@ class URL extends NSObject { ); } } + +/// An object that specifies the behaviors to use when loading and rendering +/// page content. +/// +/// See https://developer.apple.com/documentation/webkit/wkwebpagepreferences. +class WKWebpagePreferences extends NSObject { + /// Constructs [WKWebpagePreferences] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + WKWebpagePreferences.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecWKWebpagePreferences = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKWebpagePreferences Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + WKWebpagePreferences.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// A Boolean value that indicates whether JavaScript from web content is + /// allowed to run. + Future setAllowsContentJavaScript(bool allow) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebpagePreferences; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.setAllowsContentJavaScript'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, allow]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + @override + WKWebpagePreferences pigeon_copy() { + return WKWebpagePreferences.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + ); + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart index 3856964326d..cc04cb83c98 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart @@ -564,6 +564,25 @@ class WebKitWebViewController extends PlatformWebViewController { @override Future setJavaScriptMode(JavaScriptMode javaScriptMode) async { + // Attempt to set the value that requires iOS 14+. + try { + final WKWebpagePreferences webpagePreferences = + await _webView.configuration.getDefaultWebpagePreferences(); + switch (javaScriptMode) { + case JavaScriptMode.disabled: + await webpagePreferences.setAllowsContentJavaScript(false); + case JavaScriptMode.unrestricted: + await webpagePreferences.setAllowsContentJavaScript(true); + } + return; + } on PlatformException catch (exception) { + if (exception.code != 'PigeonUnsupportedOperationError') { + rethrow; + } + } catch (exception) { + rethrow; + } + final WKPreferences preferences = await _webView.configuration.getPreferences(); switch (javaScriptMode) { diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart index af42f99de00..dd247f24762 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart @@ -650,6 +650,9 @@ abstract class WKWebViewConfiguration extends NSObject { /// The media types that require a user gesture to begin playing. void setMediaTypesRequiringUserActionForPlayback(AudiovisualMediaType type); + + /// The default preferences to use when loading and rendering content. + WKWebpagePreferences getDefaultWebpagePreferences(); } /// An object for managing interactions between JavaScript code and your web @@ -1091,7 +1094,7 @@ abstract class URLAuthenticationChallenge extends NSObject { } /// A value that identifies the location of a resource, such as an item on a -/// remote server or the path to a local file.. +/// remote server or the path to a local file. /// /// See https://developer.apple.com/documentation/foundation/url. @ProxyApi(swiftOptions: SwiftProxyApiOptions(name: 'URL')) @@ -1099,3 +1102,20 @@ abstract class URL extends NSObject { /// The absolute string for the URL. String getAbsoluteString(); } + +/// An object that specifies the behaviors to use when loading and rendering +/// page content. +/// +/// See https://developer.apple.com/documentation/webkit/wkwebpagepreferences. +@ProxyApi( + swiftOptions: SwiftProxyApiOptions( + import: 'WebKit', + minIosApi: '13.0.0', + minMacosApi: '10.15.0', + ), +) +abstract class WKWebpagePreferences extends NSObject { + /// A Boolean value that indicates whether JavaScript from web content is + /// allowed to run. + void setAllowsContentJavaScript(bool allow); +} From a072e89fd9a4da8015655e457b3d844a9432cb84 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 11 Feb 2025 18:09:57 -0500 Subject: [PATCH 05/10] add dart tests --- .../src/legacy/web_kit_webview_widget.dart | 19 + .../web_kit_cookie_manager_test.mocks.dart | 247 +- .../web_kit_webview_widget_test.mocks.dart | 2506 +++++++-------- ...webkit_navigation_delegate_test.mocks.dart | 404 +-- .../test/webkit_webview_controller_test.dart | 38 +- .../webkit_webview_controller_test.mocks.dart | 2692 ++++++++--------- ...kit_webview_cookie_manager_test.mocks.dart | 247 +- .../webkit_webview_widget_test.mocks.dart | 514 ++-- 8 files changed, 3012 insertions(+), 3655 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart index 50d6063ef0b..3caec799cfe 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart @@ -510,6 +510,25 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { } Future _setJavaScriptMode(JavascriptMode mode) async { + // Attempt to set the value that requires iOS 14+. + try { + final WKWebpagePreferences webpagePreferences = + await webView.configuration.getDefaultWebpagePreferences(); + switch (mode) { + case JavascriptMode.disabled: + await webpagePreferences.setAllowsContentJavaScript(false); + case JavascriptMode.unrestricted: + await webpagePreferences.setAllowsContentJavaScript(true); + } + return; + } on PlatformException catch (exception) { + if (exception.code != 'PigeonUnsupportedOperationError') { + rethrow; + } + } catch (exception) { + rethrow; + } + final WKPreferences preferences = await webView.configuration.getPreferences(); switch (mode) { diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart index 887a7152dec..e29d4d71a3f 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.dart. // Do not manually edit this file. @@ -16,6 +16,7 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -23,35 +24,20 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKHTTPCookieStore_1 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { - _FakeWKHTTPCookieStore_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKHTTPCookieStore_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKWebsiteDataStore_2 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebsiteDataStore_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WKHTTPCookieStore]. @@ -63,38 +49,35 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i3.Future setCookie(_i2.HTTPCookie? cookie) => (super.noSuchMethod( - Invocation.method( - #setCookie, - [cookie], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future setCookie(_i2.HTTPCookie? cookie) => + (super.noSuchMethod( + Invocation.method(#setCookie, [cookie]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i2.WKHTTPCookieStore pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKHTTPCookieStore_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKHTTPCookieStore_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKHTTPCookieStore); @override _i3.Future addObserver( @@ -103,34 +86,20 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKWebsiteDataStore]. @@ -143,37 +112,37 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_1( - this, - Invocation.getter(#httpCookieStore), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => + (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_1( + this, + Invocation.getter(#httpCookieStore), + ), + ) + as _i2.WKHTTPCookieStore); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_httpCookieStore, - [], - ), - returnValue: _FakeWKHTTPCookieStore_1( - this, - Invocation.method( - #pigeonVar_httpCookieStore, - [], - ), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_1( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) + as _i2.WKHTTPCookieStore); @override _i3.Future removeDataOfTypes( @@ -181,30 +150,24 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method( - #removeDataOfTypes, - [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), + returnValue: _i3.Future.value(false), + ) + as _i3.Future); @override - _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKWebsiteDataStore_2( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKWebsiteDataStore); + _i2.WKWebsiteDataStore pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebsiteDataStore); @override _i3.Future addObserver( @@ -213,32 +176,18 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart index db74eb20358..44152e36e5d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart. // Do not manually edit this file. @@ -27,6 +27,7 @@ import 'package:webview_flutter_wkwebview/src/legacy/web_kit_webview_widget.dart // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -34,151 +35,95 @@ import 'package:webview_flutter_wkwebview/src/legacy/web_kit_webview_widget.dart class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeUIScrollView_1 extends _i1.SmartFake implements _i2.UIScrollView { - _FakeUIScrollView_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeUIScrollView_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeURLRequest_2 extends _i1.SmartFake implements _i2.URLRequest { - _FakeURLRequest_2( + _FakeURLRequest_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeAuthenticationChallengeResponse_3 extends _i1.SmartFake + implements _i2.AuthenticationChallengeResponse { + _FakeAuthenticationChallengeResponse_3( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } -class _FakeWKNavigationDelegate_3 extends _i1.SmartFake +class _FakeWKNavigationDelegate_4 extends _i1.SmartFake implements _i2.WKNavigationDelegate { - _FakeWKNavigationDelegate_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKNavigationDelegate_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKPreferences_4 extends _i1.SmartFake implements _i2.WKPreferences { - _FakeWKPreferences_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeWKPreferences_5 extends _i1.SmartFake implements _i2.WKPreferences { + _FakeWKPreferences_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKScriptMessageHandler_5 extends _i1.SmartFake +class _FakeWKScriptMessageHandler_6 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { - _FakeWKScriptMessageHandler_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKScriptMessageHandler_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebView_6 extends _i1.SmartFake implements _i2.WKWebView { - _FakeWKWebView_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeWKWebView_7 extends _i1.SmartFake implements _i2.WKWebView { + _FakeWKWebView_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebViewConfiguration_7 extends _i1.SmartFake +class _FakeWKWebViewConfiguration_8 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { - _FakeWKWebViewConfiguration_7( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebViewConfiguration_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeUIViewWKWebView_8 extends _i1.SmartFake +class _FakeUIViewWKWebView_9 extends _i1.SmartFake implements _i2.UIViewWKWebView { - _FakeUIViewWKWebView_8( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeUIViewWKWebView_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKUserContentController_9 extends _i1.SmartFake +class _FakeWKUserContentController_10 extends _i1.SmartFake implements _i2.WKUserContentController { - _FakeWKUserContentController_9( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKUserContentController_10(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebsiteDataStore_10 extends _i1.SmartFake +class _FakeWKWebsiteDataStore_11 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_10( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebsiteDataStore_11(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKHTTPCookieStore_11 extends _i1.SmartFake +class _FakeWKWebpagePreferences_12 extends _i1.SmartFake + implements _i2.WKWebpagePreferences { + _FakeWKWebpagePreferences_12(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWKHTTPCookieStore_13 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { - _FakeWKHTTPCookieStore_11( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKHTTPCookieStore_13(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKUIDelegate_12 extends _i1.SmartFake implements _i2.WKUIDelegate { - _FakeWKUIDelegate_12( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeWKUIDelegate_14 extends _i1.SmartFake implements _i2.WKUIDelegate { + _FakeWKUIDelegate_14(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakePlatformWebView_13 extends _i1.SmartFake +class _FakePlatformWebView_15 extends _i1.SmartFake implements _i3.PlatformWebView { - _FakePlatformWebView_13( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformWebView_15(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [UIScrollView]. @@ -190,102 +135,124 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i4.Future> getContentOffset() => (super.noSuchMethod( - Invocation.method( - #getContentOffset, - [], - ), - returnValue: _i4.Future>.value([]), - ) as _i4.Future>); + _i4.Future> getContentOffset() => + (super.noSuchMethod( + Invocation.method(#getContentOffset, []), + returnValue: _i4.Future>.value([]), + ) + as _i4.Future>); @override - _i4.Future scrollBy( - double? x, - double? y, - ) => + _i4.Future scrollBy(double? x, double? y) => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setContentOffset( - double? x, - double? y, - ) => + Invocation.method(#scrollBy, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setContentOffset(double? x, double? y) => (super.noSuchMethod( - Invocation.method( - #setContentOffset, - [ - x, - y, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setContentOffset, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setDelegate(_i2.UIScrollViewDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #setDelegate, - [delegate], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.UIScrollView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeUIScrollView_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.UIScrollView); - - @override - _i4.Future setBackgroundColor(int? value) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method( - #setOpaque, - [opaque], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setDelegate, [delegate]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setBounces(bool? value) => + (super.noSuchMethod( + Invocation.method(#setBounces, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setBouncesHorizontally(bool? value) => + (super.noSuchMethod( + Invocation.method(#setBouncesHorizontally, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setBouncesVertically(bool? value) => + (super.noSuchMethod( + Invocation.method(#setBouncesVertically, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setAlwaysBounceVertical(bool? value) => + (super.noSuchMethod( + Invocation.method(#setAlwaysBounceVertical, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setAlwaysBounceHorizontal(bool? value) => + (super.noSuchMethod( + Invocation.method(#setAlwaysBounceHorizontal, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.UIScrollView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIScrollView_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.UIScrollView); + + @override + _i4.Future setBackgroundColor(int? value) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setOpaque(bool? opaque) => + (super.noSuchMethod( + Invocation.method(#setOpaque, [opaque]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future addObserver( @@ -294,34 +261,20 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [URLRequest]. @@ -333,96 +286,85 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i4.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); + _i4.Future getUrl() => + (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setHttpMethod(String? method) => (super.noSuchMethod( - Invocation.method( - #setHttpMethod, - [method], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setHttpMethod(String? method) => + (super.noSuchMethod( + Invocation.method(#setHttpMethod, [method]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future getHttpMethod() => (super.noSuchMethod( - Invocation.method( - #getHttpMethod, - [], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); + _i4.Future getHttpMethod() => + (super.noSuchMethod( + Invocation.method(#getHttpMethod, []), + returnValue: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setHttpBody(_i5.Uint8List? body) => (super.noSuchMethod( - Invocation.method( - #setHttpBody, - [body], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setHttpBody(_i5.Uint8List? body) => + (super.noSuchMethod( + Invocation.method(#setHttpBody, [body]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future<_i5.Uint8List?> getHttpBody() => (super.noSuchMethod( - Invocation.method( - #getHttpBody, - [], - ), - returnValue: _i4.Future<_i5.Uint8List?>.value(), - ) as _i4.Future<_i5.Uint8List?>); + _i4.Future<_i5.Uint8List?> getHttpBody() => + (super.noSuchMethod( + Invocation.method(#getHttpBody, []), + returnValue: _i4.Future<_i5.Uint8List?>.value(), + ) + as _i4.Future<_i5.Uint8List?>); @override _i4.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method( - #setAllHttpHeaderFields, - [fields], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setAllHttpHeaderFields, [fields]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future?> getAllHttpHeaderFields() => (super.noSuchMethod( - Invocation.method( - #getAllHttpHeaderFields, - [], - ), - returnValue: _i4.Future?>.value(), - ) as _i4.Future?>); - - @override - _i2.URLRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeURLRequest_2( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.URLRequest); + Invocation.method(#getAllHttpHeaderFields, []), + returnValue: _i4.Future?>.value(), + ) + as _i4.Future?>); + + @override + _i2.URLRequest pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURLRequest_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.URLRequest); @override _i4.Future addObserver( @@ -431,34 +373,20 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WKNavigationDelegate]. @@ -471,28 +399,101 @@ class MockWKNavigationDelegate extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i4.Future<_i2.NavigationActionPolicy> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.WKNavigationAction, + ) + get decidePolicyForNavigationAction => + (super.noSuchMethod( + Invocation.getter(#decidePolicyForNavigationAction), + returnValue: + ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.WKNavigationAction navigationAction, + ) => _i4.Future<_i2.NavigationActionPolicy>.value( + _i2.NavigationActionPolicy.allow, + ), + ) + as _i4.Future<_i2.NavigationActionPolicy> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.WKNavigationAction, + )); + + @override + _i4.Future<_i2.NavigationResponsePolicy> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.WKNavigationResponse, + ) + get decidePolicyForNavigationResponse => + (super.noSuchMethod( + Invocation.getter(#decidePolicyForNavigationResponse), + returnValue: + ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.WKNavigationResponse navigationResponse, + ) => _i4.Future<_i2.NavigationResponsePolicy>.value( + _i2.NavigationResponsePolicy.allow, + ), + ) + as _i4.Future<_i2.NavigationResponsePolicy> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.WKNavigationResponse, + )); + + @override + _i4.Future<_i2.AuthenticationChallengeResponse> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.URLAuthenticationChallenge, + ) + get didReceiveAuthenticationChallenge => + (super.noSuchMethod( + Invocation.getter(#didReceiveAuthenticationChallenge), + returnValue: + ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.URLAuthenticationChallenge challenge, + ) => _i4.Future<_i2.AuthenticationChallengeResponse>.value( + _FakeAuthenticationChallengeResponse_3( + this, + Invocation.getter(#didReceiveAuthenticationChallenge), + ), + ), + ) + as _i4.Future<_i2.AuthenticationChallengeResponse> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.URLAuthenticationChallenge, + )); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i2.WKNavigationDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKNavigationDelegate_3( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKNavigationDelegate); + _i2.WKNavigationDelegate pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKNavigationDelegate_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKNavigationDelegate); @override _i4.Future addObserver( @@ -501,34 +502,20 @@ class MockWKNavigationDelegate extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WKPreferences]. @@ -540,38 +527,35 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i4.Future setJavaScriptEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptEnabled, - [enabled], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKPreferences_4( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKPreferences); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i4.Future setJavaScriptEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.WKPreferences pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_5( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKPreferences); @override _i4.Future addObserver( @@ -580,34 +564,20 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WKScriptMessageHandler]. @@ -624,42 +594,44 @@ class MockWKScriptMessageHandler extends _i1.Mock _i2.WKScriptMessageHandler, _i2.WKUserContentController, _i2.WKScriptMessage, - ) get didReceiveScriptMessage => (super.noSuchMethod( - Invocation.getter(#didReceiveScriptMessage), - returnValue: ( - _i2.WKScriptMessageHandler pigeon_instance, - _i2.WKUserContentController controller, - _i2.WKScriptMessage message, - ) {}, - ) as void Function( - _i2.WKScriptMessageHandler, - _i2.WKUserContentController, - _i2.WKScriptMessage, - )); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.WKScriptMessageHandler pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKScriptMessageHandler_5( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKScriptMessageHandler); + ) + get didReceiveScriptMessage => + (super.noSuchMethod( + Invocation.getter(#didReceiveScriptMessage), + returnValue: + ( + _i2.WKScriptMessageHandler pigeon_instance, + _i2.WKUserContentController controller, + _i2.WKScriptMessage message, + ) {}, + ) + as void Function( + _i2.WKScriptMessageHandler, + _i2.WKUserContentController, + _i2.WKScriptMessage, + )); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WKScriptMessageHandler pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKScriptMessageHandler_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKScriptMessageHandler); @override _i4.Future addObserver( @@ -668,34 +640,20 @@ class MockWKScriptMessageHandler extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WKWebView]. @@ -707,28 +665,26 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i2.WKWebView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKWebView_6( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKWebView); + _i2.WKWebView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebView); @override _i4.Future addObserver( @@ -737,34 +693,20 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [UIViewWKWebView]. @@ -776,297 +718,252 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { } @override - _i2.WKWebViewConfiguration get configuration => (super.noSuchMethod( - Invocation.getter(#configuration), - returnValue: _FakeWKWebViewConfiguration_7( - this, - Invocation.getter(#configuration), - ), - ) as _i2.WKWebViewConfiguration); - - @override - _i2.UIScrollView get scrollView => (super.noSuchMethod( - Invocation.getter(#scrollView), - returnValue: _FakeUIScrollView_1( - this, - Invocation.getter(#scrollView), - ), - ) as _i2.UIScrollView); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.WKWebViewConfiguration pigeonVar_configuration() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_configuration, - [], - ), - returnValue: _FakeWKWebViewConfiguration_7( - this, - Invocation.method( - #pigeonVar_configuration, - [], - ), - ), - ) as _i2.WKWebViewConfiguration); - - @override - _i2.UIScrollView pigeonVar_scrollView() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_scrollView, - [], - ), - returnValue: _FakeUIScrollView_1( - this, - Invocation.method( - #pigeonVar_scrollView, - [], - ), - ), - ) as _i2.UIScrollView); + _i2.WKWebViewConfiguration get configuration => + (super.noSuchMethod( + Invocation.getter(#configuration), + returnValue: _FakeWKWebViewConfiguration_8( + this, + Invocation.getter(#configuration), + ), + ) + as _i2.WKWebViewConfiguration); + + @override + _i2.UIScrollView get scrollView => + (super.noSuchMethod( + Invocation.getter(#scrollView), + returnValue: _FakeUIScrollView_1( + this, + Invocation.getter(#scrollView), + ), + ) + as _i2.UIScrollView); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WKWebViewConfiguration pigeonVar_configuration() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_configuration, []), + returnValue: _FakeWKWebViewConfiguration_8( + this, + Invocation.method(#pigeonVar_configuration, []), + ), + ) + as _i2.WKWebViewConfiguration); + + @override + _i2.UIScrollView pigeonVar_scrollView() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_scrollView, []), + returnValue: _FakeUIScrollView_1( + this, + Invocation.method(#pigeonVar_scrollView, []), + ), + ) + as _i2.UIScrollView); @override _i4.Future setUIDelegate(_i2.WKUIDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #setUIDelegate, - [delegate], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setUIDelegate, [delegate]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setNavigationDelegate(_i2.WKNavigationDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #setNavigationDelegate, - [delegate], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future getEstimatedProgress() => (super.noSuchMethod( - Invocation.method( - #getEstimatedProgress, - [], - ), - returnValue: _i4.Future.value(0.0), - ) as _i4.Future); - - @override - _i4.Future load(_i2.URLRequest? request) => (super.noSuchMethod( - Invocation.method( - #load, - [request], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future loadHtmlString( - String? string, - String? baseUrl, - ) => + Invocation.method(#setNavigationDelegate, [delegate]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [ - string, - baseUrl, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future loadFileUrl( - String? url, - String? readAccessUrl, - ) => + Invocation.method(#getUrl, []), + returnValue: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future getEstimatedProgress() => + (super.noSuchMethod( + Invocation.method(#getEstimatedProgress, []), + returnValue: _i4.Future.value(0.0), + ) + as _i4.Future); + + @override + _i4.Future load(_i2.URLRequest? request) => + (super.noSuchMethod( + Invocation.method(#load, [request]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future loadHtmlString(String? string, String? baseUrl) => + (super.noSuchMethod( + Invocation.method(#loadHtmlString, [string, baseUrl]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future loadFileUrl(String? url, String? readAccessUrl) => + (super.noSuchMethod( + Invocation.method(#loadFileUrl, [url, readAccessUrl]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #loadFileUrl, - [ - url, - readAccessUrl, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - - @override - _i4.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - - @override - _i4.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#canGoBack, []), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); + + @override + _i4.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); + + @override + _i4.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowsBackForwardNavigationGestures, - [allow], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setAllowsBackForwardNavigationGestures, [allow]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setCustomUserAgent, - [userAgent], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setCustomUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setCustomUserAgent, [userAgent]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future evaluateJavaScript(String? javaScriptString) => (super.noSuchMethod( - Invocation.method( - #evaluateJavaScript, - [javaScriptString], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setInspectable(bool? inspectable) => (super.noSuchMethod( - Invocation.method( - #setInspectable, - [inspectable], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future getCustomUserAgent() => (super.noSuchMethod( - Invocation.method( - #getCustomUserAgent, - [], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.UIViewWKWebView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeUIViewWKWebView_8( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.UIViewWKWebView); - - @override - _i4.Future setBackgroundColor(int? value) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method( - #setOpaque, - [opaque], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#evaluateJavaScript, [javaScriptString]), + returnValue: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setInspectable(bool? inspectable) => + (super.noSuchMethod( + Invocation.method(#setInspectable, [inspectable]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future getCustomUserAgent() => + (super.noSuchMethod( + Invocation.method(#getCustomUserAgent, []), + returnValue: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.UIViewWKWebView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIViewWKWebView_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.UIViewWKWebView); + + @override + _i4.Future setBackgroundColor(int? value) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setOpaque(bool? opaque) => + (super.noSuchMethod( + Invocation.method(#setOpaque, [opaque]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future addObserver( @@ -1075,34 +972,20 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WKWebViewConfiguration]. @@ -1115,145 +998,138 @@ class MockWKWebViewConfiguration extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i4.Future setUserContentController( - _i2.WKUserContentController? controller) => + _i2.WKUserContentController? controller, + ) => (super.noSuchMethod( - Invocation.method( - #setUserContentController, - [controller], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setUserContentController, [controller]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( - Invocation.method( - #getUserContentController, - [], - ), - returnValue: _i4.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_9( - this, - Invocation.method( - #getUserContentController, - [], - ), - )), - ) as _i4.Future<_i2.WKUserContentController>); + Invocation.method(#getUserContentController, []), + returnValue: _i4.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_10( + this, + Invocation.method(#getUserContentController, []), + ), + ), + ) + as _i4.Future<_i2.WKUserContentController>); @override _i4.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method( - #setWebsiteDataStore, - [dataStore], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setWebsiteDataStore, [dataStore]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( - Invocation.method( - #getWebsiteDataStore, - [], - ), - returnValue: - _i4.Future<_i2.WKWebsiteDataStore>.value(_FakeWKWebsiteDataStore_10( - this, - Invocation.method( - #getWebsiteDataStore, - [], - ), - )), - ) as _i4.Future<_i2.WKWebsiteDataStore>); + Invocation.method(#getWebsiteDataStore, []), + returnValue: _i4.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_11( + this, + Invocation.method(#getWebsiteDataStore, []), + ), + ), + ) + as _i4.Future<_i2.WKWebsiteDataStore>); @override _i4.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method( - #setPreferences, - [preferences], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future<_i2.WKPreferences> getPreferences() => (super.noSuchMethod( - Invocation.method( - #getPreferences, - [], - ), - returnValue: _i4.Future<_i2.WKPreferences>.value(_FakeWKPreferences_4( - this, - Invocation.method( - #getPreferences, - [], - ), - )), - ) as _i4.Future<_i2.WKPreferences>); + Invocation.method(#setPreferences, [preferences]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future<_i2.WKPreferences> getPreferences() => + (super.noSuchMethod( + Invocation.method(#getPreferences, []), + returnValue: _i4.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_5( + this, + Invocation.method(#getPreferences, []), + ), + ), + ) + as _i4.Future<_i2.WKPreferences>); @override _i4.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowsInlineMediaPlayback, - [allow], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method( - #setLimitsNavigationsToAppBoundDomains, - [limit], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setMediaTypesRequiringUserActionForPlayback( - _i2.AudiovisualMediaType? type) => - (super.noSuchMethod( - Invocation.method( - #setMediaTypesRequiringUserActionForPlayback, - [type], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKWebViewConfiguration_7( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKWebViewConfiguration); + _i2.AudiovisualMediaType? type, + ) => + (super.noSuchMethod( + Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ + type, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => + (super.noSuchMethod( + Invocation.method(#getDefaultWebpagePreferences, []), + returnValue: _i4.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_12( + this, + Invocation.method(#getDefaultWebpagePreferences, []), + ), + ), + ) + as _i4.Future<_i2.WKWebpagePreferences>); + + @override + _i2.WKWebViewConfiguration pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_8( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebViewConfiguration); @override _i4.Future addObserver( @@ -1262,34 +1138,20 @@ class MockWKWebViewConfiguration extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WKWebsiteDataStore]. @@ -1302,37 +1164,37 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_11( - this, - Invocation.getter(#httpCookieStore), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => + (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_13( + this, + Invocation.getter(#httpCookieStore), + ), + ) + as _i2.WKHTTPCookieStore); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_httpCookieStore, - [], - ), - returnValue: _FakeWKHTTPCookieStore_11( - this, - Invocation.method( - #pigeonVar_httpCookieStore, - [], - ), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_13( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) + as _i2.WKHTTPCookieStore); @override _i4.Future removeDataOfTypes( @@ -1340,30 +1202,24 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method( - #removeDataOfTypes, - [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - - @override - _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKWebsiteDataStore_10( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKWebsiteDataStore); + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); + + @override + _i2.WKWebsiteDataStore pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebsiteDataStore); @override _i4.Future addObserver( @@ -1372,34 +1228,20 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WKUIDelegate]. @@ -1411,28 +1253,81 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i4.Future<_i2.PermissionDecision> Function( + _i2.WKUIDelegate, + _i2.WKWebView, + _i2.WKSecurityOrigin, + _i2.WKFrameInfo, + _i2.MediaCaptureType, + ) + get requestMediaCapturePermission => + (super.noSuchMethod( + Invocation.getter(#requestMediaCapturePermission), + returnValue: + ( + _i2.WKUIDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.WKSecurityOrigin origin, + _i2.WKFrameInfo frame, + _i2.MediaCaptureType type, + ) => _i4.Future<_i2.PermissionDecision>.value( + _i2.PermissionDecision.deny, + ), + ) + as _i4.Future<_i2.PermissionDecision> Function( + _i2.WKUIDelegate, + _i2.WKWebView, + _i2.WKSecurityOrigin, + _i2.WKFrameInfo, + _i2.MediaCaptureType, + )); + + @override + _i4.Future Function( + _i2.WKUIDelegate, + _i2.WKWebView, + String, + _i2.WKFrameInfo, + ) + get runJavaScriptConfirmPanel => + (super.noSuchMethod( + Invocation.getter(#runJavaScriptConfirmPanel), + returnValue: + ( + _i2.WKUIDelegate pigeon_instance, + _i2.WKWebView webView, + String message, + _i2.WKFrameInfo frame, + ) => _i4.Future.value(false), + ) + as _i4.Future Function( + _i2.WKUIDelegate, + _i2.WKWebView, + String, + _i2.WKFrameInfo, + )); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i2.WKUIDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKUIDelegate_12( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKUIDelegate); + _i2.WKUIDelegate pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUIDelegate_14( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKUIDelegate); @override _i4.Future addObserver( @@ -1441,34 +1336,20 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WKUserContentController]. @@ -1481,13 +1362,15 @@ class MockWKUserContentController extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i4.Future addScriptMessageHandler( @@ -1495,73 +1378,58 @@ class MockWKUserContentController extends _i1.Mock String? name, ) => (super.noSuchMethod( - Invocation.method( - #addScriptMessageHandler, - [ - handler, - name, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addScriptMessageHandler, [handler, name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( - Invocation.method( - #removeScriptMessageHandler, - [name], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeScriptMessageHandler, [name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( - Invocation.method( - #removeAllScriptMessageHandlers, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeAllScriptMessageHandlers() => + (super.noSuchMethod( + Invocation.method(#removeAllScriptMessageHandlers, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future addUserScript(_i2.WKUserScript? userScript) => (super.noSuchMethod( - Invocation.method( - #addUserScript, - [userScript], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future removeAllUserScripts() => (super.noSuchMethod( - Invocation.method( - #removeAllUserScripts, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKUserContentController_9( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKUserContentController); + Invocation.method(#addUserScript, [userScript]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future removeAllUserScripts() => + (super.noSuchMethod( + Invocation.method(#removeAllUserScripts, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.WKUserContentController pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKUserContentController); @override _i4.Future addObserver( @@ -1570,34 +1438,20 @@ class MockWKUserContentController extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [JavascriptChannelRegistry]. @@ -1610,34 +1464,24 @@ class MockJavascriptChannelRegistry extends _i1.Mock } @override - Map get channels => (super.noSuchMethod( - Invocation.getter(#channels), - returnValue: {}, - ) as Map); + Map get channels => + (super.noSuchMethod( + Invocation.getter(#channels), + returnValue: {}, + ) + as Map); @override - void onJavascriptChannelMessage( - String? channel, - String? message, - ) => + void onJavascriptChannelMessage(String? channel, String? message) => super.noSuchMethod( - Invocation.method( - #onJavascriptChannelMessage, - [ - channel, - message, - ], - ), + Invocation.method(#onJavascriptChannelMessage, [channel, message]), returnValueForMissingStub: null, ); @override void updateJavascriptChannelsFromSet(Set<_i7.JavascriptChannel>? channels) => super.noSuchMethod( - Invocation.method( - #updateJavascriptChannelsFromSet, - [channels], - ), + Invocation.method(#updateJavascriptChannelsFromSet, [channels]), returnValueForMissingStub: null, ); } @@ -1657,52 +1501,37 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock required bool? isForMainFrame, }) => (super.noSuchMethod( - Invocation.method( - #onNavigationRequest, - [], - { - #url: url, - #isForMainFrame: isForMainFrame, - }, - ), - returnValue: _i4.Future.value(false), - ) as _i4.FutureOr); + Invocation.method(#onNavigationRequest, [], { + #url: url, + #isForMainFrame: isForMainFrame, + }), + returnValue: _i4.Future.value(false), + ) + as _i4.FutureOr); @override void onPageStarted(String? url) => super.noSuchMethod( - Invocation.method( - #onPageStarted, - [url], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#onPageStarted, [url]), + returnValueForMissingStub: null, + ); @override void onPageFinished(String? url) => super.noSuchMethod( - Invocation.method( - #onPageFinished, - [url], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#onPageFinished, [url]), + returnValueForMissingStub: null, + ); @override void onProgress(int? progress) => super.noSuchMethod( - Invocation.method( - #onProgress, - [progress], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#onProgress, [progress]), + returnValueForMissingStub: null, + ); @override void onWebResourceError(_i8.WebResourceError? error) => super.noSuchMethod( - Invocation.method( - #onWebResourceError, - [error], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#onWebResourceError, [error]), + returnValueForMissingStub: null, + ); } /// A class which mocks [WebViewWidgetProxy]. @@ -1717,158 +1546,115 @@ class MockWebViewWidgetProxy extends _i1.Mock @override _i3.PlatformWebView createWebView( _i2.WKWebViewConfiguration? configuration, { + void Function(String, _i2.NSObject, Map<_i2.KeyValueChangeKey, Object?>)? + observeValue, + }) => + (super.noSuchMethod( + Invocation.method( + #createWebView, + [configuration], + {#observeValue: observeValue}, + ), + returnValue: _FakePlatformWebView_15( + this, + Invocation.method( + #createWebView, + [configuration], + {#observeValue: observeValue}, + ), + ), + ) + as _i3.PlatformWebView); + + @override + _i2.URLRequest createRequest({required String? url}) => + (super.noSuchMethod( + Invocation.method(#createRequest, [], {#url: url}), + returnValue: _FakeURLRequest_2( + this, + Invocation.method(#createRequest, [], {#url: url}), + ), + ) + as _i2.URLRequest); + + @override + _i2.WKScriptMessageHandler createScriptMessageHandler({ + required void Function( + _i2.WKScriptMessageHandler, + _i2.WKUserContentController, + _i2.WKScriptMessage, + )? + didReceiveScriptMessage, + }) => + (super.noSuchMethod( + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + returnValue: _FakeWKScriptMessageHandler_6( + this, + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + ), + ) + as _i2.WKScriptMessageHandler); + + @override + _i2.WKUIDelegate createUIDelgate({ void Function( - String, - _i2.NSObject, - Map<_i2.KeyValueChangeKey, Object?>, - )? observeValue, + _i2.WKUIDelegate, + _i2.WKWebView, + _i2.WKWebViewConfiguration, + _i2.WKNavigationAction, + )? + onCreateWebView, }) => (super.noSuchMethod( - Invocation.method( - #createWebView, - [configuration], - {#observeValue: observeValue}, - ), - returnValue: _FakePlatformWebView_13( - this, - Invocation.method( - #createWebView, - [configuration], - {#observeValue: observeValue}, - ), - ), - ) as _i3.PlatformWebView); - - @override - _i2.URLRequest createRequest({required String? url}) => (super.noSuchMethod( - Invocation.method( - #createRequest, - [], - {#url: url}, - ), - returnValue: _FakeURLRequest_2( - this, - Invocation.method( - #createRequest, - [], - {#url: url}, - ), - ), - ) as _i2.URLRequest); - - @override - _i2.WKScriptMessageHandler createScriptMessageHandler( - {required void Function( - _i2.WKScriptMessageHandler, - _i2.WKUserContentController, - _i2.WKScriptMessage, - )? didReceiveScriptMessage}) => - (super.noSuchMethod( - Invocation.method( - #createScriptMessageHandler, - [], - {#didReceiveScriptMessage: didReceiveScriptMessage}, - ), - returnValue: _FakeWKScriptMessageHandler_5( - this, - Invocation.method( - #createScriptMessageHandler, - [], - {#didReceiveScriptMessage: didReceiveScriptMessage}, - ), - ), - ) as _i2.WKScriptMessageHandler); - - @override - _i2.WKUIDelegate createUIDelgate( - {void Function( - _i2.WKUIDelegate, - _i2.WKWebView, - _i2.WKWebViewConfiguration, - _i2.WKNavigationAction, - )? onCreateWebView}) => - (super.noSuchMethod( - Invocation.method( - #createUIDelgate, - [], - {#onCreateWebView: onCreateWebView}, - ), - returnValue: _FakeWKUIDelegate_12( - this, - Invocation.method( - #createUIDelgate, - [], - {#onCreateWebView: onCreateWebView}, - ), - ), - ) as _i2.WKUIDelegate); + Invocation.method(#createUIDelgate, [], { + #onCreateWebView: onCreateWebView, + }), + returnValue: _FakeWKUIDelegate_14( + this, + Invocation.method(#createUIDelgate, [], { + #onCreateWebView: onCreateWebView, + }), + ), + ) + as _i2.WKUIDelegate); @override _i2.WKNavigationDelegate createNavigationDelegate({ - void Function( - _i2.WKNavigationDelegate, - _i2.WKWebView, - String?, - )? didFinishNavigation, - void Function( - _i2.WKNavigationDelegate, - _i2.WKWebView, - String?, - )? didStartProvisionalNavigation, + void Function(_i2.WKNavigationDelegate, _i2.WKWebView, String?)? + didFinishNavigation, + void Function(_i2.WKNavigationDelegate, _i2.WKWebView, String?)? + didStartProvisionalNavigation, required _i4.Future<_i2.NavigationActionPolicy> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.WKNavigationAction, - )? decidePolicyForNavigationAction, - void Function( - _i2.WKNavigationDelegate, - _i2.WKWebView, - _i2.NSError, - )? didFailNavigation, - void Function( - _i2.WKNavigationDelegate, - _i2.WKWebView, - _i2.NSError, - )? didFailProvisionalNavigation, - void Function( - _i2.WKNavigationDelegate, - _i2.WKWebView, - )? webViewWebContentProcessDidTerminate, + )? + decidePolicyForNavigationAction, + void Function(_i2.WKNavigationDelegate, _i2.WKWebView, _i2.NSError)? + didFailNavigation, + void Function(_i2.WKNavigationDelegate, _i2.WKWebView, _i2.NSError)? + didFailProvisionalNavigation, + void Function(_i2.WKNavigationDelegate, _i2.WKWebView)? + webViewWebContentProcessDidTerminate, required _i4.Future<_i2.NavigationResponsePolicy> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.WKNavigationResponse, - )? decidePolicyForNavigationResponse, + )? + decidePolicyForNavigationResponse, required _i4.Future<_i2.AuthenticationChallengeResponse> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.URLAuthenticationChallenge, - )? didReceiveAuthenticationChallenge, + )? + didReceiveAuthenticationChallenge, }) => (super.noSuchMethod( - Invocation.method( - #createNavigationDelegate, - [], - { - #didFinishNavigation: didFinishNavigation, - #didStartProvisionalNavigation: didStartProvisionalNavigation, - #decidePolicyForNavigationAction: decidePolicyForNavigationAction, - #didFailNavigation: didFailNavigation, - #didFailProvisionalNavigation: didFailProvisionalNavigation, - #webViewWebContentProcessDidTerminate: - webViewWebContentProcessDidTerminate, - #decidePolicyForNavigationResponse: - decidePolicyForNavigationResponse, - #didReceiveAuthenticationChallenge: - didReceiveAuthenticationChallenge, - }, - ), - returnValue: _FakeWKNavigationDelegate_3( - this, - Invocation.method( - #createNavigationDelegate, - [], - { + Invocation.method(#createNavigationDelegate, [], { #didFinishNavigation: didFinishNavigation, #didStartProvisionalNavigation: didStartProvisionalNavigation, #decidePolicyForNavigationAction: decidePolicyForNavigationAction, @@ -1880,8 +1666,24 @@ class MockWebViewWidgetProxy extends _i1.Mock decidePolicyForNavigationResponse, #didReceiveAuthenticationChallenge: didReceiveAuthenticationChallenge, - }, - ), - ), - ) as _i2.WKNavigationDelegate); + }), + returnValue: _FakeWKNavigationDelegate_4( + this, + Invocation.method(#createNavigationDelegate, [], { + #didFinishNavigation: didFinishNavigation, + #didStartProvisionalNavigation: didStartProvisionalNavigation, + #decidePolicyForNavigationAction: + decidePolicyForNavigationAction, + #didFailNavigation: didFailNavigation, + #didFailProvisionalNavigation: didFailProvisionalNavigation, + #webViewWebContentProcessDidTerminate: + webViewWebContentProcessDidTerminate, + #decidePolicyForNavigationResponse: + decidePolicyForNavigationResponse, + #didReceiveAuthenticationChallenge: + didReceiveAuthenticationChallenge, + }), + ), + ) + as _i2.WKNavigationDelegate); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart index d30c175724e..d1d901a7228 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart. // Do not manually edit this file. @@ -18,6 +18,7 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -25,55 +26,30 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeURLProtectionSpace_1 extends _i1.SmartFake implements _i2.URLProtectionSpace { - _FakeURLProtectionSpace_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeURLProtectionSpace_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeURLAuthenticationChallenge_2 extends _i1.SmartFake implements _i2.URLAuthenticationChallenge { - _FakeURLAuthenticationChallenge_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeURLAuthenticationChallenge_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeURLRequest_3 extends _i1.SmartFake implements _i2.URLRequest { - _FakeURLRequest_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeURLRequest_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeURL_4 extends _i1.SmartFake implements _i2.URL { - _FakeURL_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeURL_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [URLAuthenticationChallenge]. @@ -86,45 +62,39 @@ class MockURLAuthenticationChallenge extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i3.Future<_i2.URLProtectionSpace> getProtectionSpace() => (super.noSuchMethod( - Invocation.method( - #getProtectionSpace, - [], - ), - returnValue: - _i3.Future<_i2.URLProtectionSpace>.value(_FakeURLProtectionSpace_1( - this, - Invocation.method( - #getProtectionSpace, - [], - ), - )), - ) as _i3.Future<_i2.URLProtectionSpace>); + Invocation.method(#getProtectionSpace, []), + returnValue: _i3.Future<_i2.URLProtectionSpace>.value( + _FakeURLProtectionSpace_1( + this, + Invocation.method(#getProtectionSpace, []), + ), + ), + ) + as _i3.Future<_i2.URLProtectionSpace>); @override - _i2.URLAuthenticationChallenge pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeURLAuthenticationChallenge_2( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.URLAuthenticationChallenge); + _i2.URLAuthenticationChallenge pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURLAuthenticationChallenge_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.URLAuthenticationChallenge); @override _i3.Future addObserver( @@ -133,34 +103,20 @@ class MockURLAuthenticationChallenge extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [URLRequest]. @@ -172,96 +128,85 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i3.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); + _i3.Future getUrl() => + (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future setHttpMethod(String? method) => (super.noSuchMethod( - Invocation.method( - #setHttpMethod, - [method], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future setHttpMethod(String? method) => + (super.noSuchMethod( + Invocation.method(#setHttpMethod, [method]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future getHttpMethod() => (super.noSuchMethod( - Invocation.method( - #getHttpMethod, - [], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); + _i3.Future getHttpMethod() => + (super.noSuchMethod( + Invocation.method(#getHttpMethod, []), + returnValue: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future setHttpBody(_i4.Uint8List? body) => (super.noSuchMethod( - Invocation.method( - #setHttpBody, - [body], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future setHttpBody(_i4.Uint8List? body) => + (super.noSuchMethod( + Invocation.method(#setHttpBody, [body]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future<_i4.Uint8List?> getHttpBody() => (super.noSuchMethod( - Invocation.method( - #getHttpBody, - [], - ), - returnValue: _i3.Future<_i4.Uint8List?>.value(), - ) as _i3.Future<_i4.Uint8List?>); + _i3.Future<_i4.Uint8List?> getHttpBody() => + (super.noSuchMethod( + Invocation.method(#getHttpBody, []), + returnValue: _i3.Future<_i4.Uint8List?>.value(), + ) + as _i3.Future<_i4.Uint8List?>); @override _i3.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method( - #setAllHttpHeaderFields, - [fields], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setAllHttpHeaderFields, [fields]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future?> getAllHttpHeaderFields() => (super.noSuchMethod( - Invocation.method( - #getAllHttpHeaderFields, - [], - ), - returnValue: _i3.Future?>.value(), - ) as _i3.Future?>); + Invocation.method(#getAllHttpHeaderFields, []), + returnValue: _i3.Future?>.value(), + ) + as _i3.Future?>); @override - _i2.URLRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeURLRequest_3( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.URLRequest); + _i2.URLRequest pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURLRequest_3( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.URLRequest); @override _i3.Future addObserver( @@ -270,34 +215,20 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [URL]. @@ -309,43 +240,36 @@ class MockURL extends _i1.Mock implements _i2.URL { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i3.Future getAbsoluteString() => (super.noSuchMethod( - Invocation.method( - #getAbsoluteString, - [], - ), - returnValue: _i3.Future.value(_i5.dummyValue( - this, - Invocation.method( - #getAbsoluteString, - [], - ), - )), - ) as _i3.Future); + _i3.Future getAbsoluteString() => + (super.noSuchMethod( + Invocation.method(#getAbsoluteString, []), + returnValue: _i3.Future.value( + _i5.dummyValue( + this, + Invocation.method(#getAbsoluteString, []), + ), + ), + ) + as _i3.Future); @override - _i2.URL pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeURL_4( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.URL); + _i2.URL pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURL_4(this, Invocation.method(#pigeon_copy, [])), + ) + as _i2.URL); @override _i3.Future addObserver( @@ -354,32 +278,18 @@ class MockURL extends _i1.Mock implements _i2.URL { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart index 647454d1aa3..798fe7bd444 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart @@ -30,6 +30,7 @@ import 'webkit_webview_controller_test.mocks.dart'; MockSpec(), MockSpec(), MockSpec(), + MockSpec(), MockSpec(), MockSpec(), ]) @@ -56,6 +57,7 @@ void main() { MockWKWebViewConfiguration? mockWebViewConfiguration, MockURLRequest Function({required String url})? createURLRequest, PigeonInstanceManager? instanceManager, + MockWKWebpagePreferences? mockWebpagePreferences, }) { final MockWKWebViewConfiguration nonNullMockWebViewConfiguration = mockWebViewConfiguration ?? MockWKWebViewConfiguration(); @@ -185,6 +187,10 @@ void main() { mockPreferences ?? MockWKPreferences(), ), ); + when(nonNullMockWebViewConfiguration.getDefaultWebpagePreferences()) + .thenAnswer( + (_) async => mockWebpagePreferences ?? MockWKWebpagePreferences(), + ); when(nonNullMockWebViewConfiguration.getUserContentController()) .thenAnswer( (_) => Future.value( @@ -735,27 +741,49 @@ void main() { }); test('enable JavaScript', () async { - final MockWKPreferences mockPreferences = MockWKPreferences(); + final MockWKWebpagePreferences mockWebpagePreferences = + MockWKWebpagePreferences(); final WebKitWebViewController controller = createControllerWithMocks( - mockPreferences: mockPreferences, + mockWebpagePreferences: mockWebpagePreferences, ); await controller.setJavaScriptMode(JavaScriptMode.unrestricted); - verify(mockPreferences.setJavaScriptEnabled(true)); + verify(mockWebpagePreferences.setAllowsContentJavaScript(true)); }); test('disable JavaScript', () async { + final MockWKWebpagePreferences mockWebpagePreferences = + MockWKWebpagePreferences(); + + final WebKitWebViewController controller = createControllerWithMocks( + mockWebpagePreferences: mockWebpagePreferences, + ); + + await controller.setJavaScriptMode(JavaScriptMode.disabled); + + verify(mockWebpagePreferences.setAllowsContentJavaScript(false)); + }); + + test( + 'enable JavaScript calls WKPreferences.setJavaScriptEnabled for lower versions', + () async { final MockWKPreferences mockPreferences = MockWKPreferences(); + final MockWKWebpagePreferences mockWebpagePreferences = + MockWKWebpagePreferences(); + when(mockWebpagePreferences.setAllowsContentJavaScript(any)).thenThrow( + PlatformException(code: 'PigeonUnsupportedOperationError'), + ); final WebKitWebViewController controller = createControllerWithMocks( mockPreferences: mockPreferences, + mockWebpagePreferences: mockWebpagePreferences, ); - await controller.setJavaScriptMode(JavaScriptMode.disabled); + await controller.setJavaScriptMode(JavaScriptMode.unrestricted); - verify(mockPreferences.setJavaScriptEnabled(false)); + verify(mockPreferences.setJavaScriptEnabled(true)); }); test('clearCache', () { diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart index 51b9e2ae9e4..d18ea83db19 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_wkwebview/test/webkit_webview_controller_test.dart. // Do not manually edit this file. @@ -18,6 +18,7 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -25,150 +26,86 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeUIScrollView_1 extends _i1.SmartFake implements _i2.UIScrollView { - _FakeUIScrollView_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeUIScrollView_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeUIScrollViewDelegate_2 extends _i1.SmartFake implements _i2.UIScrollViewDelegate { - _FakeUIScrollViewDelegate_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeUIScrollViewDelegate_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeURL_3 extends _i1.SmartFake implements _i2.URL { - _FakeURL_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeURL_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeURLRequest_4 extends _i1.SmartFake implements _i2.URLRequest { - _FakeURLRequest_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeURLRequest_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKPreferences_5 extends _i1.SmartFake implements _i2.WKPreferences { - _FakeWKPreferences_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKPreferences_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKScriptMessageHandler_6 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { - _FakeWKScriptMessageHandler_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKScriptMessageHandler_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKUserContentController_7 extends _i1.SmartFake implements _i2.WKUserContentController { - _FakeWKUserContentController_7( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKUserContentController_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKUserScript_8 extends _i1.SmartFake implements _i2.WKUserScript { - _FakeWKUserScript_8( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKUserScript_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKWebView_9 extends _i1.SmartFake implements _i2.WKWebView { - _FakeWKWebView_9( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebView_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKWebsiteDataStore_10 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_10( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebsiteDataStore_10(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebViewConfiguration_11 extends _i1.SmartFake +class _FakeWKWebpagePreferences_11 extends _i1.SmartFake + implements _i2.WKWebpagePreferences { + _FakeWKWebpagePreferences_11(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWKWebViewConfiguration_12 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { - _FakeWKWebViewConfiguration_11( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebViewConfiguration_12(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeUIViewWKWebView_12 extends _i1.SmartFake +class _FakeUIViewWKWebView_13 extends _i1.SmartFake implements _i2.UIViewWKWebView { - _FakeUIViewWKWebView_12( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeUIViewWKWebView_13(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKHTTPCookieStore_13 extends _i1.SmartFake +class _FakeWKHTTPCookieStore_14 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { - _FakeWKHTTPCookieStore_13( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKHTTPCookieStore_14(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [UIScrollView]. @@ -176,114 +113,135 @@ class _FakeWKHTTPCookieStore_13 extends _i1.SmartFake /// See the documentation for Mockito's code generation for more information. class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i3.Future> getContentOffset() => (super.noSuchMethod( - Invocation.method( - #getContentOffset, - [], - ), - returnValue: _i3.Future>.value([]), - returnValueForMissingStub: _i3.Future>.value([]), - ) as _i3.Future>); - - @override - _i3.Future scrollBy( - double? x, - double? y, - ) => + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future setContentOffset( - double? x, - double? y, - ) => + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i3.Future> getContentOffset() => + (super.noSuchMethod( + Invocation.method(#getContentOffset, []), + returnValue: _i3.Future>.value([]), + returnValueForMissingStub: _i3.Future>.value( + [], + ), + ) + as _i3.Future>); + + @override + _i3.Future scrollBy(double? x, double? y) => (super.noSuchMethod( - Invocation.method( - #setContentOffset, - [ - x, - y, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#scrollBy, [x, y]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setContentOffset(double? x, double? y) => + (super.noSuchMethod( + Invocation.method(#setContentOffset, [x, y]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future setDelegate(_i2.UIScrollViewDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #setDelegate, - [delegate], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i2.UIScrollView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeUIScrollView_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeUIScrollView_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.UIScrollView); - - @override - _i3.Future setBackgroundColor(int? value) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [value], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method( - #setOpaque, - [opaque], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setDelegate, [delegate]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setBounces(bool? value) => + (super.noSuchMethod( + Invocation.method(#setBounces, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setBouncesHorizontally(bool? value) => + (super.noSuchMethod( + Invocation.method(#setBouncesHorizontally, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setBouncesVertically(bool? value) => + (super.noSuchMethod( + Invocation.method(#setBouncesVertically, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setAlwaysBounceVertical(bool? value) => + (super.noSuchMethod( + Invocation.method(#setAlwaysBounceVertical, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setAlwaysBounceHorizontal(bool? value) => + (super.noSuchMethod( + Invocation.method(#setAlwaysBounceHorizontal, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i2.UIScrollView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIScrollView_1( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeUIScrollView_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.UIScrollView); + + @override + _i3.Future setBackgroundColor(int? value) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setOpaque(bool? opaque) => + (super.noSuchMethod( + Invocation.method(#setOpaque, [opaque]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future addObserver( @@ -292,34 +250,20 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [UIScrollViewDelegate]. @@ -328,39 +272,34 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { class MockUIScrollViewDelegate extends _i1.Mock implements _i2.UIScrollViewDelegate { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.UIScrollViewDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeUIScrollViewDelegate_2( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeUIScrollViewDelegate_2( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.UIScrollViewDelegate); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.UIScrollViewDelegate pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIScrollViewDelegate_2( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeUIScrollViewDelegate_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.UIScrollViewDelegate); @override _i3.Future addObserver( @@ -369,34 +308,20 @@ class MockUIScrollViewDelegate extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [URL]. @@ -404,62 +329,50 @@ class MockUIScrollViewDelegate extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockURL extends _i1.Mock implements _i2.URL { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i3.Future getAbsoluteString() => (super.noSuchMethod( - Invocation.method( - #getAbsoluteString, - [], - ), - returnValue: _i3.Future.value(_i4.dummyValue( - this, - Invocation.method( - #getAbsoluteString, - [], - ), - )), - returnValueForMissingStub: - _i3.Future.value(_i4.dummyValue( - this, - Invocation.method( - #getAbsoluteString, - [], - ), - )), - ) as _i3.Future); - - @override - _i2.URL pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeURL_3( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeURL_3( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.URL); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i3.Future getAbsoluteString() => + (super.noSuchMethod( + Invocation.method(#getAbsoluteString, []), + returnValue: _i3.Future.value( + _i4.dummyValue( + this, + Invocation.method(#getAbsoluteString, []), + ), + ), + returnValueForMissingStub: _i3.Future.value( + _i4.dummyValue( + this, + Invocation.method(#getAbsoluteString, []), + ), + ), + ) + as _i3.Future); + + @override + _i2.URL pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURL_3(this, Invocation.method(#pigeon_copy, [])), + returnValueForMissingStub: _FakeURL_3( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.URL); @override _i3.Future addObserver( @@ -468,34 +381,20 @@ class MockURL extends _i1.Mock implements _i2.URL { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [URLRequest]. @@ -503,111 +402,97 @@ class MockURL extends _i1.Mock implements _i2.URL { /// See the documentation for Mockito's code generation for more information. class MockURLRequest extends _i1.Mock implements _i2.URLRequest { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i3.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future setHttpMethod(String? method) => (super.noSuchMethod( - Invocation.method( - #setHttpMethod, - [method], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future getHttpMethod() => (super.noSuchMethod( - Invocation.method( - #getHttpMethod, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future setHttpBody(_i5.Uint8List? body) => (super.noSuchMethod( - Invocation.method( - #setHttpBody, - [body], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future<_i5.Uint8List?> getHttpBody() => (super.noSuchMethod( - Invocation.method( - #getHttpBody, - [], - ), - returnValue: _i3.Future<_i5.Uint8List?>.value(), - returnValueForMissingStub: _i3.Future<_i5.Uint8List?>.value(), - ) as _i3.Future<_i5.Uint8List?>); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i3.Future getUrl() => + (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setHttpMethod(String? method) => + (super.noSuchMethod( + Invocation.method(#setHttpMethod, [method]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future getHttpMethod() => + (super.noSuchMethod( + Invocation.method(#getHttpMethod, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setHttpBody(_i5.Uint8List? body) => + (super.noSuchMethod( + Invocation.method(#setHttpBody, [body]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future<_i5.Uint8List?> getHttpBody() => + (super.noSuchMethod( + Invocation.method(#getHttpBody, []), + returnValue: _i3.Future<_i5.Uint8List?>.value(), + returnValueForMissingStub: _i3.Future<_i5.Uint8List?>.value(), + ) + as _i3.Future<_i5.Uint8List?>); @override _i3.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method( - #setAllHttpHeaderFields, - [fields], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setAllHttpHeaderFields, [fields]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future?> getAllHttpHeaderFields() => (super.noSuchMethod( - Invocation.method( - #getAllHttpHeaderFields, - [], - ), - returnValue: _i3.Future?>.value(), - returnValueForMissingStub: _i3.Future?>.value(), - ) as _i3.Future?>); - - @override - _i2.URLRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeURLRequest_4( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeURLRequest_4( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.URLRequest); + Invocation.method(#getAllHttpHeaderFields, []), + returnValue: _i3.Future?>.value(), + returnValueForMissingStub: _i3.Future?>.value(), + ) + as _i3.Future?>); + + @override + _i2.URLRequest pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURLRequest_4( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeURLRequest_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.URLRequest); @override _i3.Future addObserver( @@ -616,34 +501,20 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKPreferences]. @@ -651,49 +522,43 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { /// See the documentation for Mockito's code generation for more information. class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i3.Future setJavaScriptEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptEnabled, - [enabled], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKPreferences_5( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWKPreferences_5( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKPreferences); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i3.Future setJavaScriptEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [enabled]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i2.WKPreferences pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_5( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKPreferences_5( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKPreferences); @override _i3.Future addObserver( @@ -702,34 +567,20 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKScriptMessageHandler]. @@ -742,58 +593,58 @@ class MockWKScriptMessageHandler extends _i1.Mock _i2.WKScriptMessageHandler, _i2.WKUserContentController, _i2.WKScriptMessage, - ) get didReceiveScriptMessage => (super.noSuchMethod( - Invocation.getter(#didReceiveScriptMessage), - returnValue: ( - _i2.WKScriptMessageHandler pigeon_instance, - _i2.WKUserContentController controller, - _i2.WKScriptMessage message, - ) {}, - returnValueForMissingStub: ( - _i2.WKScriptMessageHandler pigeon_instance, - _i2.WKUserContentController controller, - _i2.WKScriptMessage message, - ) {}, - ) as void Function( - _i2.WKScriptMessageHandler, - _i2.WKUserContentController, - _i2.WKScriptMessage, - )); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.WKScriptMessageHandler pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKScriptMessageHandler_6( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWKScriptMessageHandler_6( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKScriptMessageHandler); + ) + get didReceiveScriptMessage => + (super.noSuchMethod( + Invocation.getter(#didReceiveScriptMessage), + returnValue: + ( + _i2.WKScriptMessageHandler pigeon_instance, + _i2.WKUserContentController controller, + _i2.WKScriptMessage message, + ) {}, + returnValueForMissingStub: + ( + _i2.WKScriptMessageHandler pigeon_instance, + _i2.WKUserContentController controller, + _i2.WKScriptMessage message, + ) {}, + ) + as void Function( + _i2.WKScriptMessageHandler, + _i2.WKUserContentController, + _i2.WKScriptMessage, + )); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WKScriptMessageHandler pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKScriptMessageHandler_6( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKScriptMessageHandler_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKScriptMessageHandler); @override _i3.Future addObserver( @@ -802,34 +653,20 @@ class MockWKScriptMessageHandler extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKUserContentController]. @@ -838,17 +675,19 @@ class MockWKScriptMessageHandler extends _i1.Mock class MockWKUserContentController extends _i1.Mock implements _i2.WKUserContentController { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i3.Future addScriptMessageHandler( @@ -856,80 +695,62 @@ class MockWKUserContentController extends _i1.Mock String? name, ) => (super.noSuchMethod( - Invocation.method( - #addScriptMessageHandler, - [ - handler, - name, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addScriptMessageHandler, [handler, name]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( - Invocation.method( - #removeScriptMessageHandler, - [name], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeScriptMessageHandler, [name]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( - Invocation.method( - #removeAllScriptMessageHandlers, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future removeAllScriptMessageHandlers() => + (super.noSuchMethod( + Invocation.method(#removeAllScriptMessageHandlers, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future addUserScript(_i2.WKUserScript? userScript) => (super.noSuchMethod( - Invocation.method( - #addUserScript, - [userScript], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future removeAllUserScripts() => (super.noSuchMethod( - Invocation.method( - #removeAllUserScripts, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKUserContentController_7( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWKUserContentController_7( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKUserContentController); + Invocation.method(#addUserScript, [userScript]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future removeAllUserScripts() => + (super.noSuchMethod( + Invocation.method(#removeAllUserScripts, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i2.WKUserContentController pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_7( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKUserContentController_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKUserContentController); @override _i3.Future addObserver( @@ -938,34 +759,20 @@ class MockWKUserContentController extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKUserScript]. @@ -973,66 +780,68 @@ class MockWKUserContentController extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockWKUserScript extends _i1.Mock implements _i2.WKUserScript { @override - String get source => (super.noSuchMethod( - Invocation.getter(#source), - returnValue: _i4.dummyValue( - this, - Invocation.getter(#source), - ), - returnValueForMissingStub: _i4.dummyValue( - this, - Invocation.getter(#source), - ), - ) as String); - - @override - _i2.UserScriptInjectionTime get injectionTime => (super.noSuchMethod( - Invocation.getter(#injectionTime), - returnValue: _i2.UserScriptInjectionTime.atDocumentStart, - returnValueForMissingStub: _i2.UserScriptInjectionTime.atDocumentStart, - ) as _i2.UserScriptInjectionTime); - - @override - bool get isForMainFrameOnly => (super.noSuchMethod( - Invocation.getter(#isForMainFrameOnly), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.WKUserScript pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKUserScript_8( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWKUserScript_8( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKUserScript); + String get source => + (super.noSuchMethod( + Invocation.getter(#source), + returnValue: _i4.dummyValue( + this, + Invocation.getter(#source), + ), + returnValueForMissingStub: _i4.dummyValue( + this, + Invocation.getter(#source), + ), + ) + as String); + + @override + _i2.UserScriptInjectionTime get injectionTime => + (super.noSuchMethod( + Invocation.getter(#injectionTime), + returnValue: _i2.UserScriptInjectionTime.atDocumentStart, + returnValueForMissingStub: + _i2.UserScriptInjectionTime.atDocumentStart, + ) + as _i2.UserScriptInjectionTime); + + @override + bool get isForMainFrameOnly => + (super.noSuchMethod( + Invocation.getter(#isForMainFrameOnly), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WKUserScript pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserScript_8( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKUserScript_8( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKUserScript); @override _i3.Future addObserver( @@ -1041,34 +850,20 @@ class MockWKUserScript extends _i1.Mock implements _i2.WKUserScript { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKWebView]. @@ -1076,39 +871,34 @@ class MockWKUserScript extends _i1.Mock implements _i2.WKUserScript { /// See the documentation for Mockito's code generation for more information. class MockWKWebView extends _i1.Mock implements _i2.WKWebView { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.WKWebView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKWebView_9( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWKWebView_9( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKWebView); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WKWebView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebView_9( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKWebView_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebView); @override _i3.Future addObserver( @@ -1117,34 +907,20 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKWebViewConfiguration]. @@ -1153,181 +929,172 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { class MockWKWebViewConfiguration extends _i1.Mock implements _i2.WKWebViewConfiguration { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i3.Future setUserContentController( - _i2.WKUserContentController? controller) => + _i2.WKUserContentController? controller, + ) => (super.noSuchMethod( - Invocation.method( - #setUserContentController, - [controller], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setUserContentController, [controller]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( - Invocation.method( - #getUserContentController, - [], - ), - returnValue: _i3.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_7( - this, - Invocation.method( - #getUserContentController, - [], - ), - )), - returnValueForMissingStub: - _i3.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_7( - this, - Invocation.method( - #getUserContentController, - [], - ), - )), - ) as _i3.Future<_i2.WKUserContentController>); + Invocation.method(#getUserContentController, []), + returnValue: _i3.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_7( + this, + Invocation.method(#getUserContentController, []), + ), + ), + returnValueForMissingStub: + _i3.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_7( + this, + Invocation.method(#getUserContentController, []), + ), + ), + ) + as _i3.Future<_i2.WKUserContentController>); @override _i3.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method( - #setWebsiteDataStore, - [dataStore], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setWebsiteDataStore, [dataStore]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( - Invocation.method( - #getWebsiteDataStore, - [], - ), - returnValue: - _i3.Future<_i2.WKWebsiteDataStore>.value(_FakeWKWebsiteDataStore_10( - this, - Invocation.method( - #getWebsiteDataStore, - [], - ), - )), - returnValueForMissingStub: - _i3.Future<_i2.WKWebsiteDataStore>.value(_FakeWKWebsiteDataStore_10( - this, - Invocation.method( - #getWebsiteDataStore, - [], - ), - )), - ) as _i3.Future<_i2.WKWebsiteDataStore>); + Invocation.method(#getWebsiteDataStore, []), + returnValue: _i3.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_10( + this, + Invocation.method(#getWebsiteDataStore, []), + ), + ), + returnValueForMissingStub: _i3.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_10( + this, + Invocation.method(#getWebsiteDataStore, []), + ), + ), + ) + as _i3.Future<_i2.WKWebsiteDataStore>); @override _i3.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method( - #setPreferences, - [preferences], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future<_i2.WKPreferences> getPreferences() => (super.noSuchMethod( - Invocation.method( - #getPreferences, - [], - ), - returnValue: _i3.Future<_i2.WKPreferences>.value(_FakeWKPreferences_5( - this, - Invocation.method( - #getPreferences, - [], - ), - )), - returnValueForMissingStub: - _i3.Future<_i2.WKPreferences>.value(_FakeWKPreferences_5( - this, - Invocation.method( - #getPreferences, - [], - ), - )), - ) as _i3.Future<_i2.WKPreferences>); + Invocation.method(#setPreferences, [preferences]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future<_i2.WKPreferences> getPreferences() => + (super.noSuchMethod( + Invocation.method(#getPreferences, []), + returnValue: _i3.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_5( + this, + Invocation.method(#getPreferences, []), + ), + ), + returnValueForMissingStub: _i3.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_5( + this, + Invocation.method(#getPreferences, []), + ), + ), + ) + as _i3.Future<_i2.WKPreferences>); @override _i3.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowsInlineMediaPlayback, - [allow], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method( - #setLimitsNavigationsToAppBoundDomains, - [limit], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future setMediaTypesRequiringUserActionForPlayback( - _i2.AudiovisualMediaType? type) => - (super.noSuchMethod( - Invocation.method( - #setMediaTypesRequiringUserActionForPlayback, - [type], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKWebViewConfiguration_11( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWKWebViewConfiguration_11( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKWebViewConfiguration); + _i2.AudiovisualMediaType? type, + ) => + (super.noSuchMethod( + Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ + type, + ]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => + (super.noSuchMethod( + Invocation.method(#getDefaultWebpagePreferences, []), + returnValue: _i3.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_11( + this, + Invocation.method(#getDefaultWebpagePreferences, []), + ), + ), + returnValueForMissingStub: + _i3.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_11( + this, + Invocation.method(#getDefaultWebpagePreferences, []), + ), + ), + ) + as _i3.Future<_i2.WKWebpagePreferences>); + + @override + _i2.WKWebViewConfiguration pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebViewConfiguration); @override _i3.Future addObserver( @@ -1336,34 +1103,87 @@ class MockWKWebViewConfiguration extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + (super.noSuchMethod( + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); +} + +/// A class which mocks [WKWebpagePreferences]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWKWebpagePreferences extends _i1.Mock + implements _i2.WKWebpagePreferences { + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i3.Future setAllowsContentJavaScript(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowsContentJavaScript, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i2.WKWebpagePreferences pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebpagePreferences_11( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKWebpagePreferences_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebpagePreferences); + + @override + _i3.Future addObserver( _i2.NSObject? observer, String? keyPath, + List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + (super.noSuchMethod( + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [UIViewWKWebView]. @@ -1371,337 +1191,283 @@ class MockWKWebViewConfiguration extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override - _i2.WKWebViewConfiguration get configuration => (super.noSuchMethod( - Invocation.getter(#configuration), - returnValue: _FakeWKWebViewConfiguration_11( - this, - Invocation.getter(#configuration), - ), - returnValueForMissingStub: _FakeWKWebViewConfiguration_11( - this, - Invocation.getter(#configuration), - ), - ) as _i2.WKWebViewConfiguration); - - @override - _i2.UIScrollView get scrollView => (super.noSuchMethod( - Invocation.getter(#scrollView), - returnValue: _FakeUIScrollView_1( - this, - Invocation.getter(#scrollView), - ), - returnValueForMissingStub: _FakeUIScrollView_1( - this, - Invocation.getter(#scrollView), - ), - ) as _i2.UIScrollView); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.WKWebViewConfiguration pigeonVar_configuration() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_configuration, - [], - ), - returnValue: _FakeWKWebViewConfiguration_11( - this, - Invocation.method( - #pigeonVar_configuration, - [], - ), - ), - returnValueForMissingStub: _FakeWKWebViewConfiguration_11( - this, - Invocation.method( - #pigeonVar_configuration, - [], - ), - ), - ) as _i2.WKWebViewConfiguration); - - @override - _i2.UIScrollView pigeonVar_scrollView() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_scrollView, - [], - ), - returnValue: _FakeUIScrollView_1( - this, - Invocation.method( - #pigeonVar_scrollView, - [], - ), - ), - returnValueForMissingStub: _FakeUIScrollView_1( - this, - Invocation.method( - #pigeonVar_scrollView, - [], - ), - ), - ) as _i2.UIScrollView); + _i2.WKWebViewConfiguration get configuration => + (super.noSuchMethod( + Invocation.getter(#configuration), + returnValue: _FakeWKWebViewConfiguration_12( + this, + Invocation.getter(#configuration), + ), + returnValueForMissingStub: _FakeWKWebViewConfiguration_12( + this, + Invocation.getter(#configuration), + ), + ) + as _i2.WKWebViewConfiguration); + + @override + _i2.UIScrollView get scrollView => + (super.noSuchMethod( + Invocation.getter(#scrollView), + returnValue: _FakeUIScrollView_1( + this, + Invocation.getter(#scrollView), + ), + returnValueForMissingStub: _FakeUIScrollView_1( + this, + Invocation.getter(#scrollView), + ), + ) + as _i2.UIScrollView); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WKWebViewConfiguration pigeonVar_configuration() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_configuration, []), + returnValue: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeonVar_configuration, []), + ), + returnValueForMissingStub: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeonVar_configuration, []), + ), + ) + as _i2.WKWebViewConfiguration); + + @override + _i2.UIScrollView pigeonVar_scrollView() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_scrollView, []), + returnValue: _FakeUIScrollView_1( + this, + Invocation.method(#pigeonVar_scrollView, []), + ), + returnValueForMissingStub: _FakeUIScrollView_1( + this, + Invocation.method(#pigeonVar_scrollView, []), + ), + ) + as _i2.UIScrollView); @override _i3.Future setUIDelegate(_i2.WKUIDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #setUIDelegate, - [delegate], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setUIDelegate, [delegate]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future setNavigationDelegate(_i2.WKNavigationDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #setNavigationDelegate, - [delegate], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future getEstimatedProgress() => (super.noSuchMethod( - Invocation.method( - #getEstimatedProgress, - [], - ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); - - @override - _i3.Future load(_i2.URLRequest? request) => (super.noSuchMethod( - Invocation.method( - #load, - [request], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future loadHtmlString( - String? string, - String? baseUrl, - ) => + Invocation.method(#setNavigationDelegate, [delegate]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [ - string, - baseUrl, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future loadFileUrl( - String? url, - String? readAccessUrl, - ) => + Invocation.method(#getUrl, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future getEstimatedProgress() => + (super.noSuchMethod( + Invocation.method(#getEstimatedProgress, []), + returnValue: _i3.Future.value(0.0), + returnValueForMissingStub: _i3.Future.value(0.0), + ) + as _i3.Future); + + @override + _i3.Future load(_i2.URLRequest? request) => + (super.noSuchMethod( + Invocation.method(#load, [request]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future loadHtmlString(String? string, String? baseUrl) => + (super.noSuchMethod( + Invocation.method(#loadHtmlString, [string, baseUrl]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future loadFileUrl(String? url, String? readAccessUrl) => + (super.noSuchMethod( + Invocation.method(#loadFileUrl, [url, readAccessUrl]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i3.Future.value(false), + returnValueForMissingStub: _i3.Future.value(false), + ) + as _i3.Future); + + @override + _i3.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #loadFileUrl, - [ - url, - readAccessUrl, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i3.Future.value(false), - returnValueForMissingStub: _i3.Future.value(false), - ) as _i3.Future); - - @override - _i3.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i3.Future.value(false), - returnValueForMissingStub: _i3.Future.value(false), - ) as _i3.Future); - - @override - _i3.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#canGoForward, []), + returnValue: _i3.Future.value(false), + returnValueForMissingStub: _i3.Future.value(false), + ) + as _i3.Future); + + @override + _i3.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowsBackForwardNavigationGestures, - [allow], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setAllowsBackForwardNavigationGestures, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setCustomUserAgent, - [userAgent], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future setCustomUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setCustomUserAgent, [userAgent]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future evaluateJavaScript(String? javaScriptString) => (super.noSuchMethod( - Invocation.method( - #evaluateJavaScript, - [javaScriptString], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future setInspectable(bool? inspectable) => (super.noSuchMethod( - Invocation.method( - #setInspectable, - [inspectable], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future getCustomUserAgent() => (super.noSuchMethod( - Invocation.method( - #getCustomUserAgent, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i2.UIViewWKWebView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeUIViewWKWebView_12( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeUIViewWKWebView_12( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.UIViewWKWebView); - - @override - _i3.Future setBackgroundColor(int? value) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [value], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - - @override - _i3.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method( - #setOpaque, - [opaque], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#evaluateJavaScript, [javaScriptString]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setInspectable(bool? inspectable) => + (super.noSuchMethod( + Invocation.method(#setInspectable, [inspectable]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future getCustomUserAgent() => + (super.noSuchMethod( + Invocation.method(#getCustomUserAgent, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i2.UIViewWKWebView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIViewWKWebView_13( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeUIViewWKWebView_13( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.UIViewWKWebView); + + @override + _i3.Future setBackgroundColor(int? value) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); + + @override + _i3.Future setOpaque(bool? opaque) => + (super.noSuchMethod( + Invocation.method(#setOpaque, [opaque]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future addObserver( @@ -1710,34 +1476,20 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKWebsiteDataStore]. @@ -1746,52 +1498,49 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { class MockWKWebsiteDataStore extends _i1.Mock implements _i2.WKWebsiteDataStore { @override - _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_13( - this, - Invocation.getter(#httpCookieStore), - ), - returnValueForMissingStub: _FakeWKHTTPCookieStore_13( - this, - Invocation.getter(#httpCookieStore), - ), - ) as _i2.WKHTTPCookieStore); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_httpCookieStore, - [], - ), - returnValue: _FakeWKHTTPCookieStore_13( - this, - Invocation.method( - #pigeonVar_httpCookieStore, - [], - ), - ), - returnValueForMissingStub: _FakeWKHTTPCookieStore_13( - this, - Invocation.method( - #pigeonVar_httpCookieStore, - [], - ), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => + (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_14( + this, + Invocation.getter(#httpCookieStore), + ), + returnValueForMissingStub: _FakeWKHTTPCookieStore_14( + this, + Invocation.getter(#httpCookieStore), + ), + ) + as _i2.WKHTTPCookieStore); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_14( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + returnValueForMissingStub: _FakeWKHTTPCookieStore_14( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) + as _i2.WKHTTPCookieStore); @override _i3.Future removeDataOfTypes( @@ -1799,38 +1548,29 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method( - #removeDataOfTypes, - [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ], - ), - returnValue: _i3.Future.value(false), - returnValueForMissingStub: _i3.Future.value(false), - ) as _i3.Future); - - @override - _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKWebsiteDataStore_10( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWKWebsiteDataStore_10( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKWebsiteDataStore); + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), + returnValue: _i3.Future.value(false), + returnValueForMissingStub: _i3.Future.value(false), + ) + as _i3.Future); + + @override + _i2.WKWebsiteDataStore pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_10( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKWebsiteDataStore_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebsiteDataStore); @override _i3.Future addObserver( @@ -1839,32 +1579,18 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart index ce95b63531d..ce8c5682afc 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.dart. // Do not manually edit this file. @@ -16,6 +16,7 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -23,35 +24,20 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakeWKHTTPCookieStore_0 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { - _FakeWKHTTPCookieStore_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKHTTPCookieStore_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePigeonInstanceManager_1 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKWebsiteDataStore_2 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebsiteDataStore_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WKWebsiteDataStore]. @@ -64,37 +50,37 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_0( - this, - Invocation.getter(#httpCookieStore), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => + (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_0( + this, + Invocation.getter(#httpCookieStore), + ), + ) + as _i2.WKHTTPCookieStore); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_1( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_1( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_httpCookieStore, - [], - ), - returnValue: _FakeWKHTTPCookieStore_0( - this, - Invocation.method( - #pigeonVar_httpCookieStore, - [], - ), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_0( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) + as _i2.WKHTTPCookieStore); @override _i3.Future removeDataOfTypes( @@ -102,30 +88,24 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method( - #removeDataOfTypes, - [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), + returnValue: _i3.Future.value(false), + ) + as _i3.Future); @override - _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKWebsiteDataStore_2( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKWebsiteDataStore); + _i2.WKWebsiteDataStore pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebsiteDataStore); @override _i3.Future addObserver( @@ -134,34 +114,20 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKHTTPCookieStore]. @@ -173,38 +139,35 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_1( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_1( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i3.Future setCookie(_i2.HTTPCookie? cookie) => (super.noSuchMethod( - Invocation.method( - #setCookie, - [cookie], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future setCookie(_i2.HTTPCookie? cookie) => + (super.noSuchMethod( + Invocation.method(#setCookie, [cookie]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i2.WKHTTPCookieStore pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKHTTPCookieStore_0( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKHTTPCookieStore_0( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKHTTPCookieStore); @override _i3.Future addObserver( @@ -213,32 +176,18 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart index b99d333513d..2e977a8f1a8 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_wkwebview/test/webkit_webview_widget_test.dart. // Do not manually edit this file. @@ -16,6 +16,7 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -23,77 +24,48 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKUIDelegate_1 extends _i1.SmartFake implements _i2.WKUIDelegate { - _FakeWKUIDelegate_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKUIDelegate_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKUserContentController_2 extends _i1.SmartFake implements _i2.WKUserContentController { - _FakeWKUserContentController_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKUserContentController_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKWebsiteDataStore_3 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebsiteDataStore_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWKPreferences_4 extends _i1.SmartFake implements _i2.WKPreferences { - _FakeWKPreferences_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKPreferences_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebViewConfiguration_5 extends _i1.SmartFake +class _FakeWKWebpagePreferences_5 extends _i1.SmartFake + implements _i2.WKWebpagePreferences { + _FakeWKWebpagePreferences_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWKWebViewConfiguration_6 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { - _FakeWKWebViewConfiguration_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebViewConfiguration_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeUIScrollViewDelegate_6 extends _i1.SmartFake +class _FakeUIScrollViewDelegate_7 extends _i1.SmartFake implements _i2.UIScrollViewDelegate { - _FakeUIScrollViewDelegate_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeUIScrollViewDelegate_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WKUIDelegate]. @@ -105,28 +77,81 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i3.Future<_i2.PermissionDecision> Function( + _i2.WKUIDelegate, + _i2.WKWebView, + _i2.WKSecurityOrigin, + _i2.WKFrameInfo, + _i2.MediaCaptureType, + ) + get requestMediaCapturePermission => + (super.noSuchMethod( + Invocation.getter(#requestMediaCapturePermission), + returnValue: + ( + _i2.WKUIDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.WKSecurityOrigin origin, + _i2.WKFrameInfo frame, + _i2.MediaCaptureType type, + ) => _i3.Future<_i2.PermissionDecision>.value( + _i2.PermissionDecision.deny, + ), + ) + as _i3.Future<_i2.PermissionDecision> Function( + _i2.WKUIDelegate, + _i2.WKWebView, + _i2.WKSecurityOrigin, + _i2.WKFrameInfo, + _i2.MediaCaptureType, + )); + + @override + _i3.Future Function( + _i2.WKUIDelegate, + _i2.WKWebView, + String, + _i2.WKFrameInfo, + ) + get runJavaScriptConfirmPanel => + (super.noSuchMethod( + Invocation.getter(#runJavaScriptConfirmPanel), + returnValue: + ( + _i2.WKUIDelegate pigeon_instance, + _i2.WKWebView webView, + String message, + _i2.WKFrameInfo frame, + ) => _i3.Future.value(false), + ) + as _i3.Future Function( + _i2.WKUIDelegate, + _i2.WKWebView, + String, + _i2.WKFrameInfo, + )); @override - _i2.WKUIDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKUIDelegate_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKUIDelegate); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WKUIDelegate pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUIDelegate_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKUIDelegate); @override _i3.Future addObserver( @@ -135,34 +160,20 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [WKWebViewConfiguration]. @@ -175,145 +186,138 @@ class MockWKWebViewConfiguration extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i3.Future setUserContentController( - _i2.WKUserContentController? controller) => + _i2.WKUserContentController? controller, + ) => (super.noSuchMethod( - Invocation.method( - #setUserContentController, - [controller], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setUserContentController, [controller]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( - Invocation.method( - #getUserContentController, - [], - ), - returnValue: _i3.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_2( - this, - Invocation.method( - #getUserContentController, - [], - ), - )), - ) as _i3.Future<_i2.WKUserContentController>); + Invocation.method(#getUserContentController, []), + returnValue: _i3.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_2( + this, + Invocation.method(#getUserContentController, []), + ), + ), + ) + as _i3.Future<_i2.WKUserContentController>); @override _i3.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method( - #setWebsiteDataStore, - [dataStore], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setWebsiteDataStore, [dataStore]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( - Invocation.method( - #getWebsiteDataStore, - [], - ), - returnValue: - _i3.Future<_i2.WKWebsiteDataStore>.value(_FakeWKWebsiteDataStore_3( - this, - Invocation.method( - #getWebsiteDataStore, - [], - ), - )), - ) as _i3.Future<_i2.WKWebsiteDataStore>); + Invocation.method(#getWebsiteDataStore, []), + returnValue: _i3.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_3( + this, + Invocation.method(#getWebsiteDataStore, []), + ), + ), + ) + as _i3.Future<_i2.WKWebsiteDataStore>); @override _i3.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method( - #setPreferences, - [preferences], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setPreferences, [preferences]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future<_i2.WKPreferences> getPreferences() => (super.noSuchMethod( - Invocation.method( - #getPreferences, - [], - ), - returnValue: _i3.Future<_i2.WKPreferences>.value(_FakeWKPreferences_4( - this, - Invocation.method( - #getPreferences, - [], - ), - )), - ) as _i3.Future<_i2.WKPreferences>); + _i3.Future<_i2.WKPreferences> getPreferences() => + (super.noSuchMethod( + Invocation.method(#getPreferences, []), + returnValue: _i3.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_4( + this, + Invocation.method(#getPreferences, []), + ), + ), + ) + as _i3.Future<_i2.WKPreferences>); @override _i3.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowsInlineMediaPlayback, - [allow], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method( - #setLimitsNavigationsToAppBoundDomains, - [limit], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future setMediaTypesRequiringUserActionForPlayback( - _i2.AudiovisualMediaType? type) => + _i2.AudiovisualMediaType? type, + ) => (super.noSuchMethod( - Invocation.method( - #setMediaTypesRequiringUserActionForPlayback, - [type], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ + type, + ]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWKWebViewConfiguration_5( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WKWebViewConfiguration); + _i3.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => + (super.noSuchMethod( + Invocation.method(#getDefaultWebpagePreferences, []), + returnValue: _i3.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_5( + this, + Invocation.method(#getDefaultWebpagePreferences, []), + ), + ), + ) + as _i3.Future<_i2.WKWebpagePreferences>); + + @override + _i2.WKWebViewConfiguration pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebViewConfiguration); @override _i3.Future addObserver( @@ -322,34 +326,20 @@ class MockWKWebViewConfiguration extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } /// A class which mocks [UIScrollViewDelegate]. @@ -362,28 +352,26 @@ class MockUIScrollViewDelegate extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i2.UIScrollViewDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeUIScrollViewDelegate_6( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.UIScrollViewDelegate); + _i2.UIScrollViewDelegate pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIScrollViewDelegate_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.UIScrollViewDelegate); @override _i3.Future addObserver( @@ -392,32 +380,18 @@ class MockUIScrollViewDelegate extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [ - observer, - keyPath, - options, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeObserver( - _i2.NSObject? observer, - String? keyPath, - ) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - observer, - keyPath, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); } From fe2784a19de7a5d4af688a55256a265e7269231f Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 11 Feb 2025 18:12:50 -0500 Subject: [PATCH 06/10] changelog --- packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index bfc6b9667ee..1c9c0b1daa4 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -2,6 +2,8 @@ * Updates internal API wrapper to make all Flutter methods with a non-null return value be required to implement. +* Changes default method to enable JavaScript for web content to + `WKWebpagePreferences.allowsContentJavaScript`. ## 3.18.0 From cd912dc09323417ae74caffe587c6a3a97e77bac Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 11 Feb 2025 18:22:43 -0500 Subject: [PATCH 07/10] fix unit tests --- .../legacy/web_kit_webview_widget_test.dart | 11 +++- .../web_kit_webview_widget_test.mocks.dart | 63 +++++++++++++++++++ 2 files changed, 72 insertions(+), 2 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart index 6b0e8816a9f..934889e3b84 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart @@ -33,6 +33,7 @@ import 'web_kit_webview_widget_test.mocks.dart'; JavascriptChannelRegistry, WebViewPlatformCallbacksHandler, WebViewWidgetProxy, + WKWebpagePreferences, ]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -50,7 +51,8 @@ void main() { websiteDataStore: MockWKWebsiteDataStore(), navigationDelegate: MockWKNavigationDelegate(), callbacksHandler: MockWebViewPlatformCallbacksHandler(), - javascriptChannelRegistry: MockJavascriptChannelRegistry()); + javascriptChannelRegistry: MockJavascriptChannelRegistry(), + webpagePreferences: MockWKWebpagePreferences()); when( mocks.webViewWidgetProxy.createWebView( @@ -86,6 +88,9 @@ void main() { ); when(mocks.webViewConfiguration.getPreferences()) .thenAnswer((_) => Future.value(mocks.preferences)); + when(mocks.webViewConfiguration.getDefaultWebpagePreferences()) + .thenAnswer((_) => + Future.value(mocks.webpagePreferences)); when(mocks.webView.scrollView).thenReturn(mocks.scrollView); @@ -331,7 +336,7 @@ void main() { ), ); - verify(mocks.preferences.setJavaScriptEnabled(true)); + verify(mocks.webpagePreferences.setAllowsContentJavaScript(true)); }); testWidgets('userAgent', (WidgetTester tester) async { @@ -1498,6 +1503,7 @@ class _WebViewMocks { required this.navigationDelegate, required this.callbacksHandler, required this.javascriptChannelRegistry, + required this.webpagePreferences, }); final MockUIViewWKWebView webView; @@ -1511,6 +1517,7 @@ class _WebViewMocks { final MockWKNavigationDelegate navigationDelegate; final MockWebViewPlatformCallbacksHandler callbacksHandler; final MockJavascriptChannelRegistry javascriptChannelRegistry; + final MockWKWebpagePreferences webpagePreferences; } // Test InstanceManager that sets `onWeakReferenceRemoved` as a noop. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart index 44152e36e5d..3e01c30179e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart @@ -1687,3 +1687,66 @@ class MockWebViewWidgetProxy extends _i1.Mock ) as _i2.WKNavigationDelegate); } + +/// A class which mocks [WKWebpagePreferences]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWKWebpagePreferences extends _i1.Mock + implements _i2.WKWebpagePreferences { + MockWKWebpagePreferences() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i4.Future setAllowsContentJavaScript(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowsContentJavaScript, [allow]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.WKWebpagePreferences pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebpagePreferences_12( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebpagePreferences); + + @override + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => + (super.noSuchMethod( + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + (super.noSuchMethod( + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); +} From dbe3fee1227ef3c864aee965e915e4985ed849a5 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:32:49 -0500 Subject: [PATCH 08/10] formatting --- .../web_kit_cookie_manager_test.mocks.dart | 163 +- .../web_kit_webview_widget_test.mocks.dart | 1793 +++++++-------- ...webkit_navigation_delegate_test.mocks.dart | 257 +-- .../webkit_webview_controller_test.mocks.dart | 1934 ++++++++--------- ...kit_webview_cookie_manager_test.mocks.dart | 163 +- .../webkit_webview_widget_test.mocks.dart | 361 ++- 6 files changed, 2081 insertions(+), 2590 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart index e29d4d71a3f..4e7d186e80f 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart @@ -25,19 +25,19 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKHTTPCookieStore_1 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { _FakeWKHTTPCookieStore_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebsiteDataStore_2 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { _FakeWKWebsiteDataStore_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [WKHTTPCookieStore]. @@ -49,35 +49,29 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i3.Future setCookie(_i2.HTTPCookie? cookie) => - (super.noSuchMethod( - Invocation.method(#setCookie, [cookie]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setCookie(_i2.HTTPCookie? cookie) => (super.noSuchMethod( + Invocation.method(#setCookie, [cookie]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.WKHTTPCookieStore pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKHTTPCookieStore_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKHTTPCookieStore_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKHTTPCookieStore); @override _i3.Future addObserver( @@ -86,20 +80,18 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKWebsiteDataStore]. @@ -112,37 +104,31 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => - (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_1( - this, - Invocation.getter(#httpCookieStore), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_1( + this, + Invocation.getter(#httpCookieStore), + ), + ) as _i2.WKHTTPCookieStore); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_httpCookieStore, []), - returnValue: _FakeWKHTTPCookieStore_1( - this, - Invocation.method(#pigeonVar_httpCookieStore, []), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_1( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) as _i2.WKHTTPCookieStore); @override _i3.Future removeDataOfTypes( @@ -150,24 +136,21 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method(#removeDataOfTypes, [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ]), - returnValue: _i3.Future.value(false), - ) - as _i3.Future); + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), + returnValue: _i3.Future.value(false), + ) as _i3.Future); @override - _i2.WKWebsiteDataStore pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebsiteDataStore_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebsiteDataStore); + _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebsiteDataStore); @override _i3.Future addObserver( @@ -176,18 +159,16 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart index 3e01c30179e..58aa23e918a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart @@ -36,17 +36,17 @@ import 'package:webview_flutter_wkwebview/src/legacy/web_kit_webview_widget.dart class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIScrollView_1 extends _i1.SmartFake implements _i2.UIScrollView { _FakeUIScrollView_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeURLRequest_2 extends _i1.SmartFake implements _i2.URLRequest { _FakeURLRequest_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeAuthenticationChallengeResponse_3 extends _i1.SmartFake @@ -60,70 +60,70 @@ class _FakeAuthenticationChallengeResponse_3 extends _i1.SmartFake class _FakeWKNavigationDelegate_4 extends _i1.SmartFake implements _i2.WKNavigationDelegate { _FakeWKNavigationDelegate_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKPreferences_5 extends _i1.SmartFake implements _i2.WKPreferences { _FakeWKPreferences_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKScriptMessageHandler_6 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { _FakeWKScriptMessageHandler_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebView_7 extends _i1.SmartFake implements _i2.WKWebView { _FakeWKWebView_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebViewConfiguration_8 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { _FakeWKWebViewConfiguration_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIViewWKWebView_9 extends _i1.SmartFake implements _i2.UIViewWKWebView { _FakeUIViewWKWebView_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUserContentController_10 extends _i1.SmartFake implements _i2.WKUserContentController { _FakeWKUserContentController_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebsiteDataStore_11 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { _FakeWKWebsiteDataStore_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebpagePreferences_12 extends _i1.SmartFake implements _i2.WKWebpagePreferences { _FakeWKWebpagePreferences_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKHTTPCookieStore_13 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { _FakeWKHTTPCookieStore_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUIDelegate_14 extends _i1.SmartFake implements _i2.WKUIDelegate { _FakeWKUIDelegate_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebView_15 extends _i1.SmartFake implements _i3.PlatformWebView { _FakePlatformWebView_15(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [UIScrollView]. @@ -135,124 +135,101 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i4.Future> getContentOffset() => - (super.noSuchMethod( - Invocation.method(#getContentOffset, []), - returnValue: _i4.Future>.value([]), - ) - as _i4.Future>); + _i4.Future> getContentOffset() => (super.noSuchMethod( + Invocation.method(#getContentOffset, []), + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i4.Future scrollBy(double? x, double? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future scrollBy(double? x, double? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setContentOffset(double? x, double? y) => (super.noSuchMethod( - Invocation.method(#setContentOffset, [x, y]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setContentOffset, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setDelegate(_i2.UIScrollViewDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setDelegate, [delegate]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setDelegate, [delegate]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setBounces(bool? value) => - (super.noSuchMethod( - Invocation.method(#setBounces, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setBounces(bool? value) => (super.noSuchMethod( + Invocation.method(#setBounces, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setBouncesHorizontally(bool? value) => - (super.noSuchMethod( - Invocation.method(#setBouncesHorizontally, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setBouncesHorizontally(bool? value) => (super.noSuchMethod( + Invocation.method(#setBouncesHorizontally, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setBouncesVertically(bool? value) => - (super.noSuchMethod( - Invocation.method(#setBouncesVertically, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setBouncesVertically(bool? value) => (super.noSuchMethod( + Invocation.method(#setBouncesVertically, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setAlwaysBounceVertical(bool? value) => - (super.noSuchMethod( - Invocation.method(#setAlwaysBounceVertical, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setAlwaysBounceVertical(bool? value) => (super.noSuchMethod( + Invocation.method(#setAlwaysBounceVertical, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setAlwaysBounceHorizontal(bool? value) => (super.noSuchMethod( - Invocation.method(#setAlwaysBounceHorizontal, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setAlwaysBounceHorizontal, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.UIScrollView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeUIScrollView_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.UIScrollView); + _i2.UIScrollView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIScrollView_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.UIScrollView); @override - _i4.Future setBackgroundColor(int? value) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setBackgroundColor(int? value) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setOpaque(bool? opaque) => - (super.noSuchMethod( - Invocation.method(#setOpaque, [opaque]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setOpaque(bool? opaque) => (super.noSuchMethod( + Invocation.method(#setOpaque, [opaque]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future addObserver( @@ -261,20 +238,18 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [URLRequest]. @@ -286,85 +261,69 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i4.Future getUrl() => - (super.noSuchMethod( - Invocation.method(#getUrl, []), - returnValue: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future getUrl() => (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setHttpMethod(String? method) => - (super.noSuchMethod( - Invocation.method(#setHttpMethod, [method]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setHttpMethod(String? method) => (super.noSuchMethod( + Invocation.method(#setHttpMethod, [method]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future getHttpMethod() => - (super.noSuchMethod( - Invocation.method(#getHttpMethod, []), - returnValue: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future getHttpMethod() => (super.noSuchMethod( + Invocation.method(#getHttpMethod, []), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setHttpBody(_i5.Uint8List? body) => - (super.noSuchMethod( - Invocation.method(#setHttpBody, [body]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setHttpBody(_i5.Uint8List? body) => (super.noSuchMethod( + Invocation.method(#setHttpBody, [body]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future<_i5.Uint8List?> getHttpBody() => - (super.noSuchMethod( - Invocation.method(#getHttpBody, []), - returnValue: _i4.Future<_i5.Uint8List?>.value(), - ) - as _i4.Future<_i5.Uint8List?>); + _i4.Future<_i5.Uint8List?> getHttpBody() => (super.noSuchMethod( + Invocation.method(#getHttpBody, []), + returnValue: _i4.Future<_i5.Uint8List?>.value(), + ) as _i4.Future<_i5.Uint8List?>); @override _i4.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method(#setAllHttpHeaderFields, [fields]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setAllHttpHeaderFields, [fields]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future?> getAllHttpHeaderFields() => (super.noSuchMethod( - Invocation.method(#getAllHttpHeaderFields, []), - returnValue: _i4.Future?>.value(), - ) - as _i4.Future?>); + Invocation.method(#getAllHttpHeaderFields, []), + returnValue: _i4.Future?>.value(), + ) as _i4.Future?>); @override - _i2.URLRequest pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeURLRequest_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.URLRequest); + _i2.URLRequest pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURLRequest_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.URLRequest); @override _i4.Future addObserver( @@ -373,20 +332,18 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKNavigationDelegate]. @@ -403,97 +360,84 @@ class MockWKNavigationDelegate extends _i1.Mock _i2.WKNavigationDelegate, _i2.WKWebView, _i2.WKNavigationAction, - ) - get decidePolicyForNavigationAction => - (super.noSuchMethod( - Invocation.getter(#decidePolicyForNavigationAction), - returnValue: - ( - _i2.WKNavigationDelegate pigeon_instance, - _i2.WKWebView webView, - _i2.WKNavigationAction navigationAction, - ) => _i4.Future<_i2.NavigationActionPolicy>.value( - _i2.NavigationActionPolicy.allow, - ), - ) - as _i4.Future<_i2.NavigationActionPolicy> Function( - _i2.WKNavigationDelegate, - _i2.WKWebView, - _i2.WKNavigationAction, - )); + ) get decidePolicyForNavigationAction => (super.noSuchMethod( + Invocation.getter(#decidePolicyForNavigationAction), + returnValue: ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.WKNavigationAction navigationAction, + ) => + _i4.Future<_i2.NavigationActionPolicy>.value( + _i2.NavigationActionPolicy.allow, + ), + ) as _i4.Future<_i2.NavigationActionPolicy> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.WKNavigationAction, + )); @override _i4.Future<_i2.NavigationResponsePolicy> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.WKNavigationResponse, - ) - get decidePolicyForNavigationResponse => - (super.noSuchMethod( - Invocation.getter(#decidePolicyForNavigationResponse), - returnValue: - ( - _i2.WKNavigationDelegate pigeon_instance, - _i2.WKWebView webView, - _i2.WKNavigationResponse navigationResponse, - ) => _i4.Future<_i2.NavigationResponsePolicy>.value( - _i2.NavigationResponsePolicy.allow, - ), - ) - as _i4.Future<_i2.NavigationResponsePolicy> Function( - _i2.WKNavigationDelegate, - _i2.WKWebView, - _i2.WKNavigationResponse, - )); + ) get decidePolicyForNavigationResponse => (super.noSuchMethod( + Invocation.getter(#decidePolicyForNavigationResponse), + returnValue: ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.WKNavigationResponse navigationResponse, + ) => + _i4.Future<_i2.NavigationResponsePolicy>.value( + _i2.NavigationResponsePolicy.allow, + ), + ) as _i4.Future<_i2.NavigationResponsePolicy> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.WKNavigationResponse, + )); @override _i4.Future<_i2.AuthenticationChallengeResponse> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.URLAuthenticationChallenge, - ) - get didReceiveAuthenticationChallenge => - (super.noSuchMethod( + ) get didReceiveAuthenticationChallenge => (super.noSuchMethod( + Invocation.getter(#didReceiveAuthenticationChallenge), + returnValue: ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.URLAuthenticationChallenge challenge, + ) => + _i4.Future<_i2.AuthenticationChallengeResponse>.value( + _FakeAuthenticationChallengeResponse_3( + this, Invocation.getter(#didReceiveAuthenticationChallenge), - returnValue: - ( - _i2.WKNavigationDelegate pigeon_instance, - _i2.WKWebView webView, - _i2.URLAuthenticationChallenge challenge, - ) => _i4.Future<_i2.AuthenticationChallengeResponse>.value( - _FakeAuthenticationChallengeResponse_3( - this, - Invocation.getter(#didReceiveAuthenticationChallenge), - ), - ), - ) - as _i4.Future<_i2.AuthenticationChallengeResponse> Function( - _i2.WKNavigationDelegate, - _i2.WKWebView, - _i2.URLAuthenticationChallenge, - )); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + ), + ), + ) as _i4.Future<_i2.AuthenticationChallengeResponse> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.URLAuthenticationChallenge, + )); @override - _i2.WKNavigationDelegate pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKNavigationDelegate_4( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKNavigationDelegate); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WKNavigationDelegate pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKNavigationDelegate_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKNavigationDelegate); @override _i4.Future addObserver( @@ -502,20 +446,18 @@ class MockWKNavigationDelegate extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKPreferences]. @@ -527,35 +469,29 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i4.Future setJavaScriptEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setJavaScriptEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.WKPreferences pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKPreferences_5( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKPreferences); + _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_5( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKPreferences); @override _i4.Future addObserver( @@ -564,20 +500,18 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKScriptMessageHandler]. @@ -594,44 +528,36 @@ class MockWKScriptMessageHandler extends _i1.Mock _i2.WKScriptMessageHandler, _i2.WKUserContentController, _i2.WKScriptMessage, - ) - get didReceiveScriptMessage => - (super.noSuchMethod( - Invocation.getter(#didReceiveScriptMessage), - returnValue: - ( - _i2.WKScriptMessageHandler pigeon_instance, - _i2.WKUserContentController controller, - _i2.WKScriptMessage message, - ) {}, - ) - as void Function( - _i2.WKScriptMessageHandler, - _i2.WKUserContentController, - _i2.WKScriptMessage, - )); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.WKScriptMessageHandler pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKScriptMessageHandler_6( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKScriptMessageHandler); + ) get didReceiveScriptMessage => (super.noSuchMethod( + Invocation.getter(#didReceiveScriptMessage), + returnValue: ( + _i2.WKScriptMessageHandler pigeon_instance, + _i2.WKUserContentController controller, + _i2.WKScriptMessage message, + ) {}, + ) as void Function( + _i2.WKScriptMessageHandler, + _i2.WKUserContentController, + _i2.WKScriptMessage, + )); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WKScriptMessageHandler pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKScriptMessageHandler_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKScriptMessageHandler); @override _i4.Future addObserver( @@ -640,20 +566,18 @@ class MockWKScriptMessageHandler extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKWebView]. @@ -665,26 +589,22 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i2.WKWebView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebView_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebView); + _i2.WKWebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebView); @override _i4.Future addObserver( @@ -693,20 +613,18 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [UIViewWKWebView]. @@ -718,252 +636,204 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { } @override - _i2.WKWebViewConfiguration get configuration => - (super.noSuchMethod( - Invocation.getter(#configuration), - returnValue: _FakeWKWebViewConfiguration_8( - this, - Invocation.getter(#configuration), - ), - ) - as _i2.WKWebViewConfiguration); + _i2.WKWebViewConfiguration get configuration => (super.noSuchMethod( + Invocation.getter(#configuration), + returnValue: _FakeWKWebViewConfiguration_8( + this, + Invocation.getter(#configuration), + ), + ) as _i2.WKWebViewConfiguration); @override - _i2.UIScrollView get scrollView => - (super.noSuchMethod( - Invocation.getter(#scrollView), - returnValue: _FakeUIScrollView_1( - this, - Invocation.getter(#scrollView), - ), - ) - as _i2.UIScrollView); + _i2.UIScrollView get scrollView => (super.noSuchMethod( + Invocation.getter(#scrollView), + returnValue: _FakeUIScrollView_1( + this, + Invocation.getter(#scrollView), + ), + ) as _i2.UIScrollView); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i2.WKWebViewConfiguration pigeonVar_configuration() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_configuration, []), - returnValue: _FakeWKWebViewConfiguration_8( - this, - Invocation.method(#pigeonVar_configuration, []), - ), - ) - as _i2.WKWebViewConfiguration); + _i2.WKWebViewConfiguration pigeonVar_configuration() => (super.noSuchMethod( + Invocation.method(#pigeonVar_configuration, []), + returnValue: _FakeWKWebViewConfiguration_8( + this, + Invocation.method(#pigeonVar_configuration, []), + ), + ) as _i2.WKWebViewConfiguration); @override - _i2.UIScrollView pigeonVar_scrollView() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_scrollView, []), - returnValue: _FakeUIScrollView_1( - this, - Invocation.method(#pigeonVar_scrollView, []), - ), - ) - as _i2.UIScrollView); + _i2.UIScrollView pigeonVar_scrollView() => (super.noSuchMethod( + Invocation.method(#pigeonVar_scrollView, []), + returnValue: _FakeUIScrollView_1( + this, + Invocation.method(#pigeonVar_scrollView, []), + ), + ) as _i2.UIScrollView); @override _i4.Future setUIDelegate(_i2.WKUIDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setUIDelegate, [delegate]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setUIDelegate, [delegate]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setNavigationDelegate(_i2.WKNavigationDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setNavigationDelegate, [delegate]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setNavigationDelegate, [delegate]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future getUrl() => - (super.noSuchMethod( - Invocation.method(#getUrl, []), - returnValue: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future getUrl() => (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future getEstimatedProgress() => - (super.noSuchMethod( - Invocation.method(#getEstimatedProgress, []), - returnValue: _i4.Future.value(0.0), - ) - as _i4.Future); + _i4.Future getEstimatedProgress() => (super.noSuchMethod( + Invocation.method(#getEstimatedProgress, []), + returnValue: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i4.Future load(_i2.URLRequest? request) => - (super.noSuchMethod( - Invocation.method(#load, [request]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future load(_i2.URLRequest? request) => (super.noSuchMethod( + Invocation.method(#load, [request]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future loadHtmlString(String? string, String? baseUrl) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [string, baseUrl]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#loadHtmlString, [string, baseUrl]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future loadFileUrl(String? url, String? readAccessUrl) => (super.noSuchMethod( - Invocation.method(#loadFileUrl, [url, readAccessUrl]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#loadFileUrl, [url, readAccessUrl]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i4.Future.value(false), - ) - as _i4.Future); + _i4.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i4.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i4.Future.value(false), - ) - as _i4.Future); + _i4.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i4.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsBackForwardNavigationGestures, [allow]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setAllowsBackForwardNavigationGestures, [allow]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setCustomUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setCustomUserAgent, [userAgent]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setCustomUserAgent, [userAgent]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future evaluateJavaScript(String? javaScriptString) => (super.noSuchMethod( - Invocation.method(#evaluateJavaScript, [javaScriptString]), - returnValue: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#evaluateJavaScript, [javaScriptString]), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setInspectable(bool? inspectable) => - (super.noSuchMethod( - Invocation.method(#setInspectable, [inspectable]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setInspectable(bool? inspectable) => (super.noSuchMethod( + Invocation.method(#setInspectable, [inspectable]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future getCustomUserAgent() => - (super.noSuchMethod( - Invocation.method(#getCustomUserAgent, []), - returnValue: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future getCustomUserAgent() => (super.noSuchMethod( + Invocation.method(#getCustomUserAgent, []), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i2.UIViewWKWebView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeUIViewWKWebView_9( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.UIViewWKWebView); + _i2.UIViewWKWebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIViewWKWebView_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.UIViewWKWebView); @override - _i4.Future setBackgroundColor(int? value) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setBackgroundColor(int? value) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setOpaque(bool? opaque) => - (super.noSuchMethod( - Invocation.method(#setOpaque, [opaque]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setOpaque(bool? opaque) => (super.noSuchMethod( + Invocation.method(#setOpaque, [opaque]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future addObserver( @@ -972,20 +842,18 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKWebViewConfiguration]. @@ -998,138 +866,123 @@ class MockWKWebViewConfiguration extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i4.Future setUserContentController( _i2.WKUserContentController? controller, ) => (super.noSuchMethod( - Invocation.method(#setUserContentController, [controller]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setUserContentController, [controller]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( + Invocation.method(#getUserContentController, []), + returnValue: _i4.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_10( + this, Invocation.method(#getUserContentController, []), - returnValue: _i4.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_10( - this, - Invocation.method(#getUserContentController, []), - ), - ), - ) - as _i4.Future<_i2.WKUserContentController>); + ), + ), + ) as _i4.Future<_i2.WKUserContentController>); @override _i4.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method(#setWebsiteDataStore, [dataStore]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setWebsiteDataStore, [dataStore]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( + Invocation.method(#getWebsiteDataStore, []), + returnValue: _i4.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_11( + this, Invocation.method(#getWebsiteDataStore, []), - returnValue: _i4.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_11( - this, - Invocation.method(#getWebsiteDataStore, []), - ), - ), - ) - as _i4.Future<_i2.WKWebsiteDataStore>); + ), + ), + ) as _i4.Future<_i2.WKWebsiteDataStore>); @override _i4.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method(#setPreferences, [preferences]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setPreferences, [preferences]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future<_i2.WKPreferences> getPreferences() => - (super.noSuchMethod( + _i4.Future<_i2.WKPreferences> getPreferences() => (super.noSuchMethod( + Invocation.method(#getPreferences, []), + returnValue: _i4.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_5( + this, Invocation.method(#getPreferences, []), - returnValue: _i4.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_5( - this, - Invocation.method(#getPreferences, []), - ), - ), - ) - as _i4.Future<_i2.WKPreferences>); + ), + ), + ) as _i4.Future<_i2.WKPreferences>); @override _i4.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsInlineMediaPlayback, [allow]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setMediaTypesRequiringUserActionForPlayback( _i2.AudiovisualMediaType? type, ) => (super.noSuchMethod( - Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ - type, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ + type, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => (super.noSuchMethod( + Invocation.method(#getDefaultWebpagePreferences, []), + returnValue: _i4.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_12( + this, Invocation.method(#getDefaultWebpagePreferences, []), - returnValue: _i4.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_12( - this, - Invocation.method(#getDefaultWebpagePreferences, []), - ), - ), - ) - as _i4.Future<_i2.WKWebpagePreferences>); + ), + ), + ) as _i4.Future<_i2.WKWebpagePreferences>); @override - _i2.WKWebViewConfiguration pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebViewConfiguration_8( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebViewConfiguration); + _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_8( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebViewConfiguration); @override _i4.Future addObserver( @@ -1138,20 +991,18 @@ class MockWKWebViewConfiguration extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKWebsiteDataStore]. @@ -1164,37 +1015,31 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => - (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_13( - this, - Invocation.getter(#httpCookieStore), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_13( + this, + Invocation.getter(#httpCookieStore), + ), + ) as _i2.WKHTTPCookieStore); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_httpCookieStore, []), - returnValue: _FakeWKHTTPCookieStore_13( - this, - Invocation.method(#pigeonVar_httpCookieStore, []), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_13( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) as _i2.WKHTTPCookieStore); @override _i4.Future removeDataOfTypes( @@ -1202,24 +1047,21 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method(#removeDataOfTypes, [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ]), - returnValue: _i4.Future.value(false), - ) - as _i4.Future); + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i2.WKWebsiteDataStore pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebsiteDataStore_11( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebsiteDataStore); + _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebsiteDataStore); @override _i4.Future addObserver( @@ -1228,20 +1070,18 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKUIDelegate]. @@ -1259,28 +1099,25 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { _i2.WKSecurityOrigin, _i2.WKFrameInfo, _i2.MediaCaptureType, - ) - get requestMediaCapturePermission => - (super.noSuchMethod( - Invocation.getter(#requestMediaCapturePermission), - returnValue: - ( - _i2.WKUIDelegate pigeon_instance, - _i2.WKWebView webView, - _i2.WKSecurityOrigin origin, - _i2.WKFrameInfo frame, - _i2.MediaCaptureType type, - ) => _i4.Future<_i2.PermissionDecision>.value( - _i2.PermissionDecision.deny, - ), - ) - as _i4.Future<_i2.PermissionDecision> Function( - _i2.WKUIDelegate, - _i2.WKWebView, - _i2.WKSecurityOrigin, - _i2.WKFrameInfo, - _i2.MediaCaptureType, - )); + ) get requestMediaCapturePermission => (super.noSuchMethod( + Invocation.getter(#requestMediaCapturePermission), + returnValue: ( + _i2.WKUIDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.WKSecurityOrigin origin, + _i2.WKFrameInfo frame, + _i2.MediaCaptureType type, + ) => + _i4.Future<_i2.PermissionDecision>.value( + _i2.PermissionDecision.deny, + ), + ) as _i4.Future<_i2.PermissionDecision> Function( + _i2.WKUIDelegate, + _i2.WKWebView, + _i2.WKSecurityOrigin, + _i2.WKFrameInfo, + _i2.MediaCaptureType, + )); @override _i4.Future Function( @@ -1288,46 +1125,39 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { _i2.WKWebView, String, _i2.WKFrameInfo, - ) - get runJavaScriptConfirmPanel => - (super.noSuchMethod( - Invocation.getter(#runJavaScriptConfirmPanel), - returnValue: - ( - _i2.WKUIDelegate pigeon_instance, - _i2.WKWebView webView, - String message, - _i2.WKFrameInfo frame, - ) => _i4.Future.value(false), - ) - as _i4.Future Function( - _i2.WKUIDelegate, - _i2.WKWebView, - String, - _i2.WKFrameInfo, - )); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.WKUIDelegate pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKUIDelegate_14( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKUIDelegate); + ) get runJavaScriptConfirmPanel => (super.noSuchMethod( + Invocation.getter(#runJavaScriptConfirmPanel), + returnValue: ( + _i2.WKUIDelegate pigeon_instance, + _i2.WKWebView webView, + String message, + _i2.WKFrameInfo frame, + ) => + _i4.Future.value(false), + ) as _i4.Future Function( + _i2.WKUIDelegate, + _i2.WKWebView, + String, + _i2.WKFrameInfo, + )); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WKUIDelegate pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUIDelegate_14( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKUIDelegate); @override _i4.Future addObserver( @@ -1336,20 +1166,18 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKUserContentController]. @@ -1362,15 +1190,13 @@ class MockWKUserContentController extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i4.Future addScriptMessageHandler( @@ -1378,58 +1204,49 @@ class MockWKUserContentController extends _i1.Mock String? name, ) => (super.noSuchMethod( - Invocation.method(#addScriptMessageHandler, [handler, name]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addScriptMessageHandler, [handler, name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( - Invocation.method(#removeScriptMessageHandler, [name]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeScriptMessageHandler, [name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future removeAllScriptMessageHandlers() => - (super.noSuchMethod( - Invocation.method(#removeAllScriptMessageHandlers, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( + Invocation.method(#removeAllScriptMessageHandlers, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future addUserScript(_i2.WKUserScript? userScript) => (super.noSuchMethod( - Invocation.method(#addUserScript, [userScript]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addUserScript, [userScript]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future removeAllUserScripts() => - (super.noSuchMethod( - Invocation.method(#removeAllUserScripts, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future removeAllUserScripts() => (super.noSuchMethod( + Invocation.method(#removeAllUserScripts, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.WKUserContentController pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKUserContentController_10( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKUserContentController); + _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKUserContentController); @override _i4.Future addObserver( @@ -1438,20 +1255,18 @@ class MockWKUserContentController extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [JavascriptChannelRegistry]. @@ -1464,12 +1279,10 @@ class MockJavascriptChannelRegistry extends _i1.Mock } @override - Map get channels => - (super.noSuchMethod( - Invocation.getter(#channels), - returnValue: {}, - ) - as Map); + Map get channels => (super.noSuchMethod( + Invocation.getter(#channels), + returnValue: {}, + ) as Map); @override void onJavascriptChannelMessage(String? channel, String? message) => @@ -1501,37 +1314,36 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock required bool? isForMainFrame, }) => (super.noSuchMethod( - Invocation.method(#onNavigationRequest, [], { - #url: url, - #isForMainFrame: isForMainFrame, - }), - returnValue: _i4.Future.value(false), - ) - as _i4.FutureOr); + Invocation.method(#onNavigationRequest, [], { + #url: url, + #isForMainFrame: isForMainFrame, + }), + returnValue: _i4.Future.value(false), + ) as _i4.FutureOr); @override void onPageStarted(String? url) => super.noSuchMethod( - Invocation.method(#onPageStarted, [url]), - returnValueForMissingStub: null, - ); + Invocation.method(#onPageStarted, [url]), + returnValueForMissingStub: null, + ); @override void onPageFinished(String? url) => super.noSuchMethod( - Invocation.method(#onPageFinished, [url]), - returnValueForMissingStub: null, - ); + Invocation.method(#onPageFinished, [url]), + returnValueForMissingStub: null, + ); @override void onProgress(int? progress) => super.noSuchMethod( - Invocation.method(#onProgress, [progress]), - returnValueForMissingStub: null, - ); + Invocation.method(#onProgress, [progress]), + returnValueForMissingStub: null, + ); @override void onWebResourceError(_i8.WebResourceError? error) => super.noSuchMethod( - Invocation.method(#onWebResourceError, [error]), - returnValueForMissingStub: null, - ); + Invocation.method(#onWebResourceError, [error]), + returnValueForMissingStub: null, + ); } /// A class which mocks [WebViewWidgetProxy]. @@ -1547,35 +1359,32 @@ class MockWebViewWidgetProxy extends _i1.Mock _i3.PlatformWebView createWebView( _i2.WKWebViewConfiguration? configuration, { void Function(String, _i2.NSObject, Map<_i2.KeyValueChangeKey, Object?>)? - observeValue, + observeValue, }) => (super.noSuchMethod( - Invocation.method( - #createWebView, - [configuration], - {#observeValue: observeValue}, - ), - returnValue: _FakePlatformWebView_15( - this, - Invocation.method( - #createWebView, - [configuration], - {#observeValue: observeValue}, - ), - ), - ) - as _i3.PlatformWebView); - - @override - _i2.URLRequest createRequest({required String? url}) => - (super.noSuchMethod( - Invocation.method(#createRequest, [], {#url: url}), - returnValue: _FakeURLRequest_2( - this, - Invocation.method(#createRequest, [], {#url: url}), - ), - ) - as _i2.URLRequest); + Invocation.method( + #createWebView, + [configuration], + {#observeValue: observeValue}, + ), + returnValue: _FakePlatformWebView_15( + this, + Invocation.method( + #createWebView, + [configuration], + {#observeValue: observeValue}, + ), + ), + ) as _i3.PlatformWebView); + + @override + _i2.URLRequest createRequest({required String? url}) => (super.noSuchMethod( + Invocation.method(#createRequest, [], {#url: url}), + returnValue: _FakeURLRequest_2( + this, + Invocation.method(#createRequest, [], {#url: url}), + ), + ) as _i2.URLRequest); @override _i2.WKScriptMessageHandler createScriptMessageHandler({ @@ -1583,21 +1392,19 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKScriptMessageHandler, _i2.WKUserContentController, _i2.WKScriptMessage, - )? - didReceiveScriptMessage, + )? didReceiveScriptMessage, }) => (super.noSuchMethod( - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - returnValue: _FakeWKScriptMessageHandler_6( - this, - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - ), - ) - as _i2.WKScriptMessageHandler); + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + returnValue: _FakeWKScriptMessageHandler_6( + this, + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + ), + ) as _i2.WKScriptMessageHandler); @override _i2.WKUIDelegate createUIDelgate({ @@ -1606,86 +1413,77 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKWebView, _i2.WKWebViewConfiguration, _i2.WKNavigationAction, - )? - onCreateWebView, + )? onCreateWebView, }) => (super.noSuchMethod( - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - returnValue: _FakeWKUIDelegate_14( - this, - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - ), - ) - as _i2.WKUIDelegate); + Invocation.method(#createUIDelgate, [], { + #onCreateWebView: onCreateWebView, + }), + returnValue: _FakeWKUIDelegate_14( + this, + Invocation.method(#createUIDelgate, [], { + #onCreateWebView: onCreateWebView, + }), + ), + ) as _i2.WKUIDelegate); @override _i2.WKNavigationDelegate createNavigationDelegate({ void Function(_i2.WKNavigationDelegate, _i2.WKWebView, String?)? - didFinishNavigation, + didFinishNavigation, void Function(_i2.WKNavigationDelegate, _i2.WKWebView, String?)? - didStartProvisionalNavigation, + didStartProvisionalNavigation, required _i4.Future<_i2.NavigationActionPolicy> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.WKNavigationAction, - )? - decidePolicyForNavigationAction, + )? decidePolicyForNavigationAction, void Function(_i2.WKNavigationDelegate, _i2.WKWebView, _i2.NSError)? - didFailNavigation, + didFailNavigation, void Function(_i2.WKNavigationDelegate, _i2.WKWebView, _i2.NSError)? - didFailProvisionalNavigation, + didFailProvisionalNavigation, void Function(_i2.WKNavigationDelegate, _i2.WKWebView)? - webViewWebContentProcessDidTerminate, + webViewWebContentProcessDidTerminate, required _i4.Future<_i2.NavigationResponsePolicy> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.WKNavigationResponse, - )? - decidePolicyForNavigationResponse, + )? decidePolicyForNavigationResponse, required _i4.Future<_i2.AuthenticationChallengeResponse> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.URLAuthenticationChallenge, - )? - didReceiveAuthenticationChallenge, + )? didReceiveAuthenticationChallenge, }) => (super.noSuchMethod( - Invocation.method(#createNavigationDelegate, [], { - #didFinishNavigation: didFinishNavigation, - #didStartProvisionalNavigation: didStartProvisionalNavigation, - #decidePolicyForNavigationAction: decidePolicyForNavigationAction, - #didFailNavigation: didFailNavigation, - #didFailProvisionalNavigation: didFailProvisionalNavigation, - #webViewWebContentProcessDidTerminate: - webViewWebContentProcessDidTerminate, - #decidePolicyForNavigationResponse: - decidePolicyForNavigationResponse, - #didReceiveAuthenticationChallenge: - didReceiveAuthenticationChallenge, - }), - returnValue: _FakeWKNavigationDelegate_4( - this, - Invocation.method(#createNavigationDelegate, [], { - #didFinishNavigation: didFinishNavigation, - #didStartProvisionalNavigation: didStartProvisionalNavigation, - #decidePolicyForNavigationAction: - decidePolicyForNavigationAction, - #didFailNavigation: didFailNavigation, - #didFailProvisionalNavigation: didFailProvisionalNavigation, - #webViewWebContentProcessDidTerminate: - webViewWebContentProcessDidTerminate, - #decidePolicyForNavigationResponse: - decidePolicyForNavigationResponse, - #didReceiveAuthenticationChallenge: - didReceiveAuthenticationChallenge, - }), - ), - ) - as _i2.WKNavigationDelegate); + Invocation.method(#createNavigationDelegate, [], { + #didFinishNavigation: didFinishNavigation, + #didStartProvisionalNavigation: didStartProvisionalNavigation, + #decidePolicyForNavigationAction: decidePolicyForNavigationAction, + #didFailNavigation: didFailNavigation, + #didFailProvisionalNavigation: didFailProvisionalNavigation, + #webViewWebContentProcessDidTerminate: + webViewWebContentProcessDidTerminate, + #decidePolicyForNavigationResponse: decidePolicyForNavigationResponse, + #didReceiveAuthenticationChallenge: didReceiveAuthenticationChallenge, + }), + returnValue: _FakeWKNavigationDelegate_4( + this, + Invocation.method(#createNavigationDelegate, [], { + #didFinishNavigation: didFinishNavigation, + #didStartProvisionalNavigation: didStartProvisionalNavigation, + #decidePolicyForNavigationAction: decidePolicyForNavigationAction, + #didFailNavigation: didFailNavigation, + #didFailProvisionalNavigation: didFailProvisionalNavigation, + #webViewWebContentProcessDidTerminate: + webViewWebContentProcessDidTerminate, + #decidePolicyForNavigationResponse: + decidePolicyForNavigationResponse, + #didReceiveAuthenticationChallenge: + didReceiveAuthenticationChallenge, + }), + ), + ) as _i2.WKNavigationDelegate); } /// A class which mocks [WKWebpagePreferences]. @@ -1698,35 +1496,30 @@ class MockWKWebpagePreferences extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i4.Future setAllowsContentJavaScript(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsContentJavaScript, [allow]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setAllowsContentJavaScript, [allow]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.WKWebpagePreferences pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebpagePreferences_12( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebpagePreferences); + _i2.WKWebpagePreferences pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebpagePreferences_12( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebpagePreferences); @override _i4.Future addObserver( @@ -1735,18 +1528,16 @@ class MockWKWebpagePreferences extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart index d1d901a7228..503c38a6dc5 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart @@ -27,29 +27,29 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeURLProtectionSpace_1 extends _i1.SmartFake implements _i2.URLProtectionSpace { _FakeURLProtectionSpace_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeURLAuthenticationChallenge_2 extends _i1.SmartFake implements _i2.URLAuthenticationChallenge { _FakeURLAuthenticationChallenge_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeURLRequest_3 extends _i1.SmartFake implements _i2.URLRequest { _FakeURLRequest_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeURL_4 extends _i1.SmartFake implements _i2.URL { _FakeURL_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [URLAuthenticationChallenge]. @@ -62,39 +62,34 @@ class MockURLAuthenticationChallenge extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i3.Future<_i2.URLProtectionSpace> getProtectionSpace() => (super.noSuchMethod( + Invocation.method(#getProtectionSpace, []), + returnValue: _i3.Future<_i2.URLProtectionSpace>.value( + _FakeURLProtectionSpace_1( + this, Invocation.method(#getProtectionSpace, []), - returnValue: _i3.Future<_i2.URLProtectionSpace>.value( - _FakeURLProtectionSpace_1( - this, - Invocation.method(#getProtectionSpace, []), - ), - ), - ) - as _i3.Future<_i2.URLProtectionSpace>); + ), + ), + ) as _i3.Future<_i2.URLProtectionSpace>); @override - _i2.URLAuthenticationChallenge pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeURLAuthenticationChallenge_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.URLAuthenticationChallenge); + _i2.URLAuthenticationChallenge pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURLAuthenticationChallenge_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.URLAuthenticationChallenge); @override _i3.Future addObserver( @@ -103,20 +98,18 @@ class MockURLAuthenticationChallenge extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [URLRequest]. @@ -128,85 +121,69 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i3.Future getUrl() => - (super.noSuchMethod( - Invocation.method(#getUrl, []), - returnValue: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future getUrl() => (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future setHttpMethod(String? method) => - (super.noSuchMethod( - Invocation.method(#setHttpMethod, [method]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setHttpMethod(String? method) => (super.noSuchMethod( + Invocation.method(#setHttpMethod, [method]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future getHttpMethod() => - (super.noSuchMethod( - Invocation.method(#getHttpMethod, []), - returnValue: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future getHttpMethod() => (super.noSuchMethod( + Invocation.method(#getHttpMethod, []), + returnValue: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future setHttpBody(_i4.Uint8List? body) => - (super.noSuchMethod( - Invocation.method(#setHttpBody, [body]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setHttpBody(_i4.Uint8List? body) => (super.noSuchMethod( + Invocation.method(#setHttpBody, [body]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future<_i4.Uint8List?> getHttpBody() => - (super.noSuchMethod( - Invocation.method(#getHttpBody, []), - returnValue: _i3.Future<_i4.Uint8List?>.value(), - ) - as _i3.Future<_i4.Uint8List?>); + _i3.Future<_i4.Uint8List?> getHttpBody() => (super.noSuchMethod( + Invocation.method(#getHttpBody, []), + returnValue: _i3.Future<_i4.Uint8List?>.value(), + ) as _i3.Future<_i4.Uint8List?>); @override _i3.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method(#setAllHttpHeaderFields, [fields]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setAllHttpHeaderFields, [fields]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future?> getAllHttpHeaderFields() => (super.noSuchMethod( - Invocation.method(#getAllHttpHeaderFields, []), - returnValue: _i3.Future?>.value(), - ) - as _i3.Future?>); + Invocation.method(#getAllHttpHeaderFields, []), + returnValue: _i3.Future?>.value(), + ) as _i3.Future?>); @override - _i2.URLRequest pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeURLRequest_3( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.URLRequest); + _i2.URLRequest pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURLRequest_3( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.URLRequest); @override _i3.Future addObserver( @@ -215,20 +192,18 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [URL]. @@ -240,36 +215,30 @@ class MockURL extends _i1.Mock implements _i2.URL { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i3.Future getAbsoluteString() => - (super.noSuchMethod( + _i3.Future getAbsoluteString() => (super.noSuchMethod( + Invocation.method(#getAbsoluteString, []), + returnValue: _i3.Future.value( + _i5.dummyValue( + this, Invocation.method(#getAbsoluteString, []), - returnValue: _i3.Future.value( - _i5.dummyValue( - this, - Invocation.method(#getAbsoluteString, []), - ), - ), - ) - as _i3.Future); + ), + ), + ) as _i3.Future); @override - _i2.URL pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeURL_4(this, Invocation.method(#pigeon_copy, [])), - ) - as _i2.URL); + _i2.URL pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURL_4(this, Invocation.method(#pigeon_copy, [])), + ) as _i2.URL); @override _i3.Future addObserver( @@ -278,18 +247,16 @@ class MockURL extends _i1.Mock implements _i2.URL { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart index d18ea83db19..59f32c8c453 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart @@ -27,85 +27,85 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIScrollView_1 extends _i1.SmartFake implements _i2.UIScrollView { _FakeUIScrollView_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIScrollViewDelegate_2 extends _i1.SmartFake implements _i2.UIScrollViewDelegate { _FakeUIScrollViewDelegate_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeURL_3 extends _i1.SmartFake implements _i2.URL { _FakeURL_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeURLRequest_4 extends _i1.SmartFake implements _i2.URLRequest { _FakeURLRequest_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKPreferences_5 extends _i1.SmartFake implements _i2.WKPreferences { _FakeWKPreferences_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKScriptMessageHandler_6 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { _FakeWKScriptMessageHandler_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUserContentController_7 extends _i1.SmartFake implements _i2.WKUserContentController { _FakeWKUserContentController_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUserScript_8 extends _i1.SmartFake implements _i2.WKUserScript { _FakeWKUserScript_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebView_9 extends _i1.SmartFake implements _i2.WKWebView { _FakeWKWebView_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebsiteDataStore_10 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { _FakeWKWebsiteDataStore_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebpagePreferences_11 extends _i1.SmartFake implements _i2.WKWebpagePreferences { _FakeWKWebpagePreferences_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebViewConfiguration_12 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { _FakeWKWebViewConfiguration_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIViewWKWebView_13 extends _i1.SmartFake implements _i2.UIViewWKWebView { _FakeUIViewWKWebView_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKHTTPCookieStore_14 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { _FakeWKHTTPCookieStore_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [UIScrollView]. @@ -113,135 +113,112 @@ class _FakeWKHTTPCookieStore_14 extends _i1.SmartFake /// See the documentation for Mockito's code generation for more information. class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i3.Future> getContentOffset() => - (super.noSuchMethod( - Invocation.method(#getContentOffset, []), - returnValue: _i3.Future>.value([]), - returnValueForMissingStub: _i3.Future>.value( - [], - ), - ) - as _i3.Future>); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i3.Future scrollBy(double? x, double? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future> getContentOffset() => (super.noSuchMethod( + Invocation.method(#getContentOffset, []), + returnValue: _i3.Future>.value([]), + returnValueForMissingStub: _i3.Future>.value( + [], + ), + ) as _i3.Future>); + + @override + _i3.Future scrollBy(double? x, double? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setContentOffset(double? x, double? y) => (super.noSuchMethod( - Invocation.method(#setContentOffset, [x, y]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setContentOffset, [x, y]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setDelegate(_i2.UIScrollViewDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setDelegate, [delegate]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setDelegate, [delegate]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future setBounces(bool? value) => - (super.noSuchMethod( - Invocation.method(#setBounces, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setBounces(bool? value) => (super.noSuchMethod( + Invocation.method(#setBounces, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future setBouncesHorizontally(bool? value) => - (super.noSuchMethod( - Invocation.method(#setBouncesHorizontally, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setBouncesHorizontally(bool? value) => (super.noSuchMethod( + Invocation.method(#setBouncesHorizontally, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future setBouncesVertically(bool? value) => - (super.noSuchMethod( - Invocation.method(#setBouncesVertically, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setBouncesVertically(bool? value) => (super.noSuchMethod( + Invocation.method(#setBouncesVertically, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future setAlwaysBounceVertical(bool? value) => - (super.noSuchMethod( - Invocation.method(#setAlwaysBounceVertical, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setAlwaysBounceVertical(bool? value) => (super.noSuchMethod( + Invocation.method(#setAlwaysBounceVertical, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setAlwaysBounceHorizontal(bool? value) => (super.noSuchMethod( - Invocation.method(#setAlwaysBounceHorizontal, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setAlwaysBounceHorizontal, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.UIScrollView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeUIScrollView_1( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeUIScrollView_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.UIScrollView); - - @override - _i3.Future setBackgroundColor(int? value) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i2.UIScrollView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIScrollView_1( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeUIScrollView_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.UIScrollView); @override - _i3.Future setOpaque(bool? opaque) => - (super.noSuchMethod( - Invocation.method(#setOpaque, [opaque]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setBackgroundColor(int? value) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future setOpaque(bool? opaque) => (super.noSuchMethod( + Invocation.method(#setOpaque, [opaque]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future addObserver( @@ -250,20 +227,18 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [UIScrollViewDelegate]. @@ -272,34 +247,30 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { class MockUIScrollViewDelegate extends _i1.Mock implements _i2.UIScrollViewDelegate { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.UIScrollViewDelegate pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeUIScrollViewDelegate_2( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeUIScrollViewDelegate_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.UIScrollViewDelegate); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.UIScrollViewDelegate pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIScrollViewDelegate_2( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeUIScrollViewDelegate_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.UIScrollViewDelegate); @override _i3.Future addObserver( @@ -308,20 +279,18 @@ class MockUIScrollViewDelegate extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [URL]. @@ -329,50 +298,44 @@ class MockUIScrollViewDelegate extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockURL extends _i1.Mock implements _i2.URL { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i3.Future getAbsoluteString() => - (super.noSuchMethod( + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i3.Future getAbsoluteString() => (super.noSuchMethod( + Invocation.method(#getAbsoluteString, []), + returnValue: _i3.Future.value( + _i4.dummyValue( + this, Invocation.method(#getAbsoluteString, []), - returnValue: _i3.Future.value( - _i4.dummyValue( - this, - Invocation.method(#getAbsoluteString, []), - ), - ), - returnValueForMissingStub: _i3.Future.value( - _i4.dummyValue( - this, - Invocation.method(#getAbsoluteString, []), - ), - ), - ) - as _i3.Future); - - @override - _i2.URL pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeURL_3(this, Invocation.method(#pigeon_copy, [])), - returnValueForMissingStub: _FakeURL_3( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.URL); + ), + ), + returnValueForMissingStub: _i3.Future.value( + _i4.dummyValue( + this, + Invocation.method(#getAbsoluteString, []), + ), + ), + ) as _i3.Future); + + @override + _i2.URL pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURL_3(this, Invocation.method(#pigeon_copy, [])), + returnValueForMissingStub: _FakeURL_3( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.URL); @override _i3.Future addObserver( @@ -381,20 +344,18 @@ class MockURL extends _i1.Mock implements _i2.URL { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [URLRequest]. @@ -402,97 +363,81 @@ class MockURL extends _i1.Mock implements _i2.URL { /// See the documentation for Mockito's code generation for more information. class MockURLRequest extends _i1.Mock implements _i2.URLRequest { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i3.Future getUrl() => - (super.noSuchMethod( - Invocation.method(#getUrl, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i3.Future setHttpMethod(String? method) => - (super.noSuchMethod( - Invocation.method(#setHttpMethod, [method]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future getUrl() => (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future getHttpMethod() => - (super.noSuchMethod( - Invocation.method(#getHttpMethod, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setHttpMethod(String? method) => (super.noSuchMethod( + Invocation.method(#setHttpMethod, [method]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future setHttpBody(_i5.Uint8List? body) => - (super.noSuchMethod( - Invocation.method(#setHttpBody, [body]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future getHttpMethod() => (super.noSuchMethod( + Invocation.method(#getHttpMethod, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future<_i5.Uint8List?> getHttpBody() => - (super.noSuchMethod( - Invocation.method(#getHttpBody, []), - returnValue: _i3.Future<_i5.Uint8List?>.value(), - returnValueForMissingStub: _i3.Future<_i5.Uint8List?>.value(), - ) - as _i3.Future<_i5.Uint8List?>); + _i3.Future setHttpBody(_i5.Uint8List? body) => (super.noSuchMethod( + Invocation.method(#setHttpBody, [body]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future<_i5.Uint8List?> getHttpBody() => (super.noSuchMethod( + Invocation.method(#getHttpBody, []), + returnValue: _i3.Future<_i5.Uint8List?>.value(), + returnValueForMissingStub: _i3.Future<_i5.Uint8List?>.value(), + ) as _i3.Future<_i5.Uint8List?>); @override _i3.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method(#setAllHttpHeaderFields, [fields]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setAllHttpHeaderFields, [fields]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future?> getAllHttpHeaderFields() => (super.noSuchMethod( - Invocation.method(#getAllHttpHeaderFields, []), - returnValue: _i3.Future?>.value(), - returnValueForMissingStub: _i3.Future?>.value(), - ) - as _i3.Future?>); + Invocation.method(#getAllHttpHeaderFields, []), + returnValue: _i3.Future?>.value(), + returnValueForMissingStub: _i3.Future?>.value(), + ) as _i3.Future?>); @override - _i2.URLRequest pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeURLRequest_4( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeURLRequest_4( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.URLRequest); + _i2.URLRequest pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURLRequest_4( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeURLRequest_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.URLRequest); @override _i3.Future addObserver( @@ -501,20 +446,18 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKPreferences]. @@ -522,43 +465,37 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { /// See the documentation for Mockito's code generation for more information. class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i3.Future setJavaScriptEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [enabled]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i2.WKPreferences pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKPreferences_5( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWKPreferences_5( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKPreferences); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i3.Future setJavaScriptEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [enabled]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_5( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKPreferences_5( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKPreferences); @override _i3.Future addObserver( @@ -567,20 +504,18 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKScriptMessageHandler]. @@ -593,58 +528,49 @@ class MockWKScriptMessageHandler extends _i1.Mock _i2.WKScriptMessageHandler, _i2.WKUserContentController, _i2.WKScriptMessage, - ) - get didReceiveScriptMessage => - (super.noSuchMethod( - Invocation.getter(#didReceiveScriptMessage), - returnValue: - ( - _i2.WKScriptMessageHandler pigeon_instance, - _i2.WKUserContentController controller, - _i2.WKScriptMessage message, - ) {}, - returnValueForMissingStub: - ( - _i2.WKScriptMessageHandler pigeon_instance, - _i2.WKUserContentController controller, - _i2.WKScriptMessage message, - ) {}, - ) - as void Function( - _i2.WKScriptMessageHandler, - _i2.WKUserContentController, - _i2.WKScriptMessage, - )); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.WKScriptMessageHandler pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKScriptMessageHandler_6( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWKScriptMessageHandler_6( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKScriptMessageHandler); + ) get didReceiveScriptMessage => (super.noSuchMethod( + Invocation.getter(#didReceiveScriptMessage), + returnValue: ( + _i2.WKScriptMessageHandler pigeon_instance, + _i2.WKUserContentController controller, + _i2.WKScriptMessage message, + ) {}, + returnValueForMissingStub: ( + _i2.WKScriptMessageHandler pigeon_instance, + _i2.WKUserContentController controller, + _i2.WKScriptMessage message, + ) {}, + ) as void Function( + _i2.WKScriptMessageHandler, + _i2.WKUserContentController, + _i2.WKScriptMessage, + )); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WKScriptMessageHandler pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKScriptMessageHandler_6( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKScriptMessageHandler_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKScriptMessageHandler); @override _i3.Future addObserver( @@ -653,20 +579,18 @@ class MockWKScriptMessageHandler extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKUserContentController]. @@ -675,19 +599,17 @@ class MockWKScriptMessageHandler extends _i1.Mock class MockWKUserContentController extends _i1.Mock implements _i2.WKUserContentController { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i3.Future addScriptMessageHandler( @@ -695,62 +617,53 @@ class MockWKUserContentController extends _i1.Mock String? name, ) => (super.noSuchMethod( - Invocation.method(#addScriptMessageHandler, [handler, name]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addScriptMessageHandler, [handler, name]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( - Invocation.method(#removeScriptMessageHandler, [name]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeScriptMessageHandler, [name]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future removeAllScriptMessageHandlers() => - (super.noSuchMethod( - Invocation.method(#removeAllScriptMessageHandlers, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( + Invocation.method(#removeAllScriptMessageHandlers, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future addUserScript(_i2.WKUserScript? userScript) => (super.noSuchMethod( - Invocation.method(#addUserScript, [userScript]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addUserScript, [userScript]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future removeAllUserScripts() => - (super.noSuchMethod( - Invocation.method(#removeAllUserScripts, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future removeAllUserScripts() => (super.noSuchMethod( + Invocation.method(#removeAllUserScripts, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.WKUserContentController pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKUserContentController_7( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWKUserContentController_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKUserContentController); + _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_7( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKUserContentController_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKUserContentController); @override _i3.Future addObserver( @@ -759,20 +672,18 @@ class MockWKUserContentController extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKUserScript]. @@ -780,68 +691,57 @@ class MockWKUserContentController extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockWKUserScript extends _i1.Mock implements _i2.WKUserScript { @override - String get source => - (super.noSuchMethod( - Invocation.getter(#source), - returnValue: _i4.dummyValue( - this, - Invocation.getter(#source), - ), - returnValueForMissingStub: _i4.dummyValue( - this, - Invocation.getter(#source), - ), - ) - as String); - - @override - _i2.UserScriptInjectionTime get injectionTime => - (super.noSuchMethod( - Invocation.getter(#injectionTime), - returnValue: _i2.UserScriptInjectionTime.atDocumentStart, - returnValueForMissingStub: - _i2.UserScriptInjectionTime.atDocumentStart, - ) - as _i2.UserScriptInjectionTime); - - @override - bool get isForMainFrameOnly => - (super.noSuchMethod( - Invocation.getter(#isForMainFrameOnly), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.WKUserScript pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKUserScript_8( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWKUserScript_8( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKUserScript); + String get source => (super.noSuchMethod( + Invocation.getter(#source), + returnValue: _i4.dummyValue( + this, + Invocation.getter(#source), + ), + returnValueForMissingStub: _i4.dummyValue( + this, + Invocation.getter(#source), + ), + ) as String); + + @override + _i2.UserScriptInjectionTime get injectionTime => (super.noSuchMethod( + Invocation.getter(#injectionTime), + returnValue: _i2.UserScriptInjectionTime.atDocumentStart, + returnValueForMissingStub: _i2.UserScriptInjectionTime.atDocumentStart, + ) as _i2.UserScriptInjectionTime); + + @override + bool get isForMainFrameOnly => (super.noSuchMethod( + Invocation.getter(#isForMainFrameOnly), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WKUserScript pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserScript_8( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKUserScript_8( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKUserScript); @override _i3.Future addObserver( @@ -850,20 +750,18 @@ class MockWKUserScript extends _i1.Mock implements _i2.WKUserScript { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKWebView]. @@ -871,34 +769,30 @@ class MockWKUserScript extends _i1.Mock implements _i2.WKUserScript { /// See the documentation for Mockito's code generation for more information. class MockWKWebView extends _i1.Mock implements _i2.WKWebView { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.WKWebView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebView_9( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWKWebView_9( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebView); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WKWebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebView_9( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKWebView_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebView); @override _i3.Future addObserver( @@ -907,20 +801,18 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKWebViewConfiguration]. @@ -929,172 +821,156 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { class MockWKWebViewConfiguration extends _i1.Mock implements _i2.WKWebViewConfiguration { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i3.Future setUserContentController( _i2.WKUserContentController? controller, ) => (super.noSuchMethod( - Invocation.method(#setUserContentController, [controller]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setUserContentController, [controller]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( + Invocation.method(#getUserContentController, []), + returnValue: _i3.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_7( + this, Invocation.method(#getUserContentController, []), - returnValue: _i3.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_7( - this, - Invocation.method(#getUserContentController, []), - ), - ), - returnValueForMissingStub: - _i3.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_7( - this, - Invocation.method(#getUserContentController, []), - ), - ), - ) - as _i3.Future<_i2.WKUserContentController>); + ), + ), + returnValueForMissingStub: + _i3.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_7( + this, + Invocation.method(#getUserContentController, []), + ), + ), + ) as _i3.Future<_i2.WKUserContentController>); @override _i3.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method(#setWebsiteDataStore, [dataStore]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setWebsiteDataStore, [dataStore]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( + Invocation.method(#getWebsiteDataStore, []), + returnValue: _i3.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_10( + this, + Invocation.method(#getWebsiteDataStore, []), + ), + ), + returnValueForMissingStub: _i3.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_10( + this, Invocation.method(#getWebsiteDataStore, []), - returnValue: _i3.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_10( - this, - Invocation.method(#getWebsiteDataStore, []), - ), - ), - returnValueForMissingStub: _i3.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_10( - this, - Invocation.method(#getWebsiteDataStore, []), - ), - ), - ) - as _i3.Future<_i2.WKWebsiteDataStore>); + ), + ), + ) as _i3.Future<_i2.WKWebsiteDataStore>); @override _i3.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method(#setPreferences, [preferences]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setPreferences, [preferences]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future<_i2.WKPreferences> getPreferences() => - (super.noSuchMethod( + _i3.Future<_i2.WKPreferences> getPreferences() => (super.noSuchMethod( + Invocation.method(#getPreferences, []), + returnValue: _i3.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_5( + this, Invocation.method(#getPreferences, []), - returnValue: _i3.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_5( - this, - Invocation.method(#getPreferences, []), - ), - ), - returnValueForMissingStub: _i3.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_5( - this, - Invocation.method(#getPreferences, []), - ), - ), - ) - as _i3.Future<_i2.WKPreferences>); + ), + ), + returnValueForMissingStub: _i3.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_5( + this, + Invocation.method(#getPreferences, []), + ), + ), + ) as _i3.Future<_i2.WKPreferences>); @override _i3.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsInlineMediaPlayback, [allow]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setMediaTypesRequiringUserActionForPlayback( _i2.AudiovisualMediaType? type, ) => (super.noSuchMethod( - Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ - type, - ]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ + type, + ]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => (super.noSuchMethod( + Invocation.method(#getDefaultWebpagePreferences, []), + returnValue: _i3.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_11( + this, Invocation.method(#getDefaultWebpagePreferences, []), - returnValue: _i3.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_11( - this, - Invocation.method(#getDefaultWebpagePreferences, []), - ), - ), - returnValueForMissingStub: - _i3.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_11( - this, - Invocation.method(#getDefaultWebpagePreferences, []), - ), - ), - ) - as _i3.Future<_i2.WKWebpagePreferences>); - - @override - _i2.WKWebViewConfiguration pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebViewConfiguration_12( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWKWebViewConfiguration_12( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebViewConfiguration); + ), + ), + returnValueForMissingStub: _i3.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_11( + this, + Invocation.method(#getDefaultWebpagePreferences, []), + ), + ), + ) as _i3.Future<_i2.WKWebpagePreferences>); + + @override + _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebViewConfiguration); @override _i3.Future addObserver( @@ -1103,20 +979,18 @@ class MockWKWebViewConfiguration extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKWebpagePreferences]. @@ -1125,43 +999,38 @@ class MockWKWebViewConfiguration extends _i1.Mock class MockWKWebpagePreferences extends _i1.Mock implements _i2.WKWebpagePreferences { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i3.Future setAllowsContentJavaScript(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsContentJavaScript, [allow]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setAllowsContentJavaScript, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.WKWebpagePreferences pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebpagePreferences_11( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWKWebpagePreferences_11( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebpagePreferences); + _i2.WKWebpagePreferences pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebpagePreferences_11( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKWebpagePreferences_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebpagePreferences); @override _i3.Future addObserver( @@ -1170,20 +1039,18 @@ class MockWKWebpagePreferences extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [UIViewWKWebView]. @@ -1191,283 +1058,235 @@ class MockWKWebpagePreferences extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override - _i2.WKWebViewConfiguration get configuration => - (super.noSuchMethod( - Invocation.getter(#configuration), - returnValue: _FakeWKWebViewConfiguration_12( - this, - Invocation.getter(#configuration), - ), - returnValueForMissingStub: _FakeWKWebViewConfiguration_12( - this, - Invocation.getter(#configuration), - ), - ) - as _i2.WKWebViewConfiguration); - - @override - _i2.UIScrollView get scrollView => - (super.noSuchMethod( - Invocation.getter(#scrollView), - returnValue: _FakeUIScrollView_1( - this, - Invocation.getter(#scrollView), - ), - returnValueForMissingStub: _FakeUIScrollView_1( - this, - Invocation.getter(#scrollView), - ), - ) - as _i2.UIScrollView); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.WKWebViewConfiguration pigeonVar_configuration() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_configuration, []), - returnValue: _FakeWKWebViewConfiguration_12( - this, - Invocation.method(#pigeonVar_configuration, []), - ), - returnValueForMissingStub: _FakeWKWebViewConfiguration_12( - this, - Invocation.method(#pigeonVar_configuration, []), - ), - ) - as _i2.WKWebViewConfiguration); - - @override - _i2.UIScrollView pigeonVar_scrollView() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_scrollView, []), - returnValue: _FakeUIScrollView_1( - this, - Invocation.method(#pigeonVar_scrollView, []), - ), - returnValueForMissingStub: _FakeUIScrollView_1( - this, - Invocation.method(#pigeonVar_scrollView, []), - ), - ) - as _i2.UIScrollView); + _i2.WKWebViewConfiguration get configuration => (super.noSuchMethod( + Invocation.getter(#configuration), + returnValue: _FakeWKWebViewConfiguration_12( + this, + Invocation.getter(#configuration), + ), + returnValueForMissingStub: _FakeWKWebViewConfiguration_12( + this, + Invocation.getter(#configuration), + ), + ) as _i2.WKWebViewConfiguration); + + @override + _i2.UIScrollView get scrollView => (super.noSuchMethod( + Invocation.getter(#scrollView), + returnValue: _FakeUIScrollView_1( + this, + Invocation.getter(#scrollView), + ), + returnValueForMissingStub: _FakeUIScrollView_1( + this, + Invocation.getter(#scrollView), + ), + ) as _i2.UIScrollView); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WKWebViewConfiguration pigeonVar_configuration() => (super.noSuchMethod( + Invocation.method(#pigeonVar_configuration, []), + returnValue: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeonVar_configuration, []), + ), + returnValueForMissingStub: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeonVar_configuration, []), + ), + ) as _i2.WKWebViewConfiguration); + + @override + _i2.UIScrollView pigeonVar_scrollView() => (super.noSuchMethod( + Invocation.method(#pigeonVar_scrollView, []), + returnValue: _FakeUIScrollView_1( + this, + Invocation.method(#pigeonVar_scrollView, []), + ), + returnValueForMissingStub: _FakeUIScrollView_1( + this, + Invocation.method(#pigeonVar_scrollView, []), + ), + ) as _i2.UIScrollView); @override _i3.Future setUIDelegate(_i2.WKUIDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setUIDelegate, [delegate]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setUIDelegate, [delegate]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setNavigationDelegate(_i2.WKNavigationDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setNavigationDelegate, [delegate]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setNavigationDelegate, [delegate]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future getUrl() => - (super.noSuchMethod( - Invocation.method(#getUrl, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future getUrl() => (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future getEstimatedProgress() => - (super.noSuchMethod( - Invocation.method(#getEstimatedProgress, []), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) - as _i3.Future); + _i3.Future getEstimatedProgress() => (super.noSuchMethod( + Invocation.method(#getEstimatedProgress, []), + returnValue: _i3.Future.value(0.0), + returnValueForMissingStub: _i3.Future.value(0.0), + ) as _i3.Future); @override - _i3.Future load(_i2.URLRequest? request) => - (super.noSuchMethod( - Invocation.method(#load, [request]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future load(_i2.URLRequest? request) => (super.noSuchMethod( + Invocation.method(#load, [request]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future loadHtmlString(String? string, String? baseUrl) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [string, baseUrl]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#loadHtmlString, [string, baseUrl]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future loadFileUrl(String? url, String? readAccessUrl) => (super.noSuchMethod( - Invocation.method(#loadFileUrl, [url, readAccessUrl]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#loadFileUrl, [url, readAccessUrl]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i3.Future.value(false), - returnValueForMissingStub: _i3.Future.value(false), - ) - as _i3.Future); + _i3.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i3.Future.value(false), + returnValueForMissingStub: _i3.Future.value(false), + ) as _i3.Future); @override - _i3.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i3.Future.value(false), - returnValueForMissingStub: _i3.Future.value(false), - ) - as _i3.Future); + _i3.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i3.Future.value(false), + returnValueForMissingStub: _i3.Future.value(false), + ) as _i3.Future); @override - _i3.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsBackForwardNavigationGestures, [allow]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setAllowsBackForwardNavigationGestures, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future setCustomUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setCustomUserAgent, [userAgent]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setCustomUserAgent, [userAgent]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future evaluateJavaScript(String? javaScriptString) => (super.noSuchMethod( - Invocation.method(#evaluateJavaScript, [javaScriptString]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#evaluateJavaScript, [javaScriptString]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future setInspectable(bool? inspectable) => - (super.noSuchMethod( - Invocation.method(#setInspectable, [inspectable]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setInspectable(bool? inspectable) => (super.noSuchMethod( + Invocation.method(#setInspectable, [inspectable]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future getCustomUserAgent() => - (super.noSuchMethod( - Invocation.method(#getCustomUserAgent, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future getCustomUserAgent() => (super.noSuchMethod( + Invocation.method(#getCustomUserAgent, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.UIViewWKWebView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeUIViewWKWebView_13( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeUIViewWKWebView_13( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.UIViewWKWebView); - - @override - _i3.Future setBackgroundColor(int? value) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i2.UIViewWKWebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIViewWKWebView_13( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeUIViewWKWebView_13( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.UIViewWKWebView); @override - _i3.Future setOpaque(bool? opaque) => - (super.noSuchMethod( - Invocation.method(#setOpaque, [opaque]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setBackgroundColor(int? value) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future setOpaque(bool? opaque) => (super.noSuchMethod( + Invocation.method(#setOpaque, [opaque]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future addObserver( @@ -1476,20 +1295,18 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKWebsiteDataStore]. @@ -1498,49 +1315,43 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { class MockWKWebsiteDataStore extends _i1.Mock implements _i2.WKWebsiteDataStore { @override - _i2.WKHTTPCookieStore get httpCookieStore => - (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_14( - this, - Invocation.getter(#httpCookieStore), - ), - returnValueForMissingStub: _FakeWKHTTPCookieStore_14( - this, - Invocation.getter(#httpCookieStore), - ), - ) - as _i2.WKHTTPCookieStore); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_httpCookieStore, []), - returnValue: _FakeWKHTTPCookieStore_14( - this, - Invocation.method(#pigeonVar_httpCookieStore, []), - ), - returnValueForMissingStub: _FakeWKHTTPCookieStore_14( - this, - Invocation.method(#pigeonVar_httpCookieStore, []), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_14( + this, + Invocation.getter(#httpCookieStore), + ), + returnValueForMissingStub: _FakeWKHTTPCookieStore_14( + this, + Invocation.getter(#httpCookieStore), + ), + ) as _i2.WKHTTPCookieStore); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_14( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + returnValueForMissingStub: _FakeWKHTTPCookieStore_14( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) as _i2.WKHTTPCookieStore); @override _i3.Future removeDataOfTypes( @@ -1548,29 +1359,26 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method(#removeDataOfTypes, [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ]), - returnValue: _i3.Future.value(false), - returnValueForMissingStub: _i3.Future.value(false), - ) - as _i3.Future); + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), + returnValue: _i3.Future.value(false), + returnValueForMissingStub: _i3.Future.value(false), + ) as _i3.Future); @override - _i2.WKWebsiteDataStore pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebsiteDataStore_10( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWKWebsiteDataStore_10( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebsiteDataStore); + _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_10( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWKWebsiteDataStore_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebsiteDataStore); @override _i3.Future addObserver( @@ -1579,18 +1387,16 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart index ce8c5682afc..d494fbba209 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart @@ -25,19 +25,19 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakeWKHTTPCookieStore_0 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { _FakeWKHTTPCookieStore_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePigeonInstanceManager_1 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebsiteDataStore_2 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { _FakeWKWebsiteDataStore_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [WKWebsiteDataStore]. @@ -50,37 +50,31 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => - (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_0( - this, - Invocation.getter(#httpCookieStore), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_0( + this, + Invocation.getter(#httpCookieStore), + ), + ) as _i2.WKHTTPCookieStore); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_1( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_1( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_httpCookieStore, []), - returnValue: _FakeWKHTTPCookieStore_0( - this, - Invocation.method(#pigeonVar_httpCookieStore, []), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_0( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) as _i2.WKHTTPCookieStore); @override _i3.Future removeDataOfTypes( @@ -88,24 +82,21 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method(#removeDataOfTypes, [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ]), - returnValue: _i3.Future.value(false), - ) - as _i3.Future); + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), + returnValue: _i3.Future.value(false), + ) as _i3.Future); @override - _i2.WKWebsiteDataStore pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebsiteDataStore_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebsiteDataStore); + _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebsiteDataStore); @override _i3.Future addObserver( @@ -114,20 +105,18 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKHTTPCookieStore]. @@ -139,35 +128,29 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_1( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_1( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i3.Future setCookie(_i2.HTTPCookie? cookie) => - (super.noSuchMethod( - Invocation.method(#setCookie, [cookie]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setCookie(_i2.HTTPCookie? cookie) => (super.noSuchMethod( + Invocation.method(#setCookie, [cookie]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.WKHTTPCookieStore pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKHTTPCookieStore_0( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKHTTPCookieStore_0( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKHTTPCookieStore); @override _i3.Future addObserver( @@ -176,18 +159,16 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart index 2e977a8f1a8..ce4ab60e4a0 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart @@ -25,47 +25,47 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUIDelegate_1 extends _i1.SmartFake implements _i2.WKUIDelegate { _FakeWKUIDelegate_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUserContentController_2 extends _i1.SmartFake implements _i2.WKUserContentController { _FakeWKUserContentController_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebsiteDataStore_3 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { _FakeWKWebsiteDataStore_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKPreferences_4 extends _i1.SmartFake implements _i2.WKPreferences { _FakeWKPreferences_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebpagePreferences_5 extends _i1.SmartFake implements _i2.WKWebpagePreferences { _FakeWKWebpagePreferences_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebViewConfiguration_6 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { _FakeWKWebViewConfiguration_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIScrollViewDelegate_7 extends _i1.SmartFake implements _i2.UIScrollViewDelegate { _FakeUIScrollViewDelegate_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [WKUIDelegate]. @@ -83,28 +83,25 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { _i2.WKSecurityOrigin, _i2.WKFrameInfo, _i2.MediaCaptureType, - ) - get requestMediaCapturePermission => - (super.noSuchMethod( - Invocation.getter(#requestMediaCapturePermission), - returnValue: - ( - _i2.WKUIDelegate pigeon_instance, - _i2.WKWebView webView, - _i2.WKSecurityOrigin origin, - _i2.WKFrameInfo frame, - _i2.MediaCaptureType type, - ) => _i3.Future<_i2.PermissionDecision>.value( - _i2.PermissionDecision.deny, - ), - ) - as _i3.Future<_i2.PermissionDecision> Function( - _i2.WKUIDelegate, - _i2.WKWebView, - _i2.WKSecurityOrigin, - _i2.WKFrameInfo, - _i2.MediaCaptureType, - )); + ) get requestMediaCapturePermission => (super.noSuchMethod( + Invocation.getter(#requestMediaCapturePermission), + returnValue: ( + _i2.WKUIDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.WKSecurityOrigin origin, + _i2.WKFrameInfo frame, + _i2.MediaCaptureType type, + ) => + _i3.Future<_i2.PermissionDecision>.value( + _i2.PermissionDecision.deny, + ), + ) as _i3.Future<_i2.PermissionDecision> Function( + _i2.WKUIDelegate, + _i2.WKWebView, + _i2.WKSecurityOrigin, + _i2.WKFrameInfo, + _i2.MediaCaptureType, + )); @override _i3.Future Function( @@ -112,46 +109,39 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { _i2.WKWebView, String, _i2.WKFrameInfo, - ) - get runJavaScriptConfirmPanel => - (super.noSuchMethod( - Invocation.getter(#runJavaScriptConfirmPanel), - returnValue: - ( - _i2.WKUIDelegate pigeon_instance, - _i2.WKWebView webView, - String message, - _i2.WKFrameInfo frame, - ) => _i3.Future.value(false), - ) - as _i3.Future Function( - _i2.WKUIDelegate, - _i2.WKWebView, - String, - _i2.WKFrameInfo, - )); + ) get runJavaScriptConfirmPanel => (super.noSuchMethod( + Invocation.getter(#runJavaScriptConfirmPanel), + returnValue: ( + _i2.WKUIDelegate pigeon_instance, + _i2.WKWebView webView, + String message, + _i2.WKFrameInfo frame, + ) => + _i3.Future.value(false), + ) as _i3.Future Function( + _i2.WKUIDelegate, + _i2.WKWebView, + String, + _i2.WKFrameInfo, + )); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i2.WKUIDelegate pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKUIDelegate_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKUIDelegate); + _i2.WKUIDelegate pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUIDelegate_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKUIDelegate); @override _i3.Future addObserver( @@ -160,20 +150,18 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKWebViewConfiguration]. @@ -186,138 +174,123 @@ class MockWKWebViewConfiguration extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i3.Future setUserContentController( _i2.WKUserContentController? controller, ) => (super.noSuchMethod( - Invocation.method(#setUserContentController, [controller]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setUserContentController, [controller]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( + Invocation.method(#getUserContentController, []), + returnValue: _i3.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_2( + this, Invocation.method(#getUserContentController, []), - returnValue: _i3.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_2( - this, - Invocation.method(#getUserContentController, []), - ), - ), - ) - as _i3.Future<_i2.WKUserContentController>); + ), + ), + ) as _i3.Future<_i2.WKUserContentController>); @override _i3.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method(#setWebsiteDataStore, [dataStore]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setWebsiteDataStore, [dataStore]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( + Invocation.method(#getWebsiteDataStore, []), + returnValue: _i3.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_3( + this, Invocation.method(#getWebsiteDataStore, []), - returnValue: _i3.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_3( - this, - Invocation.method(#getWebsiteDataStore, []), - ), - ), - ) - as _i3.Future<_i2.WKWebsiteDataStore>); + ), + ), + ) as _i3.Future<_i2.WKWebsiteDataStore>); @override _i3.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method(#setPreferences, [preferences]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setPreferences, [preferences]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future<_i2.WKPreferences> getPreferences() => - (super.noSuchMethod( + _i3.Future<_i2.WKPreferences> getPreferences() => (super.noSuchMethod( + Invocation.method(#getPreferences, []), + returnValue: _i3.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_4( + this, Invocation.method(#getPreferences, []), - returnValue: _i3.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_4( - this, - Invocation.method(#getPreferences, []), - ), - ), - ) - as _i3.Future<_i2.WKPreferences>); + ), + ), + ) as _i3.Future<_i2.WKPreferences>); @override _i3.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsInlineMediaPlayback, [allow]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setMediaTypesRequiringUserActionForPlayback( _i2.AudiovisualMediaType? type, ) => (super.noSuchMethod( - Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ - type, - ]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ + type, + ]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => (super.noSuchMethod( + Invocation.method(#getDefaultWebpagePreferences, []), + returnValue: _i3.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_5( + this, Invocation.method(#getDefaultWebpagePreferences, []), - returnValue: _i3.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_5( - this, - Invocation.method(#getDefaultWebpagePreferences, []), - ), - ), - ) - as _i3.Future<_i2.WKWebpagePreferences>); + ), + ), + ) as _i3.Future<_i2.WKWebpagePreferences>); @override - _i2.WKWebViewConfiguration pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebViewConfiguration_6( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebViewConfiguration); + _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebViewConfiguration); @override _i3.Future addObserver( @@ -326,20 +299,18 @@ class MockWKWebViewConfiguration extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [UIScrollViewDelegate]. @@ -352,26 +323,22 @@ class MockUIScrollViewDelegate extends _i1.Mock } @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_0( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i2.UIScrollViewDelegate pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeUIScrollViewDelegate_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.UIScrollViewDelegate); + _i2.UIScrollViewDelegate pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIScrollViewDelegate_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.UIScrollViewDelegate); @override _i3.Future addObserver( @@ -380,18 +347,16 @@ class MockUIScrollViewDelegate extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } From 2ea1d4c7028407f908b951960aa1065d8202fbd1 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 12 Feb 2025 22:33:08 -0500 Subject: [PATCH 09/10] unavailable is not --- .../Tests/PreferencesProxyAPITests.swift | 19 ++++++++++--------- .../PreferencesProxyAPIDelegate.swift | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift index fe0535e80b3..7088f93833e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift @@ -9,18 +9,19 @@ import XCTest class PreferencesProxyAPITests: XCTestCase { @MainActor func testSetJavaScriptEnabled() throws { - guard #unavailable(iOS 14.0, macOS 11.0) else { + if #available(iOS 14.0, macOS 11.0, *) { throw XCTSkip("Required API is not available for this test.") - } - let registrar = TestProxyApiRegistrar() - let api = registrar.apiDelegate.pigeonApiWKPreferences(registrar) + } else { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKPreferences(registrar) - let instance = WKPreferences() - let enabled = true - try? api.pigeonDelegate.setJavaScriptEnabled( - pigeonApi: api, pigeonInstance: instance, enabled: enabled) + let instance = WKPreferences() + let enabled = true + try? api.pigeonDelegate.setJavaScriptEnabled( + pigeonApi: api, pigeonInstance: instance, enabled: enabled) - XCTAssertEqual(instance.javaScriptEnabled, enabled) + XCTAssertEqual(instance.javaScriptEnabled, enabled) + } } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift index c577a26319e..1bffe7cd1c0 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift @@ -12,13 +12,13 @@ class PreferencesProxyAPIDelegate: PigeonApiDelegateWKPreferences { func setJavaScriptEnabled( pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool ) throws { - if #unavailable(iOS 14.0, macOS 11.0) { - pigeonInstance.javaScriptEnabled = enabled - } else { + if #available(iOS 14.0, macOS 11.0, *) { throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) .createUnsupportedVersionError( method: "WKPreferences.javaScriptEnabled", versionRequirements: "< iOS 14.0, macOS 11.0") + } else { + pigeonInstance.javaScriptEnabled = enabled } } } From d989135b31f1f947c8353a2fc6d3c510c6a2764b Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 12 Feb 2025 22:37:44 -0500 Subject: [PATCH 10/10] comment and changelog --- .../webview_flutter/webview_flutter_wkwebview/CHANGELOG.md | 4 ++-- .../PreferencesProxyAPIDelegate.swift | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index 1c9c0b1daa4..cfc1a99938f 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -1,7 +1,7 @@ ## 3.18.1 -* Updates internal API wrapper to make all Flutter methods with a non-null return value be required - to implement. +* Fixes bug that would allow the API wrapper to return `null` when a non-null value was required in + a callback method. * Changes default method to enable JavaScript for web content to `WKWebpagePreferences.allowsContentJavaScript`. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift index 1bffe7cd1c0..aca8f398ace 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift @@ -13,6 +13,8 @@ class PreferencesProxyAPIDelegate: PigeonApiDelegateWKPreferences { pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool ) throws { if #available(iOS 14.0, macOS 11.0, *) { + // On iOS 14 and macOS 11, WKWebpagePreferences.allowsContentJavaScript should be + // used instead. throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) .createUnsupportedVersionError( method: "WKPreferences.javaScriptEnabled",